generated from isXander/FabricKotlinTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
196 lines (165 loc) · 6.16 KB
/
build.gradle.kts
File metadata and controls
196 lines (165 loc) · 6.16 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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
plugins {
id("dev.isxander.modstitch.base") version "0.7.0-unstable"
id("me.modmuss50.mod-publish-plugin") version "0.8.4"
`maven-publish`
id("org.ajoberstar.grgit") version "5.3.2"
}
modstitch {
minecraftVersion = "1.21.8"
modLoaderVersion = "0.16.14"
parchment {
mappingsVersion = "2025.06.29"
minecraftVersion = "1.21.6"
}
metadata {
modVersion = minecraftVersion.map { "$it+1.0" }
modId = "debugify"
modName = "Debugify"
modDescription = "Fixes Minecraft bugs found on the bug tracker"
modCredits = """
j-Tai's TieFix - Code used licensed under LGPLv3
FlashyReese's Sodium Extra - Code used licensed under LGPLv3
Ampflower's 2x2 Surrounded Saplings Fix - Code used licensed under Zlib
NoahvdAa's Thorium - Code used licensed under LGPLv3
Moulberry's MoulberryTweaks - Code used licensed under MIT
""".trimIndent()
}
mixin {
addMixinsToModManifest = true
configs.register("debugify")
configs.register("debugify.client") { side = CLIENT }
}
loom {
configureLoom {
mixin.useLegacyMixinAp = false
splitEnvironmentSourceSets()
val gametest by sourceSets.registering {
compileClasspath += sourceSets.main.get().compileClasspath
runtimeClasspath += sourceSets.main.get().runtimeClasspath
compileClasspath += sourceSets["client"].compileClasspath
runtimeClasspath += sourceSets["client"].runtimeClasspath
}
//createProxyConfigurations(sourceSets["client"])
createProxyConfigurations(gametest.get())
mods.register("debugify") {
sourceSet(sourceSets["main"])
sourceSet(sourceSets["client"])
}
runs {
register("gametest") {
client()
ideConfigGenerated(true)
name("Game Test")
source(gametest.get())
}
listOf(named("client"), named("server")).forEach {
it {
vmArg("-Ddebugify.forceMacFixes=true")
vmArg("-Ddebugify.forceLinuxFixes=true")
vmArg("-Ddebugify.forceWindowsFixes=true")
}
}
}
}
}
}
repositories {
exclusiveContent {
forRepository { maven("https://maven.terraformersmc.com/releases") }
filter { includeGroup("com.terraformersmc") }
}
exclusiveContent {
forRepository { maven("https://maven.isxander.dev/releases") }
filter {
includeGroup("dev.isxander")
includeGroup("org.quiltmc.parsers")
}
}
}
val fabricApiVersion: String by project
val yaclVersion: String by project
val mixinExtrasVersion: String by project
val modMenuVersion: String by project
dependencies {
modImplementation(fabricApi.module("fabric-resource-loader-v0", fabricApiVersion))
modImplementation("net.fabricmc.fabric-api:fabric-api:$fabricApiVersion")
"io.github.llamalad7:mixinextras-fabric:$mixinExtrasVersion".let {
include(it)
implementation(it)
/*annotationProcessor(it)*/// only needed if `useLegacyMixinAp = true`
}
"modClientImplementation"("dev.isxander:yet-another-config-lib:$yaclVersion")
"modClientImplementation"("com.terraformersmc:modmenu:$modMenuVersion")
"gametestImplementation"(sourceSets.main.get().output)
"gametestImplementation"(sourceSets["client"].output)
"modGametestImplementation"(fabricApi.module("fabric-gametest-api-v1", fabricApiVersion))
}
java {
withSourcesJar()
}
publishMods {
displayName.set("Debugify ${project.version}")
file.set(tasks.remapJar.get().archiveFile)
changelog.set(modstitch.minecraftVersion.zip(modstitch.metadata.modVersion) { mcVersion, modVersion ->
val header = file("changelogs/header.md")
.takeIf { it.exists() }
?.readText()
file("changelogs/$mcVersion/$modVersion.md")
.takeIf { it.exists() }
?.readText()
?.let { if (header != null) "$header\n\n$it" else it }
})
type.set(STABLE)
modLoaders.add("fabric")
val modrinthId: String by project
if (modrinthId.isNotBlank() && hasProperty("modrinth.token")) {
modrinth {
projectId.set(modrinthId)
accessToken.set(findProperty("modrinth.token")?.toString())
minecraftVersions.add(modstitch.minecraftVersion)
requires { slug.set("yacl") }
requires { slug.set("fabric-api") }
optional { slug.set("modmenu") }
}
}
val curseforgeId: String by project
if (curseforgeId.isNotBlank() && hasProperty("curseforge.token")) {
curseforge {
projectId.set(curseforgeId)
accessToken.set(findProperty("curseforge.token")?.toString())
minecraftVersions.add(modstitch.minecraftVersion)
requires { slug.set("yacl") }
requires { slug.set("fabric-api") }
optional { slug.set("modmenu") }
}
}
val githubProject: String by project
if (githubProject.isNotBlank() && hasProperty("github.token")) {
github {
repository.set(githubProject)
accessToken.set(findProperty("github.token")?.toString())
commitish.set(grgit.branch.current().name)
}
}
}
publishing {
publications {
create<MavenPublication>("debugify") {
groupId = "dev.isxander"
artifactId = "debugify"
from(components["java"])
}
}
repositories {
if (hasProperty("XANDER_MAVEN_USER") && hasProperty("XANDER_MAVEN_PASS")) {
maven(url = "https://maven.isxander.dev/releases") {
credentials {
username = property("XANDER_MAVEN_USER")?.toString()
password = property("XANDER_MAVEN_PASS")?.toString()
}
}
} else {
println("Xander Maven credentials not satisfied")
}
}
}