Search in sources :

Example 1 with JavaToolchainSpec

use of org.gradle.jvm.toolchain.JavaToolchainSpec in project spring-boot by spring-projects.

the class ToolchainPlugin method configure.

private void configure(Project project, ToolchainExtension toolchain) {
    if (!isJavaVersionSupported(toolchain, toolchain.getJavaVersion())) {
        disableToolchainTasks(project);
    } else {
        JavaToolchainSpec toolchainSpec = project.getExtensions().getByType(JavaPluginExtension.class).getToolchain();
        toolchainSpec.getLanguageVersion().set(toolchain.getJavaVersion());
        configureTestToolchain(project, toolchain);
    }
}
Also used : JavaToolchainSpec(org.gradle.jvm.toolchain.JavaToolchainSpec) JavaPluginExtension(org.gradle.api.plugins.JavaPluginExtension)

Example 2 with JavaToolchainSpec

use of org.gradle.jvm.toolchain.JavaToolchainSpec in project spring-boot by spring-projects.

the class JavaPluginAction method configureToolchainConvention.

private void configureToolchainConvention(Project project, BootRun run) {
    JavaToolchainSpec toolchain = project.getExtensions().getByType(JavaPluginExtension.class).getToolchain();
    JavaToolchainService toolchainService = project.getExtensions().getByType(JavaToolchainService.class);
    run.getJavaLauncher().convention(toolchainService.launcherFor(toolchain));
}
Also used : JavaToolchainSpec(org.gradle.jvm.toolchain.JavaToolchainSpec) JavaPluginExtension(org.gradle.api.plugins.JavaPluginExtension) JavaToolchainService(org.gradle.jvm.toolchain.JavaToolchainService)

Aggregations

JavaPluginExtension (org.gradle.api.plugins.JavaPluginExtension)2 JavaToolchainSpec (org.gradle.jvm.toolchain.JavaToolchainSpec)2 JavaToolchainService (org.gradle.jvm.toolchain.JavaToolchainService)1