From 206e08bbcb41031fb4821392533d19766bc6ada8 Mon Sep 17 00:00:00 2001 From: Technici4n <13494793+Technici4n@users.noreply.github.com> Date: Mon, 27 Nov 2023 22:39:22 +0100 Subject: [PATCH 1/7] proof of concept for prod mixin extras jij --- gradle.properties | 1 + projects/neoforge/build.gradle | 19 +++++++++++++++++++ projects/neoforge/jarjar_metadata.json | 15 +++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 projects/neoforge/jarjar_metadata.json diff --git a/gradle.properties b/gradle.properties index 5d794f8bce..6412ad6789 100644 --- a/gradle.properties +++ b/gradle.properties @@ -43,6 +43,7 @@ unsafe_version=0.2.+ typetools_version=0.6.3 nashorn_core_version=15.3 lwjgl_glfw_version=3.3.2 +mixin_extras_version=0.2.1 jupiter_api_version=5.7.0 vintage_engine_version=5.+ diff --git a/projects/neoforge/build.gradle b/projects/neoforge/build.gradle index 5688d82f1f..15aae90eb3 100644 --- a/projects/neoforge/build.gradle +++ b/projects/neoforge/build.gradle @@ -88,6 +88,7 @@ dependencies { } compileOnly "org.jetbrains:annotations:${project.jetbrains_annotations_version}" + compileOnly "io.github.llamalad7:mixinextras-neoforge:${project.mixin_extras_version}" } runTypes { @@ -221,6 +222,24 @@ minecraft { modIdentifier 'minecraft' } +// Bundle MixinExtras in the universal jar +afterEvaluate { + tasks.universalJar.configure { + inputs.property "mixinextras_version", project.mixin_extras_version + + into "META-INF/jars/", { + from project.configurations.detachedConfiguration( + project.dependencies.create("io.github.llamalad7:mixinextras-neoforge:${project.mixin_extras_version}") + ).files + } + into "META-INF/jarjar/", { + from project.file("jarjar_metadata.json") + rename "jarjar_metadata.json", "metadata.json" + expand "mixinextras_version": project.mixin_extras_version + } + } +} + publishing { publications.create('NeoForge', MavenPublication) { groupId = project.group diff --git a/projects/neoforge/jarjar_metadata.json b/projects/neoforge/jarjar_metadata.json new file mode 100644 index 0000000000..8da1e2a0f4 --- /dev/null +++ b/projects/neoforge/jarjar_metadata.json @@ -0,0 +1,15 @@ +{ + "jars": [ + { + "identifier": { + "group": "io.github.llamalad7", + "artifact": "mixinextras-neoforge" + }, + "version": { + "range": "[$mixinextras_version,)", + "artifactVersion": "$mixinextras_version" + }, + "path": "META-INF/jars/mixinextras-neoforge-${mixinextras_version}.jar" + } + ] +} From 1e319f49af248a937d35d1dccad5cfa9aef9e4aa Mon Sep 17 00:00:00 2001 From: Technici4n <13494793+Technici4n@users.noreply.github.com> Date: Tue, 28 Nov 2023 00:34:08 +0100 Subject: [PATCH 2/7] Make userdev work too --- projects/neoforge/build.gradle | 6 +++--- settings.gradle | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/neoforge/build.gradle b/projects/neoforge/build.gradle index 15aae90eb3..097eb966b4 100644 --- a/projects/neoforge/build.gradle +++ b/projects/neoforge/build.gradle @@ -88,7 +88,8 @@ dependencies { } compileOnly "org.jetbrains:annotations:${project.jetbrains_annotations_version}" - compileOnly "io.github.llamalad7:mixinextras-neoforge:${project.mixin_extras_version}" + + userdevCompileOnly "io.github.llamalad7:mixinextras-neoforge:${project.mixin_extras_version}" } runTypes { @@ -229,8 +230,7 @@ afterEvaluate { into "META-INF/jars/", { from project.configurations.detachedConfiguration( - project.dependencies.create("io.github.llamalad7:mixinextras-neoforge:${project.mixin_extras_version}") - ).files + project.dependencies.create("io.github.llamalad7:mixinextras-neoforge:${project.mixin_extras_version}")) } into "META-INF/jarjar/", { from project.file("jarjar_metadata.json") diff --git a/settings.gradle b/settings.gradle index b71286ea99..8de4bbeefc 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,7 +7,7 @@ pluginManagement { } plugins { - id 'net.neoforged.gradle.platform' version '7.0.40' + id 'net.neoforged.gradle.platform' version '7.0.103' // use whatever you have locally } rootProject.name = rootDir.name From 79cbb23613ef99819f7065ba620ae37fe12ec139 Mon Sep 17 00:00:00 2001 From: Technici4n <13494793+Technici4n@users.noreply.github.com> Date: Tue, 28 Nov 2023 00:35:19 +0100 Subject: [PATCH 3/7] Tweak jarjar metadata template --- projects/neoforge/build.gradle | 4 ++-- projects/neoforge/jarjar_metadata.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/neoforge/build.gradle b/projects/neoforge/build.gradle index 097eb966b4..1a1a3eb874 100644 --- a/projects/neoforge/build.gradle +++ b/projects/neoforge/build.gradle @@ -226,7 +226,7 @@ minecraft { // Bundle MixinExtras in the universal jar afterEvaluate { tasks.universalJar.configure { - inputs.property "mixinextras_version", project.mixin_extras_version + inputs.property "mixin_extras_version", project.mixin_extras_version into "META-INF/jars/", { from project.configurations.detachedConfiguration( @@ -235,7 +235,7 @@ afterEvaluate { into "META-INF/jarjar/", { from project.file("jarjar_metadata.json") rename "jarjar_metadata.json", "metadata.json" - expand "mixinextras_version": project.mixin_extras_version + expand "mixin_extras_version": project.mixin_extras_version } } } diff --git a/projects/neoforge/jarjar_metadata.json b/projects/neoforge/jarjar_metadata.json index 8da1e2a0f4..dca81c5ee9 100644 --- a/projects/neoforge/jarjar_metadata.json +++ b/projects/neoforge/jarjar_metadata.json @@ -6,10 +6,10 @@ "artifact": "mixinextras-neoforge" }, "version": { - "range": "[$mixinextras_version,)", - "artifactVersion": "$mixinextras_version" + "range": "[$mixin_extras_version,)", + "artifactVersion": "$mixin_extras_version" }, - "path": "META-INF/jars/mixinextras-neoforge-${mixinextras_version}.jar" + "path": "META-INF/jars/mixinextras-neoforge-${mixin_extras_version}.jar" } ] } From 0cdecbc04e1a59d965f4a0caffcc4b52e568c23c Mon Sep 17 00:00:00 2001 From: Technici4n <13494793+Technici4n@users.noreply.github.com> Date: Tue, 28 Nov 2023 19:08:31 +0100 Subject: [PATCH 4/7] Update --- projects/neoforge/build.gradle | 21 +++------------------ projects/neoforge/jarjar_metadata.json | 15 --------------- settings.gradle | 2 +- 3 files changed, 4 insertions(+), 34 deletions(-) delete mode 100644 projects/neoforge/jarjar_metadata.json diff --git a/projects/neoforge/build.gradle b/projects/neoforge/build.gradle index 1a1a3eb874..e0a1d32e03 100644 --- a/projects/neoforge/build.gradle +++ b/projects/neoforge/build.gradle @@ -89,7 +89,9 @@ dependencies { compileOnly "org.jetbrains:annotations:${project.jetbrains_annotations_version}" - userdevCompileOnly "io.github.llamalad7:mixinextras-neoforge:${project.mixin_extras_version}" + userdevCompileOnly jarJar("io.github.llamalad7:mixinextras-neoforge:${project.mixin_extras_version}"), { + jarJar.ranged(it, "[${project.mixin_extras_version},)") + } } runTypes { @@ -223,23 +225,6 @@ minecraft { modIdentifier 'minecraft' } -// Bundle MixinExtras in the universal jar -afterEvaluate { - tasks.universalJar.configure { - inputs.property "mixin_extras_version", project.mixin_extras_version - - into "META-INF/jars/", { - from project.configurations.detachedConfiguration( - project.dependencies.create("io.github.llamalad7:mixinextras-neoforge:${project.mixin_extras_version}")) - } - into "META-INF/jarjar/", { - from project.file("jarjar_metadata.json") - rename "jarjar_metadata.json", "metadata.json" - expand "mixin_extras_version": project.mixin_extras_version - } - } -} - publishing { publications.create('NeoForge', MavenPublication) { groupId = project.group diff --git a/projects/neoforge/jarjar_metadata.json b/projects/neoforge/jarjar_metadata.json deleted file mode 100644 index dca81c5ee9..0000000000 --- a/projects/neoforge/jarjar_metadata.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "jars": [ - { - "identifier": { - "group": "io.github.llamalad7", - "artifact": "mixinextras-neoforge" - }, - "version": { - "range": "[$mixin_extras_version,)", - "artifactVersion": "$mixin_extras_version" - }, - "path": "META-INF/jars/mixinextras-neoforge-${mixin_extras_version}.jar" - } - ] -} diff --git a/settings.gradle b/settings.gradle index 8de4bbeefc..45031ae1e3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,7 +7,7 @@ pluginManagement { } plugins { - id 'net.neoforged.gradle.platform' version '7.0.103' // use whatever you have locally + id 'net.neoforged.gradle.platform' version '7.0.107' // use whatever you have locally } rootProject.name = rootDir.name From 9425ff8a3acba2fbb2f40e58f10ac15f8327f7fd Mon Sep 17 00:00:00 2001 From: Technici4n <13494793+Technici4n@users.noreply.github.com> Date: Sat, 2 Dec 2023 11:45:46 +0100 Subject: [PATCH 5/7] Update settings.gradle --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index 45031ae1e3..82e4f2baa5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,7 +7,7 @@ pluginManagement { } plugins { - id 'net.neoforged.gradle.platform' version '7.0.107' // use whatever you have locally + id 'net.neoforged.gradle.platform' version '7.0.57' } rootProject.name = rootDir.name From 8fde1406499671c145e7318f7729220048e6be00 Mon Sep 17 00:00:00 2001 From: Technici4n <13494793+Technici4n@users.noreply.github.com> Date: Sat, 2 Dec 2023 11:46:12 +0100 Subject: [PATCH 6/7] Update gradle.properties --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 6412ad6789..f64d8887a0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -43,7 +43,7 @@ unsafe_version=0.2.+ typetools_version=0.6.3 nashorn_core_version=15.3 lwjgl_glfw_version=3.3.2 -mixin_extras_version=0.2.1 +mixin_extras_version=0.3.1 jupiter_api_version=5.7.0 vintage_engine_version=5.+ From 1a13b555d61955f42890e0391ba0da295f295933 Mon Sep 17 00:00:00 2001 From: Technici4n <13494793+Technici4n@users.noreply.github.com> Date: Sat, 2 Dec 2023 11:48:23 +0100 Subject: [PATCH 7/7] Update settings.gradle --- settings.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index 661ce2c882..82e4f2baa5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,7 +7,6 @@ pluginManagement { } plugins { - id 'net.neoforged.gradle.platform' version '7.0.57' }