use of org.gradle.api.internal.tasks.compile.MinimalGroovyCompileOptions in project gradle by gradle.
the class GroovyCompile method createSpec.
private GroovyJavaJointCompileSpec createSpec() {
validateConfiguration();
DefaultGroovyJavaJointCompileSpec spec = new DefaultGroovyJavaJointCompileSpecFactory(compileOptions, getToolchain()).create();
assert spec != null;
FileTreeInternal stableSourcesAsFileTree = (FileTreeInternal) getStableSources().getAsFileTree();
List<File> sourceRoots = CompilationSourceDirs.inferSourceRoots(stableSourcesAsFileTree);
spec.setSourcesRoots(sourceRoots);
spec.setSourceFiles(stableSourcesAsFileTree);
spec.setDestinationDir(getDestinationDirectory().getAsFile().get());
spec.setWorkingDir(getProjectLayout().getProjectDirectory().getAsFile());
spec.setTempDir(getTemporaryDir());
spec.setCompileClasspath(ImmutableList.copyOf(determineGroovyCompileClasspath()));
configureCompatibilityOptions(spec);
spec.setAnnotationProcessorPath(Lists.newArrayList(compileOptions.getAnnotationProcessorPath() == null ? getProjectLayout().files() : compileOptions.getAnnotationProcessorPath()));
spec.setGroovyClasspath(Lists.newArrayList(getGroovyClasspath()));
spec.setCompileOptions(compileOptions);
spec.setGroovyCompileOptions(new MinimalGroovyCompileOptions(groovyCompileOptions));
spec.getCompileOptions().setSupportsCompilerApi(true);
if (getOptions().isIncremental()) {
validateIncrementalCompilationOptions(sourceRoots, spec.annotationProcessingConfigured());
spec.getCompileOptions().setPreviousCompilationDataFile(getPreviousCompilationData());
}
if (spec.getGroovyCompileOptions().getStubDir() == null) {
File dir = new File(getTemporaryDir(), "groovy-java-stubs");
GFileUtils.mkdirs(dir);
spec.getGroovyCompileOptions().setStubDir(dir);
}
configureExecutable(spec.getCompileOptions().getForkOptions());
return spec;
}
Aggregations