Search in sources :

Example 1 with CurrentJvmJavaToolChain

use of org.gradle.api.internal.tasks.CurrentJvmJavaToolChain in project gradle by gradle.

the class JavaCompile method getToolChain.

/**
     * Returns the tool chain that will be used to compile the Java source.
     *
     * @return The tool chain.
     */
@Nested
@Incubating
public JavaToolChain getToolChain() {
    if (getOptions().isFork()) {
        ForkOptions forkOptions = getOptions().getForkOptions();
        File javaHome = forkOptions.getJavaHome();
        if (javaHome != null) {
            return new JavaHomeBasedJavaToolChain(javaHome, getJavaCompilerFactory(), getExecActionFactory(), getJvmVersionDetector());
        }
    }
    return new CurrentJvmJavaToolChain(getJavaCompilerFactory(), getExecActionFactory());
}
Also used : CurrentJvmJavaToolChain(org.gradle.api.internal.tasks.CurrentJvmJavaToolChain) File(java.io.File) JavaHomeBasedJavaToolChain(org.gradle.api.internal.tasks.JavaHomeBasedJavaToolChain) Nested(org.gradle.api.tasks.Nested) Incubating(org.gradle.api.Incubating)

Aggregations

File (java.io.File)1 Incubating (org.gradle.api.Incubating)1 CurrentJvmJavaToolChain (org.gradle.api.internal.tasks.CurrentJvmJavaToolChain)1 JavaHomeBasedJavaToolChain (org.gradle.api.internal.tasks.JavaHomeBasedJavaToolChain)1 Nested (org.gradle.api.tasks.Nested)1