From 5623fe3b944efa30c514485e9e85644d12aaf890 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 2 Jun 2023 13:23:36 +0100 Subject: [PATCH] Test Gradle plugin against Gradle 8.2-rc-1 Closes gh-35699 --- .../boot/gradle/dsl/SpringBootExtension.java | 7 ++++++- .../plugin/ApplicationPluginAction.java | 6 ++++++ .../boot/gradle/plugin/JavaPluginAction.java | 19 ++++++++----------- .../boot/gradle/plugin/SpringBootPlugin.java | 4 +++- .../boot/gradle/plugin/WarPluginAction.java | 7 ++++++- ...anBeUsedToCustomizeDistributionName.gradle | 4 +++- ...icationPluginActionIntegrationTests.gradle | 4 +++- ...grationTests-buildsImageWithBinding.gradle | 14 ++++++++++++-- ...buildsImageWithBuildpackFromBuilder.gradle | 14 ++++++++++++-- ...ildsImageWithBuildpackFromDirectory.gradle | 14 ++++++++++++-- ...buildsImageWithBuildpackFromTarGzip.gradle | 14 ++++++++++++-- ...buildsImageWithBuildpacksFromImages.gradle | 14 ++++++++++++-- ...s-buildsImageWithCommandLineOptions.gradle | 14 ++++++++++++-- ...dsImageWithCustomBuilderAndRunImage.gradle | 14 ++++++++++++-- ...tionTests-buildsImageWithCustomName.gradle | 14 ++++++++++++-- ...onTests-buildsImageWithLaunchScript.gradle | 14 ++++++++++++-- ...ests-buildsImageWithNetworkModeNone.gradle | 14 ++++++++++++-- ...IntegrationTests-buildsImageWithTag.gradle | 14 ++++++++++++-- ...onTests-buildsImageWithVolumeCaches.gradle | 14 ++++++++++++-- ...WithWarPackagingAndJarConfiguration.gradle | 14 ++++++++++++-- ...s-failsWhenCachesAreConfiguredTwice.gradle | 14 ++++++++++++-- ...egrationTests-failsWithBuilderError.gradle | 14 ++++++++++++-- ...ests-failsWithBuildpackNotInBuilder.gradle | 14 ++++++++++++-- ...ntegrationTests-failsWithInvalidTag.gradle | 14 ++++++++++++-- .../BootBuildImageIntegrationTests.gradle | 14 ++++++++++++-- ...tBuildImageRegistryIntegrationTests.gradle | 14 ++++++++++++-- ...pplicationPluginMainClassNameIsUsed.gradle | 4 +++- ...pplicationPluginMainClassNameIsUsed.gradle | 4 +++- ...pplicationPluginMainClassNameIsUsed.gradle | 4 +++- .../gradle/testkit/GradleVersions.java | 9 +++++---- 30 files changed, 277 insertions(+), 61 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/dsl/SpringBootExtension.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/dsl/SpringBootExtension.java index 92f8d565d6..3c29698ae7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/dsl/SpringBootExtension.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/dsl/SpringBootExtension.java @@ -22,12 +22,14 @@ import org.gradle.api.Action; import org.gradle.api.Project; import org.gradle.api.plugins.BasePlugin; import org.gradle.api.plugins.JavaPlugin; +import org.gradle.api.plugins.JavaPluginExtension; import org.gradle.api.provider.Property; import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.SourceSetContainer; import org.gradle.api.tasks.TaskContainer; import org.gradle.api.tasks.TaskProvider; import org.gradle.jvm.tasks.Jar; +import org.gradle.util.GradleVersion; import org.springframework.boot.gradle.tasks.buildinfo.BuildInfo; import org.springframework.boot.gradle.tasks.buildinfo.BuildInfoProperties; @@ -117,7 +119,10 @@ public class SpringBootExtension { @SuppressWarnings("deprecation") private SourceSetContainer sourceSets(Project project) { - return project.getConvention().getPlugin(org.gradle.api.plugins.JavaPluginConvention.class).getSourceSets(); + if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + return project.getConvention().getPlugin(org.gradle.api.plugins.JavaPluginConvention.class).getSourceSets(); + } + return project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets(); } private String determineArtifactBaseName() { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/ApplicationPluginAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/ApplicationPluginAction.java index a8bd949c62..6d6ce03068 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/ApplicationPluginAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/ApplicationPluginAction.java @@ -36,6 +36,8 @@ import org.gradle.api.tasks.TaskProvider; import org.gradle.jvm.application.scripts.TemplateBasedScriptGenerator; import org.gradle.jvm.application.tasks.CreateStartScripts; +import org.springframework.boot.gradle.tasks.run.BootRun; + /** * Action that is executed in response to the {@link ApplicationPlugin} being applied. * @@ -56,6 +58,10 @@ final class ApplicationPluginAction implements PluginApplicationAction { CopySpec binCopySpec = project.copySpec().into("bin").from(bootStartScripts); binCopySpec.setFileMode(0755); distribution.getContents().with(binCopySpec); + project.getTasks() + .named(SpringBootPlugin.BOOT_RUN_TASK_NAME, BootRun.class) + .configure((bootRun) -> bootRun.getConventionMapping() + .map("jvmArgs", javaApplication::getApplicationDefaultJvmArgs)); } private void configureCreateStartScripts(Project project, JavaApplication javaApplication, diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java index 168a933f14..704442984e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java @@ -17,7 +17,6 @@ package org.springframework.boot.gradle.plugin; import java.io.File; -import java.util.Collections; import java.util.List; import java.util.Set; import java.util.concurrent.Callable; @@ -45,6 +44,7 @@ import org.gradle.api.tasks.bundling.Jar; import org.gradle.api.tasks.compile.JavaCompile; import org.gradle.jvm.toolchain.JavaToolchainService; import org.gradle.jvm.toolchain.JavaToolchainSpec; +import org.gradle.util.GradleVersion; import org.springframework.boot.gradle.tasks.bundling.BootBuildImage; import org.springframework.boot.gradle.tasks.bundling.BootJar; @@ -141,18 +141,12 @@ final class JavaPluginAction implements PluginApplicationAction { Callable classpath = () -> sourceSets(project).findByName(SourceSet.MAIN_SOURCE_SET_NAME) .getRuntimeClasspath() .filter(new JarTypeFileSpec()); - TaskProvider resolveProvider = ResolveMainClassName.registerForTask("bootRun", project, - classpath); - project.getTasks().register("bootRun", BootRun.class, (run) -> { + TaskProvider resolveProvider = ResolveMainClassName + .registerForTask(SpringBootPlugin.BOOT_RUN_TASK_NAME, project, classpath); + project.getTasks().register(SpringBootPlugin.BOOT_RUN_TASK_NAME, BootRun.class, (run) -> { run.setDescription("Runs this project as a Spring Boot application."); run.setGroup(ApplicationPlugin.APPLICATION_GROUP); run.classpath(classpath); - run.getConventionMapping().map("jvmArgs", () -> { - if (project.hasProperty("applicationDefaultJvmArgs")) { - return project.property("applicationDefaultJvmArgs"); - } - return Collections.emptyList(); - }); run.getMainClass().convention(resolveProvider.flatMap(ResolveMainClassName::readMainClassName)); configureToolchainConvention(project, run); }); @@ -166,7 +160,10 @@ final class JavaPluginAction implements PluginApplicationAction { @SuppressWarnings("deprecation") private SourceSetContainer sourceSets(Project project) { - return project.getConvention().getPlugin(org.gradle.api.plugins.JavaPluginConvention.class).getSourceSets(); + if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + return project.getConvention().getPlugin(org.gradle.api.plugins.JavaPluginConvention.class).getSourceSets(); + } + return project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets(); } private void configureUtf8Encoding(Project evaluatedProject) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SpringBootPlugin.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SpringBootPlugin.java index 7644ffd95d..4010b70de0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SpringBootPlugin.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SpringBootPlugin.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,6 +70,8 @@ public class SpringBootPlugin implements Plugin { */ public static final String BOOT_BUILD_IMAGE_TASK_NAME = "bootBuildImage"; + static final String BOOT_RUN_TASK_NAME = "bootRun"; + /** * The name of the {@code developmentOnly} configuration. * @since 2.3.0 diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/WarPluginAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/WarPluginAction.java index c5f5fe365b..582e59f073 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/WarPluginAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/WarPluginAction.java @@ -25,12 +25,14 @@ import org.gradle.api.artifacts.Configuration; import org.gradle.api.artifacts.ConfigurationContainer; import org.gradle.api.file.FileCollection; import org.gradle.api.plugins.BasePlugin; +import org.gradle.api.plugins.JavaPluginExtension; import org.gradle.api.plugins.WarPlugin; import org.gradle.api.provider.Provider; import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.SourceSetContainer; import org.gradle.api.tasks.TaskProvider; import org.gradle.api.tasks.bundling.War; +import org.gradle.util.GradleVersion; import org.springframework.boot.gradle.tasks.bundling.BootBuildImage; import org.springframework.boot.gradle.tasks.bundling.BootWar; @@ -99,7 +101,10 @@ class WarPluginAction implements PluginApplicationAction { @SuppressWarnings("deprecation") private SourceSetContainer sourceSets(Project project) { - return project.getConvention().getPlugin(org.gradle.api.plugins.JavaPluginConvention.class).getSourceSets(); + if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + return project.getConvention().getPlugin(org.gradle.api.plugins.JavaPluginConvention.class).getSourceSets(); + } + return project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets(); } private FileCollection providedRuntimeConfiguration(Project project) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-applicationNameCanBeUsedToCustomizeDistributionName.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-applicationNameCanBeUsedToCustomizeDistributionName.gradle index 53ef2f261e..4952c7dd48 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-applicationNameCanBeUsedToCustomizeDistributionName.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-applicationNameCanBeUsedToCustomizeDistributionName.gradle @@ -4,7 +4,9 @@ plugins { id 'org.springframework.boot' version '{version}' } -applicationName = 'custom' +application { + applicationName = 'custom' +} bootJar { mainClass = 'com.example.ExampleApplication' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.gradle index bb417a27fb..0bace9b66c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.gradle @@ -4,7 +4,9 @@ plugins { if (project.hasProperty('applyApplicationPlugin')) { apply plugin: 'application' - applicationDefaultJvmArgs = ['-Dcom.example.a=alpha', '-Dcom.example.b=bravo'] + application { + applicationDefaultJvmArgs = ['-Dcom.example.a=alpha', '-Dcom.example.b=bravo'] + } } task('taskExists') { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBinding.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBinding.gradle index bc303f1033..396f39db9d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBinding.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBinding.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpackFromBuilder.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpackFromBuilder.gradle index 148c37228b..914b298b0c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpackFromBuilder.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpackFromBuilder.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpackFromDirectory.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpackFromDirectory.gradle index ea724f8900..dbfc69cce5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpackFromDirectory.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpackFromDirectory.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpackFromTarGzip.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpackFromTarGzip.gradle index 1f8d022ea5..4855a10581 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpackFromTarGzip.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpackFromTarGzip.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpacksFromImages.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpacksFromImages.gradle index 73c6d37ab9..4e1a7dafd3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpacksFromImages.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithBuildpacksFromImages.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCommandLineOptions.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCommandLineOptions.gradle index 8971742147..612f78e9f0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCommandLineOptions.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCommandLineOptions.gradle @@ -1,7 +1,17 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomBuilderAndRunImage.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomBuilderAndRunImage.gradle index b3fd2aa083..26884ddc12 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomBuilderAndRunImage.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomBuilderAndRunImage.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { imageName = "example/test-image-custom" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomName.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomName.gradle index 73e1cc664c..a15452e379 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomName.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomName.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { imageName = "example/test-image-name" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithLaunchScript.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithLaunchScript.gradle index c69f24eabc..375eaa6335 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithLaunchScript.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithLaunchScript.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootJar { launchScript() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithNetworkModeNone.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithNetworkModeNone.gradle index d5b5b0113e..5e4309cc35 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithNetworkModeNone.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithNetworkModeNone.gradle @@ -1,3 +1,5 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' @@ -7,8 +9,16 @@ if (project.hasProperty('applyWarPlugin')) { apply plugin: 'war' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithTag.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithTag.gradle index 198699e7fe..2b1d065355 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithTag.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithTag.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithVolumeCaches.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithVolumeCaches.gradle index 75db68229e..5fe8736f59 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithVolumeCaches.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithVolumeCaches.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithWarPackagingAndJarConfiguration.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithWarPackagingAndJarConfiguration.gradle index a9b36a51bc..6a2437cd3b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithWarPackagingAndJarConfiguration.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithWarPackagingAndJarConfiguration.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'war' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWhenCachesAreConfiguredTwice.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWhenCachesAreConfiguredTwice.gradle index 22da9fc0b6..9352033a28 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWhenCachesAreConfiguredTwice.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWhenCachesAreConfiguredTwice.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithBuilderError.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithBuilderError.gradle index cb5cf9966f..153c3f0633 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithBuilderError.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithBuilderError.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithBuildpackNotInBuilder.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithBuildpackNotInBuilder.gradle index f9a98a4343..7a3eef1363 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithBuildpackNotInBuilder.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithBuildpackNotInBuilder.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithInvalidTag.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithInvalidTag.gradle index 3c350dd1fb..c1a13e432a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithInvalidTag.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-failsWithInvalidTag.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.gradle index cf75779cbb..cdff07f202 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.gradle @@ -1,3 +1,5 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' @@ -7,8 +9,16 @@ if (project.hasProperty('applyWarPlugin')) { apply plugin: 'war' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageRegistryIntegrationTests.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageRegistryIntegrationTests.gradle index d6abd1d161..5cd65bf19d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageRegistryIntegrationTests.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageRegistryIntegrationTests.gradle @@ -1,10 +1,20 @@ +import org.gradle.util.GradleVersion + plugins { id 'java' id 'org.springframework.boot' version '{version}' } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' +} +else { + java { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + } +} bootBuildImage { builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle index 9f960fb8d9..70c1fd8810 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle @@ -4,4 +4,6 @@ plugins { id 'org.springframework.boot' version '{version}' } -mainClassName = 'com.example.CustomMain' +application { + mainClass = 'com.example.CustomMain' +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle index f19f5f82bd..3ac0c9b46b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle @@ -4,4 +4,6 @@ plugins { id 'org.springframework.boot' version '{version}' } -mainClassName = 'com.example.CustomMain' +application { + mainClass = 'com.example.CustomMain' +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginMainClassNameIsUsed.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginMainClassNameIsUsed.gradle index 60588fdb37..b83af60352 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginMainClassNameIsUsed.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginMainClassNameIsUsed.gradle @@ -3,4 +3,6 @@ plugins { id 'org.springframework.boot' version '{version}' } -mainClassName = 'com.example.bootrun.main.CustomMainClass' +application { + mainClass = 'com.example.bootrun.main.CustomMainClass' +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleVersions.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleVersions.java index 21a1ff6af3..ed09fd76dd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleVersions.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleVersions.java @@ -34,15 +34,16 @@ public final class GradleVersions { public static List allCompatible() { if (isJava18()) { - return Arrays.asList("7.3.3", GradleVersion.current().getVersion(), "8.0.2", "8.1.1"); + return Arrays.asList("7.3.3", GradleVersion.current().getVersion(), "8.0.2", "8.1.1", "8.2-rc-1"); } if (isJava17()) { - return Arrays.asList("7.2", GradleVersion.current().getVersion(), "8.0.2", "8.1.1"); + return Arrays.asList("7.2", GradleVersion.current().getVersion(), "8.0.2", "8.1.1", "8.2-rc-1"); } if (isJava16()) { - return Arrays.asList("7.0.2", GradleVersion.current().getVersion(), "8.0.2", "8.1.1"); + return Arrays.asList("7.0.2", GradleVersion.current().getVersion(), "8.0.2", "8.1.1", "8.2-rc-1"); } - return Arrays.asList("6.8.3", "6.9.4", "7.0.2", GradleVersion.current().getVersion(), "8.0.2", "8.1.1"); + return Arrays.asList("6.8.3", "6.9.4", "7.0.2", GradleVersion.current().getVersion(), "8.0.2", "8.1.1", + "8.2-rc-1"); } public static String minimumCompatible() {