Avoid deprecation warning with Gradle 8.4-rc-1

Closes gh-37493
2.7.x
Andy Wilkinson 1 year ago
parent f6230120dc
commit 89a86e91f5

@ -28,6 +28,7 @@ import org.gradle.api.provider.Property;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.Optional;
import org.gradle.util.GradleVersion;
/**
* The properties that are written into the {@code build-info.properties} file.
@ -38,6 +39,8 @@ import org.gradle.api.tasks.Optional;
@SuppressWarnings("serial")
public class BuildInfoProperties implements Serializable {
private static final GradleVersion GRADLE_7_4 = GradleVersion.version("7.4");
private transient Instant creationTime = Instant.now();
private final Property<String> group;
@ -74,8 +77,11 @@ public class BuildInfoProperties implements Serializable {
@SuppressWarnings("deprecation")
private Provider<String> forUseAtConfigurationTime(Provider<String> provider) {
if (GradleVersion.current().compareTo(GRADLE_7_4) < 0) {
return provider.forUseAtConfigurationTime();
}
return provider;
}
/**
* Returns the value used for the {@code build.group} property. Defaults to the

@ -34,15 +34,15 @@ public final class GradleVersions {
public static List<String> allCompatible() {
if (isJava18()) {
return Arrays.asList("7.3.3", GradleVersion.current().getVersion(), "8.0.2", "8.3");
return Arrays.asList("7.3.3", GradleVersion.current().getVersion(), "8.0.2", "8.3", "8.4-rc-1");
}
if (isJava17()) {
return Arrays.asList("7.2", GradleVersion.current().getVersion(), "8.0.2", "8.3");
return Arrays.asList("7.2", GradleVersion.current().getVersion(), "8.0.2", "8.3", "8.4-rc-1");
}
if (isJava16()) {
return Arrays.asList("7.0.2", GradleVersion.current().getVersion(), "8.0.2", "8.3");
return Arrays.asList("7.0.2", GradleVersion.current().getVersion(), "8.0.2", "8.3", "8.4-rc-1");
}
return Arrays.asList("6.8.3", "6.9.4", "7.0.2", GradleVersion.current().getVersion(), "8.0.2", "8.3");
return Arrays.asList("6.8.3", "6.9.4", "7.0.2", GradleVersion.current().getVersion(), "8.0.2", "8.3", "8.4-rc-1");
}
public static String minimumCompatible() {

Loading…
Cancel
Save