-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
build.gradle.kts
315 lines (272 loc) · 9.07 KB
/
build.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
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
import java.text.SimpleDateFormat
import java.util.*
plugins {
id("eclipse")
id("idea")
id("maven-publish")
id("net.minecraftforge.gradle").version("[6.0,6.2)")
id("org.parchmentmc.librarian.forgegradle").version("1.+")
id("org.spongepowered.mixin")
}
val minecraftVersion: String by extra
val minecraftVersionRange: String by extra
val loaderVersionRange: String by extra
val forgeVersionRange: String by extra
val modVersion: String by extra
val modGroupId: String by extra
val modId: String by extra
val modAuthors: String by extra
val modDescription: String by extra
val modLicense: String by extra
val modName: String by extra
val parchmentChannel: String by extra
val parchmentVersion: String by extra
val forgeVersion: String by extra
val jeiVersion: String by extra
val curiosVersion: String by extra
val mixinVersion: String by extra
val modJavaVersion: String by extra
val lodestoneVersion: String by extra
val fusionVersion: String by extra
var caelusVersion: String by extra
val geckoLibVersion: String by extra
val playerAnimatorVersion: String by extra
val ironsSpellsVersion: String by extra
jarJar.enable()
version = "$minecraftVersion-$modVersion"
if (System.getenv("BUILD_NUMBER") != null) {
version = "$minecraftVersion-$modVersion.${System.getenv("BUILD_NUMBER")}"
}
group = modGroupId
val baseArchivesName = modId
base {
archivesName.set(baseArchivesName)
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(modJavaVersion))
}
}
mixin {
add(sourceSets.main.get(), "${modId}.refmap.json")
config("malum.mixins.json")
}
minecraft {
mappings(parchmentChannel, parchmentVersion)
accessTransformer(file("src/main/resources/META-INF/accesstransformer.cfg"))
copyIdeResources.set(true)
runs {
configureEach {
workingDirectory(project.file("run"))
property("forge.logging.markers", "REGISTRIES")
property("forge.logging.console.level", "debug")
mods {
create("${modId}") {
source(sourceSets.main.get())
}
}
}
create("client") {
property("forge.enabledGameTestNamespaces", modId)
arg("-mixin.config=" + modId + ".mixins.json")
}
create("server") {
property("forge.enabledGameTestNamespaces", modId)
args("--nogui")
arg("-mixin.config=" + modId + ".mixins.json")
}
create("data") {
workingDirectory(project.file("run-data"))
args(
"--mod",
modId,
"--all",
"--output",
file("src/generated/resources/"),
"--existing",
file("src/main/resources/")
)
}
}
}
sourceSets {
main {
resources.srcDir("src/generated/resources")
}
}
repositories {
flatDir {
dirs("lib")
}
mavenCentral()
maven {
name = "Curios maven"
url = uri("https://maven.theillusivec4.top/")
}
maven {
name = "JEI maven"
url = uri("https://dvs1.progwml6.com/files/maven")
}
maven {
name = "tterrag maven"
url = uri("https://maven.tterrag.com/")
}
maven {
name = "BlameJared maven"
url = uri("https://maven.blamejared.com/")
}
maven {
name = "Curse Maven"
url = uri("https://cursemaven.com")
content {
includeGroup("curse.maven")
}
}
maven {
name = "jitpack"
url = uri("https://jitpack.io")
content {
includeGroup("io.github")
}
}
//Iron's Spellbooks requirements
maven {
name = "Iron's Maven - Release"
url = uri("https://code.redspace.io/releases")
}
maven {
url = uri("https://maven.kosmx.dev/")
}
maven {
url = uri("https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/")
}
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = uri("https://api.modrinth.com/maven")
}
}
forRepositories(fg.repository) // Only add this if you're using ForgeGradle, otherwise remove this line
filter {
includeGroup("maven.modrinth")
}
}
}
dependencies {
minecraft("net.minecraftforge:forge:${minecraftVersion}-${forgeVersion}")
if (System.getProperty("idea.sync.active") != "true") {
annotationProcessor("org.spongepowered:mixin:${mixinVersion}:processor")
}
// MixinExtras
compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.3.2")!!)
implementation(jarJar("io.github.llamalad7:mixinextras-forge:0.3.2")!!) {
jarJar.ranged(this, "[0.3.2,)")
}
// JEI Dependency
compileOnly(fg.deobf("mezz.jei:jei-${minecraftVersion}-forge-api:${jeiVersion}"))
compileOnly(fg.deobf("mezz.jei:jei-${minecraftVersion}-common-api:${jeiVersion}"))
runtimeOnly(fg.deobf("mezz.jei:jei-${minecraftVersion}-forge:${jeiVersion}"))
// Curios dependency
compileOnly(fg.deobf("top.theillusivec4.curios:curios-forge:${curiosVersion}:api"))
runtimeOnly(fg.deobf("top.theillusivec4.curios:curios-forge:${curiosVersion}"))
implementation(fg.deobf("team.lodestar.lodestone:lodestone:${minecraftVersion}-${lodestoneVersion}"))
//FD Optional Dependency
compileOnly(fg.deobf("curse.maven:farmers_delight-398521:4638874"))
//Tetra Optional Dependency
compileOnly(fg.deobf("curse.maven:mutil-351914:4824501"))
compileOnly(fg.deobf("curse.maven:tetra-289712:5544287"))
//Iron's Spellbooks Optional Dependency
compileOnly(fg.deobf("top.theillusivec4.caelus:caelus-forge:${caelusVersion}:api"))
// runtimeOnly(fg.deobf("top.theillusivec4.caelus:caelus-forge:${caelusVersion}"))
compileOnly(fg.deobf("software.bernie.geckolib:geckolib-forge-${geckoLibVersion}"))
compileOnly(fg.deobf("dev.kosmx.player-anim:player-animation-lib-forge:${playerAnimatorVersion}"))
// compileOnly(fg.deobf("io.redspace.ironsspellbooks:irons_spellbooks:${ironsSpellsVersion}:api"))
compileOnly(fg.deobf("io.redspace.ironsspellbooks:irons_spellbooks:${ironsSpellsVersion}"))
//Apothic Attributes
compileOnly(fg.deobf("curse.maven:placebo-283644:5414631"))
compileOnly(fg.deobf("curse.maven:apothic-attributes-898963:5634071"))
//Misc
runtimeOnly(fg.deobf("curse.maven:spark-361579:4587309"))
runtimeOnly(fg.deobf("curse.maven:attributefix-280510:4911084"))
runtimeOnly(fg.deobf("curse.maven:overloaded-armor-bar-314002:4631133"))
runtimeOnly(fg.deobf("maven.modrinth:fusion-connected-textures:${fusionVersion}-forge-mc${minecraftVersion}"))
}
tasks.withType<ProcessResources> {
inputs.property("version", version)
filesMatching(listOf("META-INF/mods.toml", "pack.mcmeta")) {
expand(
mapOf(
"forgeVersionRange" to forgeVersionRange,
"loaderVersionRange" to loaderVersionRange,
"minecraftVersion" to minecraftVersion,
"minecraftVersionRange" to minecraftVersionRange,
"modAuthors" to modAuthors,
"modDescription" to modDescription,
"modId" to modId,
"modJavaVersion" to modJavaVersion,
"modName" to modName,
"modVersion" to version,
"modLicense" to modLicense,
)
)
}
}
java {
withJavadocJar()
withSourcesJar()
}
tasks.withType<Jar> {
val now = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(Date())
manifest {
attributes(
mapOf(
"Specification-Title" to modName,
"Specification-Vendor" to modAuthors,
"Specification-Version" to '1',
"Implementation-Title" to modName,
"Implementation-Version" to version,
"Implementation-Vendor" to modAuthors,
"Implementation-Timestamp" to now,
)
)
}
finalizedBy("reobfJar")
finalizedBy("reobfJarJar")
}
tasks.jar.configure {
archiveClassifier.set("pure")
}
tasks.jarJar.configure {
archiveClassifier.set("")
}
//jar {
//// exclude 'com/sammy/malum/core/data/**'
// exclude 'com/sammy/malum/client/model/bbmodels/**'
// exclude 'assets/malum/models/block/bbmodels/**'
//}
publishing {
publications {
register<MavenPublication>("mavenJava") {
artifactId = baseArchivesName
from(components["java"])
fg.component(this)
jarJar.component(this)
}
}
repositories {
maven {
url = uri("file://${System.getenv("local_maven")}")
}
}
}
idea {
module {
for (fileName in listOf("run", "out", "logs")) {
excludeDirs.add(file(fileName))
}
}
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}