Merge branch '2.6.x' into 2.7.x

Closes gh-32987
pull/33648/head
Andy Wilkinson 2 years ago
commit a3870f8da7

@ -18,10 +18,20 @@ package org.springframework.boot.gradle.tasks.bundling;
import groovy.lang.Closure;
import org.gradle.api.Action;
import org.gradle.util.GradleVersion;
/**
* Wrapper for the deprecated {@link org.gradle.util.ConfigureUtil} that allows
* deprecation warnings to be suppressed in a single, focused location.
* Wrapper for {@code ConfigureUtil} that handles the API and behavior differences in the
* versions of Gradle that we support.
* <p>
* In Gradle 7.1 {@code org.gradle.util.ConfigureUtil} was deprecated and
* {@code org.gradle.util.internal.ConfigureUtil} was introduced as a replacement. In
* Gradle 7.6, the deprecation of {@code org.gradle.util.ConfigureUtil} was strengthened
* by reporting the use of deprecated API to the user.
* <p>
* To accommodate the differences, we use {@code org.gradle.util.internal.ConfigureUtil}
* with Gradle 7.1 and later. With earlier versions, {@code org.gradle.util.ConfigureUtil}
* is used. This avoids users by nagged about deprecated API usage in our plugin.
*
* @author Andy Wilkinson
*/
@ -33,7 +43,10 @@ final class Closures {
@SuppressWarnings("deprecation")
static <T> Action<T> asAction(Closure<?> closure) {
return org.gradle.util.ConfigureUtil.configureUsing(closure);
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
return org.gradle.util.ConfigureUtil.configureUsing(closure);
}
return org.gradle.util.internal.ConfigureUtil.configureUsing(closure);
}
}

@ -34,16 +34,17 @@ public final class GradleVersions {
public static List<String> allCompatible() {
if (isJava18()) {
return Arrays.asList("7.3.3", "7.4.2", GradleVersion.current().getVersion());
return Arrays.asList("7.3.3", "7.4.2", GradleVersion.current().getVersion(), "7.6-rc-1");
}
if (isJava17()) {
return Arrays.asList("7.2", "7.3.3", "7.4.2", GradleVersion.current().getVersion());
return Arrays.asList("7.2", "7.3.3", "7.4.2", GradleVersion.current().getVersion(), "7.6-rc-1");
}
if (isJava16()) {
return Arrays.asList("7.0.2", "7.1", "7.2", "7.3.3", "7.4.2", GradleVersion.current().getVersion());
return Arrays.asList("7.0.2", "7.1", "7.2", "7.3.3", "7.4.2", GradleVersion.current().getVersion(),
"7.6-rc-1");
}
return Arrays.asList("6.8.3", "6.9.3", "7.0.2", "7.1.1", "7.2", "7.3.3", "7.4.2",
GradleVersion.current().getVersion());
GradleVersion.current().getVersion(), "7.6-rc-1");
}
public static String minimumCompatible() {

Loading…
Cancel
Save