Search in sources :

Example 1 with ForkOptions

use of org.gradle.api.tasks.compile.ForkOptions in project gradle by gradle.

the class CommandLineJavaCompiler method execute.

@Override
public WorkResult execute(JavaCompileSpec spec) {
    final ForkOptions forkOptions = spec.getCompileOptions().getForkOptions();
    String executable = forkOptions.getJavaHome() != null ? Jvm.forHome(forkOptions.getJavaHome()).getJavacExecutable().getAbsolutePath() : getExecutable(forkOptions);
    LOGGER.info("Compiling with Java command line compiler '{}'.", executable);
    ExecHandle handle = createCompilerHandle(executable, spec);
    executeCompiler(handle);
    return new SimpleWorkResult(true);
}
Also used : ForkOptions(org.gradle.api.tasks.compile.ForkOptions) SimpleWorkResult(org.gradle.api.internal.tasks.SimpleWorkResult) ExecHandle(org.gradle.process.internal.ExecHandle)

Aggregations

SimpleWorkResult (org.gradle.api.internal.tasks.SimpleWorkResult)1 ForkOptions (org.gradle.api.tasks.compile.ForkOptions)1 ExecHandle (org.gradle.process.internal.ExecHandle)1