Search in sources :

Example 1 with GroovyCompileOptions

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

the class GroovyCompilerFactory method newCompiler.

@Override
public Compiler<GroovyJavaJointCompileSpec> newCompiler(GroovyJavaJointCompileSpec spec) {
    GroovyCompileOptions groovyOptions = spec.getGroovyCompileOptions();
    Compiler<JavaCompileSpec> javaCompiler = javaCompilerFactory.createForJointCompilation(spec.getClass());
    Compiler<GroovyJavaJointCompileSpec> groovyCompiler = new ApiGroovyCompiler(javaCompiler);
    WorkerFactory workerFactory;
    if (groovyOptions.isFork()) {
        workerFactory = workerDaemonFactory;
    } else {
        workerFactory = inProcessWorkerFactory;
    }
    groovyCompiler = new DaemonGroovyCompiler(project.getRootProject().getProjectDir(), groovyCompiler, project.getServices().get(ClassPathRegistry.class), workerFactory);
    return new NormalizingGroovyCompiler(groovyCompiler);
}
Also used : DaemonGroovyCompiler(org.gradle.api.internal.tasks.compile.daemon.DaemonGroovyCompiler) GroovyCompileOptions(org.gradle.api.tasks.compile.GroovyCompileOptions) InProcessWorkerFactory(org.gradle.workers.internal.InProcessWorkerFactory) WorkerFactory(org.gradle.workers.internal.WorkerFactory)

Aggregations

DaemonGroovyCompiler (org.gradle.api.internal.tasks.compile.daemon.DaemonGroovyCompiler)1 GroovyCompileOptions (org.gradle.api.tasks.compile.GroovyCompileOptions)1 InProcessWorkerFactory (org.gradle.workers.internal.InProcessWorkerFactory)1 WorkerFactory (org.gradle.workers.internal.WorkerFactory)1