diff options
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 55 |
1 files changed, 22 insertions, 33 deletions
diff --git a/build.gradle b/build.gradle index 9c45bec..60ab0a8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ -//file:noinspection GradlePackageUpdate plugins { id "net.minecraftforge.gradle.forge" version "6f53277" id "com.github.johnrengelman.shadow" version "6.1.0" + id 'org.spongepowered.mixin' version "d5f9873" id 'org.jetbrains.kotlin.jvm' version "1.6.10" id "net.kyori.blossom" version "1.3.0" id "java" @@ -49,19 +49,7 @@ dependencies { transitive = false } compileOnly 'gg.essential:essential-1.8.9-forge:1725' - compileOnly 'org.spongepowered:mixin:0.8.4' - annotationProcessor 'org.spongepowered:mixin:0.8.4:processor' - - // dependencies for mixin that aren't applied - annotationProcessor 'com.google.code.gson:gson:2.2.4' - annotationProcessor 'com.google.guava:guava:21.0' - annotationProcessor 'org.ow2.asm:asm-tree:6.2' - annotationProcessor 'org.apache.logging.log4j:log4j-core:2.0-beta9' -} - -ext { - mixinSrg = new File(project.buildDir, 'tmp/mixins/mixins.srg') - mixinRefMap = new File(project.buildDir, "tmp/mixins/mixins.${mod_id}.refmap.json") + compileOnly annotationProcessor('org.spongepowered:mixin:0.7.11-SNAPSHOT') } /** @@ -99,13 +87,30 @@ jar { enabled = false } +/** + * This task simply moves resources so they can be accessed at runtime, Forge is quite weird isn't it + */ +task moveResources { + doLast { + ant.move file: "${buildDir}/resources/main", + todir: "${buildDir}/classes/kotlin" + } +} + +moveResources.dependsOn processResources +classes.dependsOn moveResources + +mixin { + disableRefMapWarning = true + defaultObfuscationEnv searge + add sourceSets.main, "mixins.${mod_id}.refmap.json" +} // This adds support to ("include") libraries into our JAR shadowJar { archiveClassifier.set('') configurations = [project.configurations.include] duplicatesStrategy DuplicatesStrategy.EXCLUDE - from files(project.mixinRefMap.canonicalPath) } reobf { @@ -119,22 +124,6 @@ sourceSets { dummy main { compileClasspath += dummy.output - output.resourcesDir = file("${buildDir}/classes/kotlin/main") + ext.refMap = "mixins.${mod_id}.refmap.json" } -} - -compileJava { - options.compilerArgs += [ - "-AoutSrgFile=${project.mixinSrg.canonicalPath}", - "-AoutRefMapFile=${project.mixinRefMap.canonicalPath}", - "-AreobfSrgFile=${project.file('build/mcp-srg.srg').canonicalPath}" - ] -} - -task copySrg(type: Copy, dependsOn: 'genSrgs') { - from { project.tasks.genSrgs.mcpToSrg } - into 'build' -} -compileJava.dependsOn copySrg - -reobfJar.addSecondarySrgFile project.mixinSrg +}
\ No newline at end of file |