-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstonecutter.gradle.kts
More file actions
44 lines (39 loc) · 1.54 KB
/
stonecutter.gradle.kts
File metadata and controls
44 lines (39 loc) · 1.54 KB
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
plugins {
alias(libs.plugins.stonecutter)
alias(libs.plugins.dotenv)
alias(libs.plugins.fabric.loom).apply(false)
alias(libs.plugins.neoforged.moddev).apply(false)
alias(libs.plugins.jsonlang.postprocess).apply(false)
alias(libs.plugins.mod.publish.plugin).apply(false)
alias(libs.plugins.kotlin.jvm).apply(false)
alias(libs.plugins.devtools.ksp).apply(false)
alias(libs.plugins.fletching.table).apply(false)
alias(libs.plugins.legacyforge.moddev).apply(false)
}
stonecutter active file(".sc_active_version")
for (version in stonecutter.versions.map { it.version }.distinct()) tasks.register("publish$version") {
group = "publishing"
dependsOn(stonecutter.tasks.named("publishMods") { metadata.version == version })
}
stonecutter tasks {
val ordering = versionComparator.thenComparingInt { task ->
if (task.metadata.project.endsWith("fabric")) 1 else 0
}
listOf("publishModrinth", "publishCurseforge").forEach { taskName ->
gradle.allprojects {
if (project.tasks.findByName(taskName) != null) {
order(taskName, ordering)
}
}
}
}
stonecutter parameters {
constants.match(node.metadata.project.substringAfterLast('-'), "fabric", "neoforge", "forge")
filters.include("**/*.fsh", "**/*.vsh")
swaps["mod_version"] = "\"" + property("mod.version") + "\";"
swaps["mod_id"] = "\"" + property("mod.id") + "\";"
swaps["mod_name"] = "\"" + property("mod.name") + "\";"
swaps["mod_group"] = "\"" + property("mod.group") + "\";"
swaps["minecraft"] = "\"" + node.metadata.version + "\";"
constants["release"] = property("mod.id") != "modtemplate"
}