forked from MehVahdJukaar/WoodGood
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
390 lines (319 loc) · 16.1 KB
/
build.gradle
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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
maven { url = 'https://files.minecraftforge.net/maven' }
maven { url = 'https://repo.spongepowered.org/maven' }
maven { url = 'https://maven.parchmentmc.org' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: "${project.forgegradle_version}", changing: true
classpath "org.spongepowered:mixingradle:${project.mixingradle_version}"
classpath "org.parchmentmc:librarian:${project.librarian_version}"
}
}
plugins {
id "me.modmuss50.mod-publish-plugin" version "0.5.1"
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'org.parchmentmc.librarian.forgegradle'
apply plugin: 'org.spongepowered.mixin'
apply from: 'https://raw.githubusercontent.com/SizableShrimp/Forge-Class-Remapper/main/classremapper.gradle'
mixin {
add sourceSets.main, "${project.mod_id}.refmap.json"
}
archivesBaseName = project.mod_id
version = "${project.minecraft_version}-${project.mod_version}".toString()
group = "${project.maven_group}.${archivesBaseName}".toString()
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '17' // Need this here so eclipse task generates correctly.
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
if(project.parchment_enabled == "true"){
mappings channel: 'parchment', version: "${project.parchment_version}-${project.minecraft_version}"
}else{
mappings channel: 'official', version: "${project.minecraft_version}"
}
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
property 'mixin.env.remapRefMap', 'true'
arg "-mixin.config=${project.mod_id}.mixins.json".toString()
jvmArg '-Xmx7G'
workingDirectory project.file('run')
// Recommendedo logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
}
server {
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
property 'mixin.env.remapRefMap', 'true'
arg "-mixin.config=${project.mod_id}.mixins.json".toString()
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
}
data {
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
args '--mod', "${project.mod_id}", '--all', '--output', file('src/generated/resources/'), '--existing', sourceSets.main.resources.srcDirs[0] //args "--mod", "usefulbackpacks", "--all", "--output", "\"" + file("src/generated/resources").toString() + "\"", "--validate", "--existing", "\"" + sourceSets.main.resources.srcDirs[0] + "\""
}
}
}
// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
attributes([
"Specification-Title": "${projectDir}",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"MixinConfigs": "${project.mod_id}.mixins.json"
])
}
}
// Example configuration to allow publishing using the maven-publish task
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
//publish.dependsOn('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
allowInsecureProtocol = true
}
}
}
dependencies {
minecraft "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}"
implementation fg.deobf("curse.maven:selene-499980:4747959") // v1.17.14 (FINAL VERSION)
// ======================================== DEPENDENCIES ==================================================== \\
compileOnly fg.deobf("curse.maven:flywheel-486392:4341461") // Create
compileOnly fg.deobf("curse.maven:autoreglib-250363:3642382") // Quark
// runtimeOnly fg.deobf("curse.maven:supermartijn642s-config-lib-438332:4629792") // Benched
// runtimeOnly fg.deobf("curse.maven:supermartijn642s-core-lib-454372:4654024") // Benched
compileOnly fg.deobf("curse.maven:ortuslib-616457:3768197")
compileOnly fg.deobf("curse.maven:geckolib-388172:4215249") // Graveyard
compileOnly fg.deobf("curse.maven:blueprint-382216:3991478") // Woodworks
compileOnly fg.deobf("curse.maven:ctm-267602:3933537") // chipped
compileOnly fg.deobf("curse.maven:crimson-nbt-tags-445260:3670163")
compileOnly fg.deobf("curse.maven:curios-309927:4590652")
compileOnly fg.deobf("curse.maven:marg-324494:3723497")
compileOnly fg.deobf("curse.maven:texture-dump-319039:3573998")
compileOnly fg.deobf("curse.maven:valhelsia-core-416935:3886212") // valhelsia-structure
runtimeOnly fg.deobf("curse.maven:cloth-config-348521:4973439") // REI
runtimeOnly fg.deobf("curse.maven:architectury-api-419699:5137931") // REI
// TOOLS
runtimeOnly fg.deobf("curse.maven:configured-457570:4462832")
runtimeOnly fg.deobf("curse.maven:roughly-enough-items-310111:5554160")
runtimeOnly fg.deobf("curse.maven:jade-324717:5079263")
// =============================================== IMPORTS ====================================================== \\
// Macaw's
compileOnly fg.deobf("curse.maven:macaws-bridges-351725:5240511") // v3.0.0
compileOnly fg.deobf("curse.maven:macaws-doors-378646:5439214") // v1.1.1
compileOnly fg.deobf("curse.maven:macaws-fences-and-walls-453925:5442210") // v1.1.2
compileOnly fg.deobf("curse.maven:macaws-lights-and-lamps-502372:4618176") // v1.0.6
compileOnly fg.deobf("curse.maven:macaws-paths-and-pavings-629153:4585113") // v1.0.3
compileOnly fg.deobf("curse.maven:macaws-trapdoors-400933:4841544") // v1.1.2
compileOnly fg.deobf("curse.maven:macaws-windows-363569:4961135") // v2.2.1
compileOnly fg.deobf("curse.maven:macaws-furniture-359540:4726291") // v3.2.0
compileOnly fg.deobf("curse.maven:macaws-roofs-352039:4590024") // v2.2.4
compileOnly fg.deobf("curse.maven:macaws-stairs-1119394:5802524") // v1.0.0
// OTHERS
compileOnly fg.deobf("curse.maven:another-furniture-610492:4034013")
compileOnly fg.deobf("curse.maven:architects-palette-433862:4498424")
compileOnly fg.deobf("curse.maven:backpacked-352835:4480722")
compileOnly fg.deobf("curse.maven:camp-chair-531744:3548494")
compileOnly fg.deobf("curse.maven:create-328085:4625533")
compileOnly fg.deobf("curse.maven:decorative-blocks-362528:3965454")
compileOnly fg.deobf("curse.maven:farmers-delight-398521:4636009")
compileOnly fg.deobf("curse.maven:infinity-buttons-661902:4716908")
compileOnly fg.deobf("curse.maven:missing-wilds-forge-634277:3835403")
compileOnly fg.deobf("curse.maven:mrcrayfish-furniture-mod-55438:4374992")
compileOnly fg.deobf("curse.maven:project-brazier-238326:3836169")
compileOnly fg.deobf("curse.maven:quark-243121:3840125") // AutoRegLib
compileOnly fg.deobf("curse.maven:the-twilight-forest-227639:4337390")
compileOnly fg.deobf("curse.maven:the-graveyard-forge-531188:4555245")
compileOnly fg.deobf("curse.maven:twigs-496913:3968055")
compileOnly fg.deobf("curse.maven:valhelsia-structures-347488:3708292")
compileOnly fg.deobf("curse.maven:workshop-for-handsome-adventurer-875843:4688655")
compileOnly fg.deobf("curse.maven:dramatic-doors-380617:4511658")
compileOnly fg.deobf("curse.maven:corail-pillar-266228:3672409")
compileOnly fg.deobf("curse.maven:corail-woodcutter-331983:4442684")
compileOnly fg.deobf("curse.maven:decoration-delight-687475:4689698")
compileOnly fg.deobf("curse.maven:exlines-bark-carpets-527296:3776832")
compileOnly fg.deobf("curse.maven:mosaic-carpentry-690226:4071275")
compileOnly fg.deobf("curse.maven:ex-nihilo-sequentia-400012:4556977")
compileOnly fg.deobf("curse.maven:premium-wood-353515:3781130")
compileOnly fg.deobf("curse.maven:productivebees-377897:4257307")
compileOnly fg.deobf("curse.maven:woodworks-543610:4396956")
compileOnly fg.deobf("curse.maven:xercamod-341575:4318574")
compileOnly fg.deobf("curse.maven:chipped-456956:4293291")
compileOnly fg.deobf("curse.maven:storage-drawers-223852:5636643")
compileOnly fg.deobf("curse.maven:table-top-craft-467136:5699783")
// LOCAL
compileOnly fg.deobf(getModVersion("ironagefurniture-1.18.2-0.2.0.10.jar"))
compileOnly fg.deobf(getModVersion("marketcrates-1.18.2-1.4.1.jar"))
compileOnly fg.deobf(getModVersion("stylishstiles-1.1.1-1.18.2.jar"))
compileOnly fg.deobf(getModVersion("buildersdelight-1.18.2-1.0.jar"))
compileOnly fg.deobf(getModVersion("shutters-1.18.2-1.0.7.jar"))
compileOnly fg.deobf(getModVersion("absentbydesign-1.18.2-1.6.2.jar"))
//=========================================== TODO: NOT ADDED YET =============================================== \\
// compileOnly fg.deobf("curse.maven:malum-484064:4631612")
// implementation fg.deobf("curse.maven:just-a-raft-mod-274350:3765601")
// implementation fg.deobf("curse.maven:i-like-wood-324164:3726545")
// implementation fg.deobf("curse.maven:floor-mats-413140:3671760")
// ========================================= DISABLED FOR A REASON ============================================== \\
// implementation fg.deobf("curse.maven:benched-417063:4291393") // Uses OBJ Format
// ============================================= FOR TESTING ==================================================== \\
// implementation fg.deobf("curse.maven:terrafirmacraft-302973:4843196")
runtimeOnly fg.deobf("curse.maven:biomes-o-plenty-220318:3759236")
// implementation fg.deobf("curse.maven:ecologics-570463:4171283")
// implementation fg.deobf("curse.maven:blue-skies-312918:3788736")
// implementation fg.deobf("curse.maven:oh-the-biomes-youll-go-247560:4971536")
// implementation fg.deobf("curse.maven:enhanced-mushrooms-383725:3865521")
// DEPENDENCIES
// implementation fg.deobf("curse.maven:patchouli-306770:3846086") // terrafirmacraft
runtimeOnly fg.deobf("curse.maven:terrablender-563928:3957976") // biomesoplenty
// implementation fg.deobf("curse.maven:pollen-544350:4337349") // enhanced-mushrooms
// implementation fg.deobf("curse.maven:structure-gel-api-378802:4804138") // blue-skies
// ================================================ OTHERS ====================================================== \\
compileOnly fg.deobf("com.tterrag.registrate:Registrate:MC1.18.2-1.1.3")
annotationProcessor "org.spongepowered:mixin:${project.mixin_version}:processor"
}
repositories {
maven {
url = "https://www.cursemaven.com"
allowInsecureProtocol = true
}
maven { // Registrate
url "http://maven.tterrag.com/"
allowInsecureProtocol = true
}
}
// Loads files in the format {modid}-{version}.jar, MC version optional but picky about hyphens.
// See the regex pattern.
def getModVersion(filename) {
// println(filename);
def pattern = /^(?<modid>[^-]+)(?:-(?<mcversion>[0-9.]+))?(?:-(?<modver>[0-9.\-]+))\.jar$/
def matcher = filename =~ pattern
def found = matcher.find()
if(found) {
def mod = matcher.group("modid")
// Extract MC version or default
def mcVersion = matcher.group("mcversion")
// Extract mod version
def version = matcher.group("modver")
// println("> mod: ${mod}; mc: ${mcVersion}; version: ${version}");
if(mcVersion == null)
return "${mod}:${mod}:${version}"
else
return "${mod}:${mod}-${mcVersion}:${version}"
} else {
println(" > not a mod filename")
return filename
}
}
def dev_mods_dir = "mods"
def dev_mods = fileTree(dev_mods_dir).filter { it -> it.isFile() }.files.name.collect( { getModVersion(it) } )
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
dependencies{
// Deobfuscate each dev mod for runtime
dev_mods.each {
// compileOnly fg.deobf(it)
// runtimeOnly fg.deobf(it)
}
implementation 'org.jetbrains:annotations:22.0.0'
}
repositories{
// Built mods
flatDir {
dirs dev_mods_dir
}
mavenCentral()
}
publishMods {
dryRun = false
var changelogFile = rootProject.file("changelog.md")
var changelogText = changelogFile.exists() ? changelogFile.text : "blank"
file = jar.archiveFile
changelog = changelogText
type = STABLE
modLoaders.add("forge")
displayName = file.map { it.asFile.name }
curseforge {
projectId = "${project_id}"
accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
minecraftVersions.add("${minecraft_version}")
requires("selene")
optional("another-furniture")
optional("architects-palette")
optional("backpacked")
optional("builders-delight-forge")
optional("camp-chair")
optional("chipped")
optional("corail-pillar")
optional("corail-woodcutter")
optional("create")
optional("decoration-delight")
optional("decorative-blocks")
optional("dramatic-doors")
optional("exlines-bark-carpets")
optional("exnihilosequentia")
optional("farmers-delight")
optional("infinitybuttons")
optional("ironagefurniture")
optional("lauchs-shutters")
optional("macaws-doors")
optional("macaws-fences-and-walls")
optional("macaws-furniture")
optional("macaws-lights-and-lamps")
optional("macaws-paths-and-pavings")
optional("macaws-roofs")
optional("macaws-stairs")
optional("macaws-trapdoors")
optional("macaws-windows")
optional("market-crates")
optional("missing-wilds-forge")
optional("mosaic-carpentry")
optional("mrcrayfish-furniture-mod")
optional("premium-wood")
optional("productivebees")
optional("project-brazier")
optional("quark")
optional("table-top-craft")
optional("the-graveyard-forge")
optional("the-twilight-forest")
optional("twigs")
optional("valhelsia-structures")
optional("woodworks")
optional("workshop-for-handsome-adventurer")
optional("xercamod")
}
modrinth {
projectId = "eiktJyw1"
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
minecraftVersions.add("${minecraft_version}")
requires("moonlight")
}
}