From 40d17bacee1645b5647ff8f7499dcc625924066f Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 23 Dec 2024 12:56:40 +0000 Subject: [PATCH] Update to Gradle 8.12 --- .../bootstrap/LoomGradlePluginBootstrap.java | 2 +- build.gradle | 14 ++++---- gradle/libs.versions.toml | 2 +- gradle/test.libs.versions.toml | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 3 +- .../test/integration/FabricAPITest.groovy | 4 +-- src/test/resources/patches/fabric_api.patch | 32 ++++++++----------- .../projects/mavenLibrary/build.gradle | 4 +-- .../resources/projects/signed/build.gradle | 4 +-- 10 files changed, 31 insertions(+), 38 deletions(-) diff --git a/bootstrap/src/main/java/net/fabricmc/loom/bootstrap/LoomGradlePluginBootstrap.java b/bootstrap/src/main/java/net/fabricmc/loom/bootstrap/LoomGradlePluginBootstrap.java index 0b8529732..35113243a 100644 --- a/bootstrap/src/main/java/net/fabricmc/loom/bootstrap/LoomGradlePluginBootstrap.java +++ b/bootstrap/src/main/java/net/fabricmc/loom/bootstrap/LoomGradlePluginBootstrap.java @@ -17,7 +17,7 @@ */ @SuppressWarnings("unused") public abstract class LoomGradlePluginBootstrap implements Plugin { - private static final String MIN_SUPPORTED_GRADLE_VERSION = "8.11"; + private static final String MIN_SUPPORTED_GRADLE_VERSION = "8.12"; private static final int MIN_SUPPORTED_MAJOR_JAVA_VERSION = 17; private static final int MIN_SUPPORTED_MAJOR_IDEA_VERSION = 2022; diff --git a/build.gradle b/build.gradle index caf00733f..d63f04364 100644 --- a/build.gradle +++ b/build.gradle @@ -56,7 +56,7 @@ repositories { configurations { bootstrap { - transitive false + transitive = false } compileClasspath.extendsFrom bootstrap runtimeClasspath.extendsFrom bootstrap @@ -294,18 +294,18 @@ publishing { if (!ENV.EXPERIMENTAL) { // Also publish a snapshot so people can use the latest version if they wish snapshot(MavenPublication) { publication -> - groupId project.group - artifactId project.base.archivesName.get() - version baseVersion + '-SNAPSHOT' + groupId = project.group + artifactId = project.base.archivesName.get() + version = baseVersion + '-SNAPSHOT' from components.java } // Manually crate the plugin marker for snapshot versions snapshotPlugin(MavenPublication) { publication -> - groupId 'fabric-loom' - artifactId 'fabric-loom.gradle.plugin' - version baseVersion + '-SNAPSHOT' + groupId = 'fabric-loom' + artifactId = 'fabric-loom.gradle.plugin' + version = baseVersion + '-SNAPSHOT' pom.withXml({ // Based off org.gradle.plugin.devel.plugins.MavenPluginPublishPlugin diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 41500ffe5..23f5f1369 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -kotlin = "2.0.20" +kotlin = "2.0.21" asm = "9.7.1" commons-io = "2.15.1" gson = "2.10.1" diff --git a/gradle/test.libs.versions.toml b/gradle/test.libs.versions.toml index 4bc6312a1..f098d0109 100644 --- a/gradle/test.libs.versions.toml +++ b/gradle/test.libs.versions.toml @@ -6,7 +6,7 @@ mockito = "5.14.2" java-debug = "0.52.0" mixin = "0.15.3+mixin.0.8.7" -gradle-nightly = "8.12-20241110002642+0000" +gradle-nightly = "8.13-20241222002427+0000" fabric-loader = "0.16.9" fabric-installer = "1.0.1" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7cf748e74..e0fd02028 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index f5feea6d6..f3b75f3b0 100755 --- a/gradlew +++ b/gradlew @@ -86,8 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s -' "$PWD" ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy b/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy index 53547032a..c1200bc36 100644 --- a/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/integration/FabricAPITest.groovy @@ -44,7 +44,7 @@ class FabricAPITest extends Specification implements GradleProjectTestTrait { setup: def gradle = gradleProject( repo: "https://github.com/FabricMC/fabric.git", - commit: "70277babddfaf52ee30013af94764da19473b3b1", + commit: "d70d2c06bb8fafdb72c6778b29fb050618015ab3", version: version, patch: "fabric_api" ) @@ -58,7 +58,7 @@ class FabricAPITest extends Specification implements GradleProjectTestTrait { """.stripIndent() } - def minecraftVersion = "1.21.4-pre3" + def minecraftVersion = "1.21.4" def server = ServerRunner.create(gradle.projectDir, minecraftVersion) .withMod(gradle.getOutputFile("fabric-api-999.0.0.jar")) diff --git a/src/test/resources/patches/fabric_api.patch b/src/test/resources/patches/fabric_api.patch index b2b777754..ae85767c7 100644 --- a/src/test/resources/patches/fabric_api.patch +++ b/src/test/resources/patches/fabric_api.patch @@ -1,6 +1,6 @@ diff --git a/build.gradle b/build.gradle ---- a/build.gradle (revision 70277babddfaf52ee30013af94764da19473b3b1) -+++ b/build.gradle (date 1732875235843) +--- a/build.gradle (revision d70d2c06bb8fafdb72c6778b29fb050618015ab3) ++++ b/build.gradle (date 1734958436644) @@ -13,7 +13,7 @@ def ENV = System.getenv() @@ -36,23 +36,17 @@ diff --git a/build.gradle b/build.gradle } def getBranch() { -@@ -247,19 +230,6 @@ - - test { - useJUnitPlatform() -- -- afterEvaluate { -- // See: https://github.com/FabricMC/fabric-loader/pull/585 -- def classPathGroups = loom.mods.stream() -- .map { modSettings -> -- SourceSetHelper.getClasspath(modSettings, getProject()).stream() -- .map(File.&getAbsolutePath) -- .collect(Collectors.joining(File.pathSeparator)) -- } -- .collect(Collectors.joining(File.pathSeparator+File.pathSeparator)) -- -- systemProperty("fabric.classPathGroups", classPathGroups) -- } +@@ -250,10 +233,11 @@ } tasks.withType(ProcessResources).configureEach { +- inputs.property "version", project.version ++ def version = project.version ++ inputs.property "version", version + + filesMatching("fabric.mod.json") { +- expand "version": project.version ++ expand "version": version + } + } + diff --git a/src/test/resources/projects/mavenLibrary/build.gradle b/src/test/resources/projects/mavenLibrary/build.gradle index 2a31d1a30..5d641ff17 100644 --- a/src/test/resources/projects/mavenLibrary/build.gradle +++ b/src/test/resources/projects/mavenLibrary/build.gradle @@ -37,14 +37,14 @@ publishing { from components.java artifact(remapJar) { - classifier "classifier" + classifier = "classifier" } } } repositories { maven { - url "http://localhost:${System.getProperty("loom.test.mavenPort")}/" + url = "http://localhost:${System.getProperty("loom.test.mavenPort")}/" allowInsecureProtocol = true } } diff --git a/src/test/resources/projects/signed/build.gradle b/src/test/resources/projects/signed/build.gradle index 1d667cd82..8b2926f98 100644 --- a/src/test/resources/projects/signed/build.gradle +++ b/src/test/resources/projects/signed/build.gradle @@ -36,14 +36,14 @@ publishing { from components.java artifact(remapJar) { builtBy remapJar - classifier "classifier" + classifier = "classifier" } } } repositories { maven { - url "http://localhost:${System.getProperty("loom.test.mavenPort")}/" + url = "http://localhost:${System.getProperty("loom.test.mavenPort")}/" allowInsecureProtocol = true } }