-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
108 lines (91 loc) · 2.48 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import kotlin.io.path.readText
plugins {
kotlin("jvm") version "2.0.10"
kotlin("plugin.serialization") version "2.0.10"
id("fabric-loom") version "1.7-SNAPSHOT"
id("com.github.breadmoirai.github-release") version "2.5.2"
`maven-publish`
}
group = "dev.nyon"
val mcVersion = "1.20.4"
version = "2.0.2-$mcVersion"
repositories {
mavenCentral()
maven("https://maven.parchmentmc.org")
}
dependencies {
minecraft("com.mojang:minecraft:$mcVersion")
mappings(
loom.layered {
parchment("org.parchmentmc.data:parchment-1.20.3:2023.12.31@zip")
officialMojangMappings()
}
)
implementation("org.vineflower:vineflower:1.9.3")
implementation("net.fabricmc:fabric-loader:0.15.11")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1")
testImplementation(kotlin("test"))
}
tasks {
register("release") {
group = "publishing"
dependsOn("githubRelease")
dependsOn("publish")
}
withType<JavaCompile> {
options.release.set(17)
}
withType<KotlinCompile> {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
}
}
}
kotlin {
sourceSets.all {
languageSettings {
optIn("dev.nyon.konfig.internal.InternalKonfigApi")
}
}
}
val changelogText =
buildString {
append("# v${project.version}\n")
file("changelog.md").readText().also { append(it) }
}
githubRelease {
token(providers.environmentVariable("GITHUB_TOKEN"))
owner = "btwonion"
repo = "konfig"
releaseName = project.version.toString()
tagName = project.version.toString()
body = changelogText
targetCommitish = "master"
setReleaseAssets(tasks["remapJar"].outputs.files)
}
publishing {
repositories {
maven {
name = "nyon"
url = uri("https://repo.nyon.dev/releases")
credentials {
username = providers.environmentVariable("NYON_USERNAME").orNull
password = providers.environmentVariable("NYON_PASSWORD").orNull
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = "dev.nyon"
artifactId = "konfig"
version = project.version.toString()
from(components["java"])
}
}
}
java {
withJavadocJar()
withSourcesJar()
}