|
|
|
@ -16,9 +16,6 @@
|
|
|
|
|
|
|
|
|
|
package org.springframework.boot.build.toolchain;
|
|
|
|
|
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import org.gradle.api.Plugin;
|
|
|
|
|
import org.gradle.api.Project;
|
|
|
|
|
import org.gradle.api.plugins.JavaPluginExtension;
|
|
|
|
@ -56,7 +53,7 @@ public class ToolchainPlugin implements Plugin<Project> {
|
|
|
|
|
JavaToolchainSpec toolchainSpec = project.getExtensions().getByType(JavaPluginExtension.class)
|
|
|
|
|
.getToolchain();
|
|
|
|
|
toolchainSpec.getLanguageVersion().set(toolchain.getJavaVersion());
|
|
|
|
|
configureTestToolchain(project);
|
|
|
|
|
configureTestToolchain(project, toolchain);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -71,11 +68,11 @@ public class ToolchainPlugin implements Plugin<Project> {
|
|
|
|
|
project.getTasks().withType(Test.class, (task) -> task.setEnabled(false));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void configureTestToolchain(Project project) {
|
|
|
|
|
project.getTasks().withType(Test.class, (test) -> {
|
|
|
|
|
List<String> arguments = Collections.singletonList("--illegal-access=warn");
|
|
|
|
|
test.jvmArgs(arguments);
|
|
|
|
|
});
|
|
|
|
|
private void configureTestToolchain(Project project, ToolchainExtension toolchain) {
|
|
|
|
|
if (!toolchain.getTestJvmArgs().isPresent()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
project.getTasks().withType(Test.class, (test) -> test.jvmArgs(toolchain.getTestJvmArgs().get()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|