|
|
|
@ -17,7 +17,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;
|
|
|
|
@ -56,7 +55,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 +70,9 @@ 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) {
|
|
|
|
|
project.getTasks().withType(Test.class,
|
|
|
|
|
(test) -> test.jvmArgs(toolchain.getTestJvmArgs().getOrElse(Collections.emptyList())));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|