From 1c4494a6d8db28c57a48b85e3ae03a666d4db2a0 Mon Sep 17 00:00:00 2001 From: Bartosz Skrzypczak Date: Tue, 26 Dec 2023 15:16:50 +0100 Subject: [PATCH] Fix mixinLoadingHacks again for intellij Intellij will actually include the artifact transform output instead of the project as dependency if we transform, so when we have an included build we just skip the transform --- mixinLoadingHacks.gradle | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/mixinLoadingHacks.gradle b/mixinLoadingHacks.gradle index 92afe32..7242337 100644 --- a/mixinLoadingHacks.gradle +++ b/mixinLoadingHacks.gradle @@ -17,6 +17,7 @@ import java.nio.file.attribute.BasicFileAttributes // this artifact transform just adds the string Mixin FML agent is looking for into the jar name def artifactType = Attribute.of('artifactType', String) def renamedForMixinFmlAgent = Attribute.of('renamedForMixinFmlAgent', Boolean) +def hasCubicChunksBuild = gradle.includedBuilds.any { it.name == "CubicChunks" || it.name == "1.12" } dependencies { attributesSchema { @@ -37,10 +38,18 @@ dependencies { registerTransform(RenameForMixinFmlAgentTransform) { from.attribute(renamedForMixinFmlAgent, false).attribute(artifactType, "jar") to.attribute(renamedForMixinFmlAgent, true).attribute(artifactType, "jar") + parameters { + transformCubicChunksJar = !hasCubicChunksBuild + } } } -abstract class RenameForMixinFmlAgentTransform implements TransformAction { +abstract class RenameForMixinFmlAgentTransform implements TransformAction { + interface Parameters extends TransformParameters { + @Input + Property getTransformCubicChunksJar() + } + @InputArtifact abstract Provider getInputArtifact() @@ -56,6 +65,13 @@ abstract class RenameForMixinFmlAgentTransform implements TransformAction