From cca408ac55d40eb6ae0b85a07f6746a20c1f7715 Mon Sep 17 00:00:00 2001 From: drori200 Date: Wed, 12 Oct 2022 22:52:08 +0300 Subject: [PATCH] Split releases to have a release without mixin embedded --- build.gradle | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 51027b334..49bf46fb0 100644 --- a/build.gradle +++ b/build.gradle @@ -16,8 +16,8 @@ buildscript { } configurations { - embed - compile.extendsFrom(embed) + mixins + compile.extendsFrom(mixins) shade compile.extendsFrom(shade) } @@ -98,7 +98,7 @@ repositories { } dependencies { - embed('org.spongepowered:mixin:0.7.11-SNAPSHOT') { + mixins('org.spongepowered:mixin:0.7.11-SNAPSHOT') { // Mixin includes a lot of dependencies that are too up-to-date exclude module: 'launchwrapper' exclude module: 'guava' @@ -127,17 +127,34 @@ jar { attributes.put("MixinConfigs", yourMixinConfig) } - // embed libraries in jar - from configurations.embed.collect { - exclude '**/LICENSE.txt' - it.isDirectory() ? it : zipTree(it) - } } +// a task to run after the reobf task to create another jar with the contents of the mixin dependency +task MixinsJar(type: Jar, dependsOn: reobf) { + classifier = "mixin-included" + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + manifest { + attributes.put("TweakClass", "org.spongepowered.asm.launch.MixinTweaker") + attributes.put("FMLCorePluginContainsFMLMod", true) + attributes.put("ForceLoadAsMod", true) + attributes.put("MixinConfigs", yourMixinConfig) + } + from configurations.mixins.collect { + exclude '**/LICENSE.txt' + //exclude signature files (causing a SecurityException error) + exclude "**/**.RSA" + exclude "**/**.SF" + it.isDirectory() ? it : zipTree(it) + } + with jar +} reobf { addExtraSrgFile mixinSrg } +artifacts { + archives MixinsJar +} afterEvaluate { def fixedRelPathToAP = relativePathToMixinAP if(fixedRelPathToAP.startsWith('./') || fixedRelPathToAP.startsWith('.\\')){