1
- // version: 7d8e9fd40492c7862532bc771cf8ff3460bf64d5
1
+ // version: ffe7b130f98fdfa1ac7c6ba4bd34722a55ab28d4
2
2
/*
3
3
DO NOT CHANGE THIS FILE!
4
4
@@ -62,6 +62,10 @@ idea {
62
62
}
63
63
}
64
64
65
+ if (JavaVersion . current() != JavaVersion . VERSION_1_8 ) {
66
+ throw new GradleException (" This project requires Java 8, but it's running on " + JavaVersion . current())
67
+ }
68
+
65
69
checkPropertyExists(" modName" )
66
70
checkPropertyExists(" modId" )
67
71
checkPropertyExists(" modGroup" )
@@ -153,7 +157,12 @@ configurations.all {
153
157
// Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version
154
158
' git config core.fileMode false' . execute()
155
159
// Pulls version from git tag
156
- version = minecraftVersion + " -" + gitVersion()
160
+ try {
161
+ version = minecraftVersion + " -" + gitVersion()
162
+ }
163
+ catch (Exception e) {
164
+ throw new IllegalStateException (" This mod must be version controlled by Git AND the repository must provide at least one tag!" );
165
+ }
157
166
group = modGroup
158
167
archivesBaseName = modId
159
168
@@ -225,14 +234,13 @@ dependencies {
225
234
226
235
apply from : ' dependencies.gradle'
227
236
228
- def mixinConfigJson = " mixins." + modId + " .json"
229
237
def mixingConfigRefMap = " mixins." + modId + " .refmap.json"
230
238
def refMap = " ${ tasks.compileJava.temporaryDir} " + File . separator + mixingConfigRefMap
231
239
def mixinSrg = " ${ tasks.reobf.temporaryDir} " + File . separator + " mixins.srg"
232
240
233
241
task generateAssets {
234
242
if (usesMixins. toBoolean()) {
235
- new File (projectDir. toString() + " /src/main/resources/" , mixinConfigJson ). text = """ {
243
+ new File (projectDir. toString() + " /src/main/resources/" , " mixins. " + modId + " .json " ). text = """ {
236
244
"required": true,
237
245
"minVersion": "0.7.11",
238
246
"package": "${ modGroup} .${ mixinsPackage} ",
@@ -351,6 +359,10 @@ processResources
351
359
" modName" : modName
352
360
}
353
361
362
+ if (usesMixins. toBoolean()) {
363
+ from refMap
364
+ }
365
+
354
366
// copy everything else, thats not the mcmod.info
355
367
from(sourceSets. main. resources. srcDirs) {
356
368
exclude ' mcmod.info'
@@ -359,7 +371,7 @@ processResources
359
371
360
372
def getManifestAttributes () {
361
373
def manifestAttributes = [:]
362
- if (containsMixinsAndOrCoreModOnly. toBoolean() == false ) {
374
+ if (containsMixinsAndOrCoreModOnly. toBoolean() == false && (usesMixins . toBoolean() || coreModClass) ) {
363
375
manifestAttributes + = [" FMLCorePluginContainsFMLMod" : true ]
364
376
}
365
377
@@ -374,7 +386,7 @@ def getManifestAttributes() {
374
386
if (usesMixins. toBoolean()) {
375
387
manifestAttributes + = [
376
388
" TweakClass" : " org.spongepowered.asm.launch.MixinTweaker" ,
377
- " MixinConfigs" : mixinConfigJson ,
389
+ " MixinConfigs" : " mixins. " + modId + " .json " ,
378
390
" ForceLoadAsMod" : containsMixinsAndOrCoreModOnly. toBoolean() == false
379
391
]
380
392
}
@@ -448,22 +460,6 @@ artifacts {
448
460
}
449
461
}
450
462
451
- // Crude handler to append custom maven repositories to maven dependency
452
- install {
453
- repositories{
454
- mavenInstaller{
455
- pom. withXml {
456
- def repositoriesNode = asNode(). appendNode(" repositories" )
457
- project. repositories. each { repository ->
458
- def repositoryNode = repositoriesNode. appendNode(" repository" )
459
- repositoryNode. appendNode(" name" , repository. name)
460
- repositoryNode. appendNode(" url" , repository. properties. get(" url" ))
461
- }
462
- }
463
- }
464
- }
465
- }
466
-
467
463
// Updating
468
464
task updateBuildScript {
469
465
doLast {
0 commit comments