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
This commit is contained in:
modmuss50 2021-06-13 13:28:47 +01:00 committed by GitHub
parent 0cfa88f73b
commit 9278f6c4b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 5 deletions

View file

@ -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

View file

@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.8.local'
id 'fabric-loom' version '0.9.local'
}
dependencies {

View file

@ -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()) {

View file

@ -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()