-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstonecutter.gradle.kts
36 lines (33 loc) · 1.3 KB
/
stonecutter.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
plugins {
id("dev.kikugie.stonecutter")
id("dev.architectury.loom") version "1.7-SNAPSHOT" apply false
id("architectury-plugin") version "3.4-SNAPSHOT" apply false
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
}
stonecutter active "1.21.4" /* [SC] DO NOT EDIT */
stonecutter.automaticPlatformConstants = true
// Builds every version into `build/libs/{mod.version}/{loader}`
stonecutter registerChiseled tasks.register("chiseledBuild", stonecutter.chiseled) {
group = "project"
ofTask("buildAndCollect")
}
// Builds loader-specific versions into `build/libs/{mod.version}/{loader}`
for (it in stonecutter.tree.branches) {
if (it.id.isEmpty()) continue
val loader = it.id.upperCaseFirst()
stonecutter registerChiseled tasks.register("chiseledBuild$loader", stonecutter.chiseled) {
group = "project"
versions { branch, _ -> branch == it.id }
ofTask("buildAndCollect")
}
}
// Runs active versions for each loader
for (it in stonecutter.tree.nodes) {
if (it.metadata != stonecutter.current || it.branch.id.isEmpty()) continue
val types = listOf("Client", "Server")
val loader = it.branch.id.upperCaseFirst()
for (type in types) it.tasks.register("runActive$type$loader") {
group = "project"
dependsOn("run$type")
}
}