-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathsettings.gradle.kts
More file actions
78 lines (68 loc) · 2.93 KB
/
Copy pathsettings.gradle.kts
File metadata and controls
78 lines (68 loc) · 2.93 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
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
pluginManagement {
// allows storing plugin versions in gradle.properties
fun prop(prop: String): String = providers.gradleProperty(prop).get()
fun plugin(prop: String): String = prop("plugin.$prop")
fun mtk(prop: String): String = plugin("mtk.$prop")
plugins {
kotlin("jvm") version plugin("kotlin")
id("com.google.devtools.ksp") version plugin("ksp")
id("dev.kikugie.fletching-table.fabric") version plugin("fletching-table")
id("org.gradle.crypto.checksum") version "1.4.0" // hasn't updated in 4+ years
id("dev.isxander.mtk.manifests") version mtk("manifests")
id("me.modmuss50.mod-publish-plugin") version plugin("mod-publish-plugin")
id("dev.isxander.modstitch.base") version plugin("modstitch")
id("dev.kikugie.stonecutter") version plugin("stonecutter")
id("net.fabricmc.fabric-loom") version prop("fabric.loom") apply false
}
repositories {
gradlePluginPortal()
mavenCentral()
maven("https://maven.fabricmc.net/")
maven("https://maven.neoforged.net/releases/")
maven("https://maven.kikugie.dev/releases")
maven("https://maven.kikugie.dev/snapshots")
maven("https://maven.parchmentmc.org")
maven("https://maven.isxander.dev/releases/")
}
}
plugins {
id("dev.kikugie.stonecutter")
}
stonecutter {
kotlinController = true
centralScript = "build.gradle.kts"
create(rootProject) {
// modstitch compat key:
// /-----------|------|.... // neoforge
// ----|----/ // forge
// 1.20 1.20.1 1.20.2 1.20.3
val loaders = providers.gradleProperty("loaders").get()
val loadList = loaders.replace("neoforge", "neo").split(",")
val targets = providers.gradleProperty("targets").get().split(',').map(String::trim)
targets.forEach {
v: String ->
loadList.forEach {
l: String ->
version("$v-$l", v)
}
}
// sets vcsVersion to the most recent Fabric version **that's not a full release**
// starts at the end (most recent versions) to avoid unnecessary file reads
for(v in targets.reversed()) {
val vFab = "$v-fabric"
val props = rootProject.projectDir.resolve("versions/$vFab/gradle.properties") // i know this is ugly but the vcsVersion warnings pmo
if(props.exists()) {
val content = props.readText()
// the \n ensures it's not present but commented out
if(content.contains("\nmod.nonReleaseComponent=")) {
println("Skipped consideration of $vFab as `vcsVersion` because it's not a full release")
continue
} else {
vcsVersion = vFab
break
}
}
}
}
}
rootProject.name = "Chat Patches"