From 9278f6c4b928480799d00988c66989a76bdd7619 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 13 Jun 2021 13:28:47 +0100 Subject: [PATCH] Fix new gradle 8.0 deprecation added in 7.2 (#416) * Fix new gradle 8.0 deprecation added in 7.2 * Handle bootstrap tests a bit better * Fix 0.9 wrapper tests --- .github/workflows/test-push.yml | 3 +-- bootstrap/test-project/build.gradle | 2 +- .../loom/configuration/RemapConfiguration.java | 10 +++++++++- .../fabricmc/loom/test/util/ProjectTestTrait.groovy | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-push.yml b/.github/workflows/test-push.yml index 9bed2ef..ae5306a 100644 --- a/.github/workflows/test-push.yml +++ b/.github/workflows/test-push.yml @@ -165,8 +165,7 @@ jobs: - run: ./gradlew --version working-directory: bootstrap/test-project - - run: ./gradlew build + - run: ./gradlew build || true working-directory: bootstrap/test-project - continue-on-error: true # TODO check the output of the previous step here \ No newline at end of file diff --git a/bootstrap/test-project/build.gradle b/bootstrap/test-project/build.gradle index 2cb6e85..f2a0541 100644 --- a/bootstrap/test-project/build.gradle +++ b/bootstrap/test-project/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.8.local' + id 'fabric-loom' version '0.9.local' } dependencies { diff --git a/src/main/java/net/fabricmc/loom/configuration/RemapConfiguration.java b/src/main/java/net/fabricmc/loom/configuration/RemapConfiguration.java index 7534c27..3a19e70 100644 --- a/src/main/java/net/fabricmc/loom/configuration/RemapConfiguration.java +++ b/src/main/java/net/fabricmc/loom/configuration/RemapConfiguration.java @@ -27,6 +27,7 @@ package net.fabricmc.loom.configuration; import java.io.IOException; import com.google.common.base.Preconditions; +import org.gradle.api.Action; import org.gradle.api.Project; import org.gradle.api.Task; import org.gradle.api.UnknownTaskException; @@ -144,7 +145,14 @@ public class RemapConfiguration { remapSourcesJarTask.dependsOn(project.getTasks().getByName(sourcesJarTaskName)); if (isDefaultRemap) { - remapSourcesJarTask.doLast(task -> project.getArtifacts().add("archives", remapSourcesJarTask.getOutput())); + // Do not use lambda here, see: https://github.com/gradle/gradle/pull/17087 + //noinspection Convert2Lambda + remapSourcesJarTask.doLast(new Action<>() { + @Override + public void execute(Task task) { + project.getArtifacts().add("archives", remapSourcesJarTask.getOutput()); + } + }); } if (extension.isShareCaches()) { diff --git a/src/test/groovy/net/fabricmc/loom/test/util/ProjectTestTrait.groovy b/src/test/groovy/net/fabricmc/loom/test/util/ProjectTestTrait.groovy index 2d0640a..0f72662 100644 --- a/src/test/groovy/net/fabricmc/loom/test/util/ProjectTestTrait.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/util/ProjectTestTrait.groovy @@ -29,7 +29,7 @@ import org.gradle.testkit.runner.GradleRunner trait ProjectTestTrait { final static String DEFAULT_GRADLE = "7.0.1" - final static String PRE_RELEASE_GRADLE = "7.2-20210527220045+0000" + final static String PRE_RELEASE_GRADLE = "7.2-20210612220215+0000" static File gradleHome = File.createTempDir() File testProjectDir = File.createTempDir()