This repository has been archived by the owner on Oct 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
156 lines (136 loc) · 4.22 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("java")
id("maven-publish")
id("com.github.johnrengelman.shadow").version("7.1.2")
id("com.modrinth.minotaur").version("2.+")
}
group = "io.github.prismwork"
version = property("project_version")!!
val include: Configuration by configurations.creating
fun relocatePackage(name: String) : String {
return "$group.prismconfig.libs.$name"
}
tasks.named<ShadowJar>("shadowJar") {
from("LICENSE")
configurations = listOf(include)
relocate("blue.endless.jankson", relocatePackage("jankson"))
relocate("com.google.gson", relocatePackage("gson"))
relocate("com.moandjiezana.toml", relocatePackage("toml4j"))
relocate("org.jetbrains.annotations", relocatePackage("jb.annotations"))
relocate("org.intellij.lang.annotations", relocatePackage("ij.annotations"))
}
repositories {
mavenCentral()
maven {
name = "QuiltMC Release" // quilt-json5, though unused
url = uri("https://maven.quiltmc.org/repository/release/")
}
maven {
name = "QuiltMC Snapshot" // quilt-json5, though unused
url = uri("https://maven.quiltmc.org/repository/snapshot/")
}
maven {
name = "unascribed" // kdl4j, though unused
url = uri("https://repo.unascribed.com/")
}
}
dependencies {
/* Utilities */
include("org.jetbrains:annotations:23.1.0")?.let { implementation(it) }
/* Serialization */
include("com.google.code.gson:gson:2.10")?.let { implementation(it) }
include("blue.endless:jankson:1.2.1")?.let { implementation(it) }
include("com.moandjiezana.toml:toml4j:0.7.2")?.let { implementation(it) }
// include("org.yaml:snakeyaml:1.33")?.let { implementation(it) }
// include("dev.hbeck.kdl:kdl4j:0.2.0")?.let { implementation(it) }
// include("org.quiltmc:quilt-json5:1.0.2")?.let { implementation(it) }
/* Test */
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.0")
}
tasks.getByName<Test>("test") {
useJUnitPlatform()
}
tasks.jar {
from("LICENSE")
finalizedBy(tasks.shadowJar)
}
tasks.processResources {
inputs.property("version", project.version)
filesMatching("fabric.mod.json") {
expand(mutableMapOf("version" to project.version))
}
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set("prism-config")
versionNumber.set("$version")
versionName.set("Prism Config $version")
versionType.set("release")
uploadFile.set(tasks.shadowJar as Any)
changelog.set(file("CHANGELOG.md").readText())
detectLoaders.set(false)
gameVersions.addAll(
"1.14",
"1.14.1",
"1.14.2",
"1.14.3",
"1.14.4",
"1.15",
"1.15.1",
"1.15.2",
"1.16",
"1.16.1",
"1.16.2",
"1.16.3",
"1.16.4",
"1.16.5",
"1.17",
"1.17.1",
"1.18",
"1.18.1",
"1.18.2",
"1.19",
"1.19.1",
"1.19.2",
"1.19.3"
)
loaders.addAll("fabric", "forge", "quilt")
}
publishing {
publications {
create<MavenPublication>("prismconfig") {
groupId = "$group"
artifactId = name
version = version
from(components["java"])
}
}
repositories {
mavenLocal()
if (System.getenv("MAVEN_USERNAME") != null && System.getenv("MAVEN_PASSWORD") != null) {
maven {
name = "release"
url = uri("https://maven.nova-committee.cn/releases")
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
maven {
name = "snapshot"
url = uri("https://maven.nova-committee.cn/snapshots")
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
}