-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
113 lines (91 loc) · 3.31 KB
/
build.gradle.kts
File metadata and controls
113 lines (91 loc) · 3.31 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
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
plugins {
id("dev.isxander.modstitch.base") version "0.8.4"
id("dev.isxander.modstitch.publishing") version "0.8.4"
}
fun prop(name: String, consumer: (prop: String) -> Unit) {
(findProperty(name) as? String?)
?.let(consumer)
}
modstitch {
prop("deps.minecraft") { minecraftVersion = it }
parchment {
prop("parchment.version") { mappingsVersion = it }
prop("parchment.minecraft") { minecraftVersion = it }
}
metadata {
modId = "durability_guard"
modName = "Durability Guard"
modVersion = "2.4.0+${stonecutter.current.project}"
modDescription = "Stops you from mining if your tool has low durability."
modLicense = "CC BY-NC-SA 4.0"
modGroup = "dev.bigbrainrobin29"
modAuthor = "BigBrainRobin29"
replacementProperties.put("mod_modrinth", "https://modrinth.com/mod/durability-guard")
replacementProperties.put("mod_sources", "https://github.com/BigBrainRobin29/DurabilityGuard")
replacementProperties.put("mod_issues", "https://github.com/BigBrainRobin29/DurabilityGuard/issues")
replacementProperties.put("minecraft", property("deps.minecraft.constraint") as String)
}
loom {
fabricLoaderVersion = "0.18.5"
}
moddevgradle {
prop("deps.neoforge") { neoForgeVersion = it }
defaultRuns()
configureNeoForge {
runs.all {
disableIdeRun()
}
}
}
mixin {
addMixinsToModManifest = true
configs.register("durability_guard")
}
}
msPublishing {
mpp {
file = modstitch.finalJarTask.get().archiveFile
displayName = "${modstitch.metadata.modName.get()} ${modstitch.metadata.modVersion.get()}"
type = STABLE
dryRun = providers.gradleProperty("modrinth_token").orNull == null
modrinth {
accessToken = providers.gradleProperty("modrinth_token").orNull
projectId = "mJB9S4Yq"
changelog = rootProject.file("CHANGELOG.md").readText()
projectDescription = rootProject.file("README.md").readText()
minecraftVersionRange {
prop("publish.minecraft_version.min") { start = it }
prop("publish.minecraft_version.max") { end = it }
}
requires("fabric-api", "yacl")
if (modstitch.isLoom) {
optional("modmenu")
}
}
}
}
stonecutter {
var loader: String = name.split("-")[1]
constants.match(
loader,
"fabric",
"neoforge"
)
}
dependencies {
modstitch.loom {
modstitchModImplementation("net.fabricmc.fabric-api:fabric-api:${property("deps.fabric_api")}")
modstitchModCompileOnly("maven.modrinth:mOgUt4GM:${property("deps.modmenu")}")
}
if (stonecutter.eval(stonecutter.current.version, "<=1.20.3")) {
modstitchModImplementation("maven.modrinth:1eAoo2KR:${property("deps.yacl")}")
} else {
modstitchModImplementation("dev.isxander:yet-another-config-lib:${property("deps.yacl")}")
}
}
tasks.register<Copy>("buildAndCollect") {
group = "build"
from(modstitch.finalJarTask.map { it.archiveFile } )
into(rootProject.layout.buildDirectory.dir("collected/${modstitch.metadata.modVersion.get().split("+")[0]}"))
dependsOn("build")
}