-
Notifications
You must be signed in to change notification settings - Fork 54
/
build.gradle
604 lines (562 loc) · 22.3 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
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
buildscript {
repositories {
mavenCentral()
//maven {
// name = "forge"
// url = "https://files.minecraftforge.net/maven"
//}
maven {
name = "gt"
url = "https://gregtech.mechaenetia.com/"
}
maven {
name = "gtnh"
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.11'
//classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
//classpath 'net.onedaybeard.artemis:artemis-odb-gradle-plugin:2.2.0'
//classpath 'net.onedaybeard.artemis:artemis-fluid-gradle-plugin:2.2.0'
}
}
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
}
}
apply plugin: 'eclipse'
eclipse {
classpath {
downloadJavadoc = true
downloadSources = true
}
}
def eclipseRuntimeClasspath = ""
def eclipseRuntimeClasspathTemplate = "<listEntry value=\"<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry externalArchive="@@PATH@@" path="3" type="2"/> \"/>\n"
task eclipseForgeWorkspace(type: Copy) {
doFirst {
sourceSets.main.runtimeClasspath.collect {
eclipseRuntimeClasspath += eclipseRuntimeClasspathTemplate.replaceAll('@@PATH@@', it.toString())
""
}
}
from(".meta/eclipse/.metadata") {
include '**/*.template'
rename { it.replace '.template', '' }
filter { it.replaceAll('@@eclipseRuntimeClasspath@@', eclipseRuntimeClasspath) }
//rename '(.*).template', '$1'
}
from(".meta/eclipse/.metadata") {
exclude '**/*.launch'
}
into "eclipse/.metadata"
}
import org.apache.tools.ant.taskdefs.condition.Os
task eclipseForgeProject {
doLast {
if(!(new File("eclipse/Minecraft")).exists()) {
if(!Os.isFamily(Os.FAMILY_WINDOWS)) {
ant.symlink(resource: "../", link: "eclipse/Minecraft")
} else {
println("WINDOWS: Before loading this workspace with Eclipse, manually run this in an Elevated/Admin command prompt:")
println("mklink /D " + (new File("").absolutePath) + "/eclipse/Minecraft " + (new File("").absolutePath))
}
}
}
}
eclipseForgeProject.dependsOn(eclipseForgeWorkspace)
tasks.eclipse.dependsOn(eclipseForgeProject)
apply plugin: 'idea'
idea{
module {
downloadJavadoc = true
downloadSources = true
}
}
repositories {
maven {
name = "gt"
url = "https://gregtech.mechaenetia.com/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
//maven {
// name = "forge"
// url = "https://files.minecraftforge.net/maven"
//}
//// No official maven'y storage for:
//// - Baubles
//// - MicdoodleCore
//// - GalacticraftCore
//// - Galacticraft-Planets
//// - Thaumcraft
//// - EnviroMine
//// - Botania
//// - Railcraft
//// - twilightforest
//// - appliedenergistics2
//// - CoFHLib
//// - ComputerCraft
//// - RTG
//// - OpenBlocks
//// - IC2Classic
//// Main storage for forestry_1.7.10
//maven {
// name = "ic2"
// url = "http://maven.ic2.player.to/"
//}
//// Main storage for waila, jabba
//maven {
// name = "profmobius"
// url = "http://default.mobiusstrip.eu/maven"
//}
//// Main storage for buildcraft
//ivy {
// name "BuildCraft"
// artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision](-[classifier]).[ext]"
//}
//// Main storage for CodeChickenCore, NotEnoughItems
//// CodeChickenLib is in the Forge maven
//maven {
// name = "chickenbones"
// url = "http://chickenbones.net/maven/"
//}
//// Main storage for AppleCore
//maven {
// name = "Apple"
// url "http://www.ryanliptak.com/maven/"
//}
//// Main storage for OpenComputers
//maven {
// name = "OC repo"
// url = "http://maven.cil.li/"
//}
}
apply plugin: 'forge'
//apply plugin: 'artemis'
//apply plugin: 'artemis-fluid'
group = "com.gregoriust.gregtech"
archivesBaseName = "gregtech_1.7.10"
version = "<UNKNOWN>"
if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current())
}
compileJava {
options.encoding = "UTF-8"
}
configurations {
shade
compile.extendsFrom shade
}
minecraft {
version = "1.7.10-10.13.4.1614-1.7.10"
runDir = "instance"
// This is how you rename a namespace
//srgExtra "PK: com/artemis gregtech/thirdparty/com/artemis"
//srgExtra "PK: net/mostlyoriginal gregtech/thirdparty/net/mostlyoriginal"
//srgExtra "PK: net/fbridault/eeel gregtech/thirdparty/net/fbridault/eeel"
}
dependencies {
//compile fileTree(dir: 'libs', include: '*.jar')
//shade 'net.onedaybeard.artemis:artemis-odb:2.2.0'
//shade 'net.mostlyoriginal.artemis-odb:contrib-core:2.3.0'
//shade 'net.mostlyoriginal.artemis-odb:contrib-eventbus:2.3.0'
//shade 'net.fbridault.eeel:artemis-odb-eeel:1.2'
runtime 'org.apache.commons:commons-math3:3.2' // Needed for dev opis because it doesn't know how to specify dependencies properly
runtime 'org.jfree:jcommon:1.0.21' // Needed for dev opis because it doesn't know how to specify dependencies properly
runtime 'org.jfree:jfreechart:1.0.17' // Needed for dev opis because it doesn't know how to specify dependencies properly
runtime 'com.miglayout:miglayout-swing:4.2' // Needed for dev opis because it doesn't know how to specify dependencies properly
runtime 'net.sf.opencsv:opencsv:2.3' // Needed for dev opis because it doesn't know how to specify dependencies properly
runtime "io.netty-opis:Netty-opis:4.0.23" // Needed for dev opis because it doesn't know how to specify dependencies properly
runtime "mcp.mobius.opis:Opis:1.2.5_1.7.10:dev"
compile "mcp.mobius.waila:Waila:1.5.11-RC2-NONEI_1.7.10:dev"
compile "codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev"
compile "codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev"
compile "codechicken:ForgeMultipart:1.7.10-1.2.0.347:dev"
compile "codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev"
compileOnly "inventorytweaks:InventoryTweaks:1.59-dev:deobf"
compileOnly "net.electricalage.eln:ElectricalAge-jrddunbr:1.16.3:dev"
compileOnly "net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev"
compileOnly "com.mod-buildcraft:buildcraft:7.1.23:dev"
compileOnly "com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf"
compileOnly "cr0s.warpdrive:WarpDrive-1.7.10:1.4.2.1:dev"
compileOnly "micdoodle8.mods:MicdoodleCore:1.7-3.0.12.504:Dev"
compileOnly "micdoodle8.mods:GalacticraftCore:1.7-3.0.12.504:Dev"
compileOnly "micdoodle8.mods:Galacticraft-Planets:1.7-3.0.12.504:Dev"
compileOnly "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev"
compileOnly "enviromine:EnviroMine:1.3.124:deobf"
compileOnly "vazkii.botania:Botania:r1.8-250:deobf"
compileOnly "mods.railcraft:Railcraft_1.7.10:9.12.3.0:dev"
compileOnly "twilightforest:twilightforest:1.7.10-2.3.8dev:dev"
compileOnly "appeng:appliedenergistics2:rv3-beta-6:dev"
compileOnly "cofh:CoFHCore:1.7.10R3.0.4:dev"
compileOnly "cofh:CoFHLib:1.7.10R3.0.3:dev"
compileOnly "applecore:AppleCore:1.7.10-3.1.1:deobf"
compileOnly "iguanaman:HungerOverhaul:1.7.10-1.0.0-basic:deobf"
compileOnly "li.cil.oc:OpenComputers:MC1.7.10-1.7.2.1204:dev"
compileOnly "mekanism:MekanismAll:1.7.10-9.1.1.283:dev"
// This ComputerCraft thing is *SUCH* a hack, but ComputerCraft is... not right... This only works because of CodeChickenCore Magic being included up above...
compileOnly "dan200.computercraft:ComputerCraft:1.75"
compileOnly "openblocks:OpenBlocks:1.7.10-1.6-1.7.10:deobf"
compileOnly "openmods:OpenModsLib:1.7.10-0.10:deobf"
compileOnly "pneumaticCraft:PneumaticCraft:1.7.10-1.12.7-153:userdev"
compileOnly "powercrystals:MineFactoryReloaded:[1.7.10]2.8.2B1-201:dev"
compileOnly "ic2:IC2Classic:1.2.1.8:dev"
compileOnly "com.builtbroken:AddictedToRed:1.7.10-0.4.0b145:deobf"
compileOnly "com.builtbroken:Assembly-Line:1.7.10-0.5.7b180:deobf-dev"
compileOnly "com.builtbroken:BasicIndustry:1.7.10-0.1.0b162:deobf"
compileOnly "com.builtbroken:ComeCloser:1.7.10-0.7.0b10:deobf"
compileOnly "com.builtbroken:ICBM-classic:1.7.10-2.16.4b239:deobf"
compileOnly "com.builtbroken:Mffs:1.7.10-4.0.0b160:deobf"
compileOnly "com.builtbroken:MilitaryBaseDecor:1.7.10-0.1.0b203:deobf"
compileOnly "com.builtbroken:VoltzEngine:1.7.10-1.11.0b466:deobf"
compileOnly "com.hbm:hbm:1.0.27:dev"
compileOnly "com.celestek.hexcraft:HEXCraft:1.7.10-0.13.1:dev"
compileOnly "team.chisel.ctmlib:CTMLib:MC1.7.10-1.4.1.5:deobf"
compileOnly "team.chisel:Chisel:2.9.5.12:deobf"
compileOnly "ganymedes01.etfuturum:Et_Futurum_Requiem:2.5.0:dev"
compileOnly "blusunrize:ImmersiveEngineering:0.7.7:deobf"
compileOnly "com.rwtema.funkylocomotion:funky-locomotion-1.7.10:beta-7:deobf"
// List of potentially useful mods that may or may not be linked in here:
//compileOnly "appeng:appliedenergistics2:rv3-beta-6:dev"
//compileOnly "applecore:AppleCore:1.7.10-3.1.1:deobf"
//compileOnly "binnie:binnie-mods:1.7.10-2.0.22:dev"
//compileOnly "blusunrize:AquaTweaks-1.7.10:1.0:deobf"
//compileOnly "blusunrize:ImmersiveEngineering:0.7.7:deobf"
//compileOnly "climateControl:ClimateControl:0.6.61" // Hack
//compileOnly "climateControl:ClimateControl:0.8.2" // Hack
//compileOnly "climateControl:climateControl:0.6.beta59:dev" // Does nothing but compiles successfully
//compileOnly "codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev"
//compileOnly "codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev"
//compileOnly "codechicken:ForgeMultipart:1.7.10-1.2.0.347:dev"
//compileOnly "codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev"
//compileOnly "cofh:CoFHCore:1.7.10R3.0.4:dev"
//compileOnly "cofh:CoFHLib:1.7.10R3.0.3:dev"
//compileOnly "coloredlightscore:ColoredLightsCore:1.3.7.d524c02:deobf"
//compileOnly "com.InfinityRaider.AgriCraft:AgriCraft:1.7.10-1.5.0:dev"
//compileOnly "com.amadornes.framez:Framez:1.7.10-0.2-33:deobf"
//compileOnly "com.amadornes.jtraits:JTraits:0.1"
//compileOnly "com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf"
//compileOnly "com.bioxx.tfc:TerraFirmaCraft_1.7.10:0.79.28.908:deobf"
//compileOnly "com.bluepowermod:BluePower:1.7.10-0.2.963:deobf"
//compileOnly "com.builtbroken:AddictedToRed:1.7.10-0.4.0b145:deobf"
//compileOnly "com.builtbroken:Assembly-Line:1.7.10-0.5.7b180:deobf-dev"
//compileOnly "com.builtbroken:BasicIndustry:1.7.10-0.1.0b162:deobf"
//compileOnly "com.builtbroken:ComeCloser:1.7.10-0.7.0b10:deobf"
//compileOnly "com.builtbroken:ICBM:1.7.10-2.15.5b514:deobf-dev"
//compileOnly "com.builtbroken:ICBM-classic:1.7.10-2.16.4b239:deobf"
//compileOnly "com.builtbroken:Mffs:1.7.10-4.0.0b160:deobf"
//compileOnly "com.builtbroken:MilitaryBaseDecor:1.7.10-0.1.0b203:deobf"
//compileOnly "com.builtbroken:VoltzEngine:1.7.10-1.11.0b466:deobf"
//compileOnly "com.carpentersblocks:CarpentersBlocks:3.3.8.2:dev"
//compileOnly "com.celestek.hexcraft:HEXCraft:1.7.10-0.13.2:dev"
//compileOnly "com.chocolate.chocolateQuest:chocolateQuest:1.7.10-1.1d" // Hack
//compileOnly "com.creativemd:craftingmanager:0.7.6:dev"
//compileOnly "com.creativemd:creativecore:1.3.24:dev"
//compileOnly "com.enderio:EnderIO/1.7.10-2.3.0.430_beta:dev"
//compileOnly "com.github.glitchfiend.biomesoplenty:BiomesOPlenty:1.7.10-2.1.0.1465:deobf"
//compileOnly "com.gregoriust.gregtech:gregtech_1.7.10:6.09.00:dev"
//compileOnly "com.hbm:hbm:1.0.27:dev"
//compileOnly "com.mod-buildcraft:buildcraft:7.1.23:dev"
//compileOnly "com.pahimar.ee3:EquivalentExchange3:1.7.10-0.3.0.0:dev"
//compileOnly "com.rwtema.funkylocomotion:funky-locomotion-1.7.10:beta-7:deobf"
//compileOnly "com.shedar.IC2NuclearControl:IC2NuclearControl:2.4.3a:dev"
//compileOnly "com.wayoftime.bloodmagic:BloodMagic:1.7.10-1.3.3-18:deobf"
//compileOnly "com.xcompwiz:mystcraft:1.7.10-0.12.3.04:dev"
//compileOnly "cr0s.warpdrive:WarpDrive-1.7.10:1.4.2.1:dev"
//compileOnly "dan200.computercraft:ComputerCraft:1.75" // Hack
//compileOnly "delvr.streams:Streams:1.7.10-0.3.4:deobf"
//compileOnly "enviromine:EnviroMine:1.3.124:deobf"
//compileOnly "ganymedes01.etfuturum:Et_Futurum_Requiem:2.5.0:dev"
//compileOnly "extracells:ExtraCells:1.7.10-2.3.14b200:deobf"
//compileOnly "ic2:IC2Classic:1.2.1.8:dev"
//compileOnly "iguanaman:HungerOverhaul:1.7.10-1.0.0-basic:deobf"
//compileOnly "io.netty-opis:Netty-opis:4.0.23" // Needed for dev opis because it doesn't know how to specify dependencies properly
//compileOnly "inventorytweaks:InventoryTweaks:1.59-dev:deobf"
//compileOnly "java.moze_intel:ProjectE:1.7.10-PE1.10.1:dev"
//compileOnly "k4unl:HydCraft:1.7.10-2.1.253:deobf"
//compileOnly "k4unl:k4lib:1.7.10-0.1.55:deobf"
//compileOnly "li.cil.oc:OpenComputers:MC1.7.10-1.7.2.1204:dev"
//compileOnly "mcp.mobius.opis:Opis:1.2.5_1.7.10:dev"
//compileOnly "mcp.mobius.waila:Waila:1.5.10_1.7.10:dev"
//compileOnly "mcp.mobius.waila:Waila:1.5.11-RC2-NONEI_1.7.10:dev"
//compileOnly "mekanism:MekanismAll:1.7.10-9.1.1.283:dev"
//compileOnly "micdoodle8.mods:Galacticraft-Planets:1.7-3.0.12.504:Dev"
//compileOnly "micdoodle8.mods:GalacticraftCore:1.7-3.0.12.504:Dev"
//compileOnly "micdoodle8.mods:MicdoodleCore:1.7-3.0.12.504:Dev"
//compileOnly "minechem:Minechem:1.7.10-6.0.407:dev"
//compileOnly "minetweaker:MineTweaker3:1.7.10-3.0.10:dev-full"
//compileOnly "mods.railcraft:Railcraft_1.7.10:9.12.3.0:dev"
//compileOnly "mrtjp:ForgeRelocation:0.0.1.4:dev"
//compileOnly "mrtjp:MrTJPCore:1.1.0.34:dev"
//compileOnly "mrtjp:ProjectRed:1.7.10-4.7.0pre11.52:dev"
//compileOnly "net.bdew:bdlib:1.9.4.110-mc1.7.10:dev"
//compileOnly "net.bdew:gendustry:1.6.4-133-mc1.7.10:dev"
//compileOnly "net.electricalage.eln:ElectricalAge-jrddunbr:1.16.3:dev"
//compileOnly "net.machinemuse:ModularPowersuits:1.7.10-0.11.1.114" // Hack
//compileOnly "net.machinemuse:Numina:0.4.1.105" // Hack
//compileOnly "net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev"
//compileOnly "openblocks:OpenBlocks:1.7.10-1.6-1.7.10:deobf"
//compileOnly "openmods.codecs:NotEnoughCodecs:1.7.10-0.6:deobf"
//compileOnly "openmods:OpenModsLib:1.7.10-0.10:deobf"
//compileOnly "pneumaticCraft:PneumaticCraft:1.7.10-1.12.7-153:userdev"
//compileOnly "powercrystals:MineFactoryReloaded:[1.7.10]2.8.2B1-201:dev"
//compileOnly "qmunity:QmunityLib:0.2.118:deobf"
//compileOnly "santa:hairy-spice:0.1:dev"
//compileOnly "train:Traincraft:5.0.2:dev"
//compileOnly "team.chisel.ctmlib:CTMLib:MC1.7.10-1.4.1.5:deobf"
//compileOnly "team.chisel:Chisel:2.9.5.12:deobf"
//compileOnly "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev"
//compileOnly "thaumicenergistics:thaumicenergistics:1.1.3.0:dev"
//compileOnly "thermalexpansion:ThermalExpansion:1.7.10R4.0.3:dev"
//compileOnly "thermalfoundation:ThermalFoundation:1.7.10R1.2.0:dev"
//compileOnly "ttftcuts.atg:ATG:1.7.10-0.12.0:DEV"
//compileOnly "tuhljin:automagy:0.28.2:api"
//compileOnly "twilightforest:twilightforest:1.7.10-2.3.8dev:dev"
//compileOnly "vazkii.botania:Botania:r1.8-250:deobf"
//compileOnly 'com.miglayout:miglayout-swing:4.2' // Needed for dev opis because it doesn't know how to specify dependencies properly
//compileOnly 'net.sf.opencsv:opencsv:2.3' // Needed for dev opis because it doesn't know how to specify dependencies properly
//compileOnly 'org.apache.commons:commons-math3:3.2' // Needed for dev opis because it doesn't know how to specify dependencies properly
//compileOnly 'org.jfree:jcommon:1.0.21' // Needed for dev opis because it doesn't know how to specify dependencies properly
//compileOnly 'org.jfree:jfreechart:1.0.17' // Needed for dev opis because it doesn't know how to specify dependencies properly
//compileOnly "zmaster587.advancedRocketry:AdvancedRocketry:1.7.10-1.4.0-21:deobf"
}
runClient {
jvmArgs "-Xmx4096m", "-Xms1024m"
if (project.hasProperty("appArgs")) {
args Eval.me(appArgs)
}
}
runServer {
jvmArgs "-Xmx4096m", "-Xms1024m"
if (project.hasProperty("appArgs")) {
args Eval.me(appArgs)
}
}
task buildInfo {
def matcher = "v6.[0-9]*"
def cmdTag = "git describe --match ${matcher} --abbrev=0 --exact-match --dirty"
def procTag = cmdTag.execute()
procTag.waitFor()
if (procTag.exitValue() == 0) {
ext.isRelease = true
ext.tag = "${procTag.text.trim().substring(1)}" // Full Release
ext.version = ext.tag
} else {
ext.isRelease = false
def cmdLat = "git describe --match ${matcher} --dirty"
def procLat = cmdLat.execute()
procLat.waitFor()
if (procLat.exitValue() == 0) {
ext.tag = procLat.text.trim().substring(1)
} else {
def cmdDes = "git describe --dirty"
def procDes = cmdDes.execute()
procDes.waitFor()
if (procDes.exitValue() == 0) {
ext.tag = "DEV-${procDes.text.trim()}"
} else {
ext.tag = "NOGIT" // No tags at all?!
}
}
if (System.getenv().VERSION_FALLBACK != null) {
ext.version = System.getenv().VERSION_FALLBACK
} else {
ext.version = ext.tag
}
}
}
if (System.getenv().ARTIFACT_VERSION == null) {
version = "${project.buildInfo.version}"
} else {
version = "${System.getenv().ARTIFACT_VERSION}"
}
processResources {
inputs.property "version", project.buildInfo.tag
inputs.property "mcversion", project.minecraft.version
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version':project.buildInfo.tag, 'mcversion':project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
task generateBuildInfo(type: Copy) {
def templateContext = [
version: project.buildInfo.tag,
mcversion: project.minecraft.version,
]
inputs.properties templateContext
from 'src/template/java'
into "$buildDir/generated-source/java"
expand templateContext
}
sourceSets.main.java.srcDir "$buildDir/generated-source/java"
compileJava.dependsOn generateBuildInfo
compileJava.options.incremental = true
//weave {
// classesDir = sourceSets.main.output.classesDir
// enableArtemisPlugin = true
// enablePooledWeaving = true
// generateLinkMutators = true
// optimizeEntitySystems = true
//}
//fluid {
// doFirst {
// sourceSets.main.compileClasspath.each { c ->
// if(!c.exists() && c.getName().lastIndexOf('.')==-1) {
// c.mkdirs()
// }
// }
// }
// doLast {
// def fp = "$buildDir/generated-source/fluid/com/artemis/E.java"
// String fc = new File(fp).getText('UTF-8')
// fc = fc.replaceAll('public final class', '@SuppressWarnings("all") public final class')
// new File(fp).write(fc, 'UTF-8')
//
// fp = "$buildDir/generated-source/fluid/com/artemis/SuperMapper.java"
// fc = new File(fp).getText('UTF-8')
// fc = fc.replaceAll('public final class', '@SuppressWarnings("all") public final class')
// fc = fc.replaceAll('E getE\\(int entityId\\) \\{', '@SuppressWarnings("unchecked") E getE(int entityId) {')
// new File(fp).write(fc, 'UTF-8')
// }
// generatedSourcesDirectory = file("$buildDir/generated-source/fluid/")
// classpath = sourceSets.main.compileClasspath
//
// // Fluid Configuration
// // preferences.prefixComponentGetter = "get" // prefix for E::[get]pos()
// // preferences.prefixComponentCreate = "" // prefix for E::[]pos()
// // preferences.prefixComponentHas = "has" // prefix for E::[has]Pos()
// // preferences.prefixComponentRemove = "remove" // prefix for E::[remove]Pos()
// // preferences.generateTagMethods = true // add tag convenience methods (true).
// // preferences.generateGroupMethods = true // add group convenience methods (true).
// // preferences.generateBooleanComponentAccessors = true // Generate boolean accessors for flag components (true)?
// // preferences.swallowGettersWithParameters = false // global setting. overridden by @Fluid annotation (false).
//}
//sourceSets.main.java.srcDirs += file("$buildDir/generated-source/fluid/")
//sourceMainJava.dependsOn fluid
//classes.finalizedBy weave
jar {
manifest {
attributes(
'FMLAT': 'gregtech_at.cfg',
'FMLCorePluginContainsFMLMod': 'true',
'FMLCorePlugin': 'gregtech.asm.GT_ASM'
)
}
configurations.shade.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
exclude 'gregtech/api/interfaces/tileentity/IGregTechTileEntity.class'
}
task sourceJar(type: Jar) {
manifest {}
classifier = 'sources'
from sourceSets.main.allSource
exclude 'assets/**', 'logos/**'
}
task devJar(type: Jar) {
manifest {
attributes(
'FMLAT': 'gregtech_at.cfg',
'FMLCorePluginContainsFMLMod': 'true',
'FMLCorePlugin': 'gregtech.asm.GT_ASM'
)
}
configurations.shade.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
classifier = 'dev'
from sourceSets.main.output
}
//task coreJar(type: Jar) {
// dependsOn jar
// manifest {
// attributes(
// 'FMLAT': 'gregtech_at.cfg',
// 'FMLCorePluginContainsFMLMod': 'true',
// 'FMLCorePlugin': 'gregtech.asm.GT_ASM'
// )
// }
// classifier = 'core'
// from sourceSets.main.output
// exclude('gregtech/**')
//}
task changelog(type: Copy) {
from('./CHANGELOG.md') {
rename '.*', "$archivesBaseName-$version-changelog.md"
}
into './build/libs'
ext.output = new File("./build/libs/$archivesBaseName-$version-changelog.md")
}
task supporterlist(type: Copy) {
from('./src/main/resources/supporterlist.txt') {
rename '.*', "$archivesBaseName-$version-supporterlist.txt"
}
into './build/libs'
ext.output = new File("./build/libs/$archivesBaseName-$version-supporterlist.txt")
}
task supporterlistgold(type: Copy) {
from('./src/main/resources/supporterlistgold.txt') {
rename '.*', "$archivesBaseName-$version-supporterlistgold.txt"
}
into './build/libs'
ext.output = new File("./build/libs/$archivesBaseName-$version-supporterlistgold.txt")
}
task defaultConfigPack(type: Zip) {
doFirst {
mkdir "${project.buildDir}/${project.libsDirName}"
}
from('./.defaultconfigs/')
include('**/')
classifier = 'defaultConfigPack'
destinationDir = new File("${project.buildDir}/${project.libsDirName}")
}
jar.dependsOn supporterlist
jar.dependsOn supporterlistgold
jar.dependsOn changelog
jar.dependsOn defaultConfigPack
reobf {
//reobf(coreJar) {
// spec -> spec.classpath = sourceSets.main.compileClasspath
//}
}
artifacts {
archives devJar, sourceJar, changelog.output, supporterlist.output, supporterlistgold.output, defaultConfigPack //, coreJar
}
if (!hasProperty("mavenUsername")) {
ext.mavenUsername="${System.getenv().MAVEN_USERNAME}"
}
if (!hasProperty("mavenPassword")) {
ext.mavenPassword="${System.getenv().MAVEN_PASSWORD}"
}
if (!hasProperty("mavenURL")) {
ext.mavenURL="${System.getenv().MAVEN_URL}"
}
if ( !project.buildInfo.tag.contains("-dirty") && (System.getenv().ONLY_RELEASES!="true" || project.buildInfo.isRelease) ) {
task testIfUploadable {}
uploadArchives {
dependsOn jar
repositories {
mavenDeployer {
repository(url: mavenURL) {
authentication(userName: mavenUsername, password: mavenPassword)
}
}
}
}
}