Search in sources :

Example 1 with DefaultJavaCompileSpec

use of org.gradle.api.internal.tasks.compile.DefaultJavaCompileSpec in project gradle by gradle.

the class JavaCompile method compile.

@TaskAction
protected void compile(IncrementalTaskInputs inputs) {
    if (!compileOptions.isIncremental()) {
        compile();
        return;
    }
    DefaultJavaCompileSpec spec = createSpec();
    CompileCaches compileCaches = createCompileCaches();
    IncrementalCompilerFactory factory = new IncrementalCompilerFactory(getFileOperations(), getCachingFileHasher(), getPath(), createCompiler(spec), source, compileCaches, (IncrementalTaskInputsInternal) inputs, getEffectiveAnnotationProcessorPath());
    Compiler<JavaCompileSpec> compiler = factory.createCompiler();
    performCompilation(spec, compiler);
}
Also used : DefaultJavaCompileSpec(org.gradle.api.internal.tasks.compile.DefaultJavaCompileSpec) CompileCaches(org.gradle.api.internal.tasks.compile.incremental.cache.CompileCaches) GeneralCompileCaches(org.gradle.api.internal.tasks.compile.incremental.cache.GeneralCompileCaches) JavaCompileSpec(org.gradle.api.internal.tasks.compile.JavaCompileSpec) DefaultJavaCompileSpec(org.gradle.api.internal.tasks.compile.DefaultJavaCompileSpec) IncrementalCompilerFactory(org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory) TaskAction(org.gradle.api.tasks.TaskAction)

Example 2 with DefaultJavaCompileSpec

use of org.gradle.api.internal.tasks.compile.DefaultJavaCompileSpec in project gradle by gradle.

the class JavaCompile method createSpec.

@SuppressWarnings("deprecation")
private DefaultJavaCompileSpec createSpec() {
    final DefaultJavaCompileSpec spec = new DefaultJavaCompileSpecFactory(compileOptions).create();
    spec.setSource(getSource());
    spec.setDestinationDir(getDestinationDir());
    spec.setWorkingDir(getProject().getProjectDir());
    spec.setTempDir(getTemporaryDir());
    spec.setCompileClasspath(ImmutableList.copyOf(getClasspath()));
    spec.setAnnotationProcessorPath(ImmutableList.copyOf(getEffectiveAnnotationProcessorPath()));
    File dependencyCacheDir = DeprecationLogger.whileDisabled(new Factory<File>() {

        @Override
        @SuppressWarnings("deprecation")
        public File create() {
            return getDependencyCacheDir();
        }
    });
    spec.setDependencyCacheDir(dependencyCacheDir);
    spec.setTargetCompatibility(getTargetCompatibility());
    spec.setSourceCompatibility(getSourceCompatibility());
    spec.setCompileOptions(compileOptions);
    return spec;
}
Also used : DefaultJavaCompileSpec(org.gradle.api.internal.tasks.compile.DefaultJavaCompileSpec) DefaultJavaCompileSpecFactory(org.gradle.api.internal.tasks.compile.DefaultJavaCompileSpecFactory) File(java.io.File)

Example 3 with DefaultJavaCompileSpec

use of org.gradle.api.internal.tasks.compile.DefaultJavaCompileSpec in project gradle by gradle.

the class JavaCompile method compile.

@Override
protected void compile() {
    DefaultJavaCompileSpec spec = createSpec();
    performCompilation(spec, createCompiler(spec));
}
Also used : DefaultJavaCompileSpec(org.gradle.api.internal.tasks.compile.DefaultJavaCompileSpec)

Aggregations

DefaultJavaCompileSpec (org.gradle.api.internal.tasks.compile.DefaultJavaCompileSpec)3 File (java.io.File)1 DefaultJavaCompileSpecFactory (org.gradle.api.internal.tasks.compile.DefaultJavaCompileSpecFactory)1 JavaCompileSpec (org.gradle.api.internal.tasks.compile.JavaCompileSpec)1 IncrementalCompilerFactory (org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory)1 CompileCaches (org.gradle.api.internal.tasks.compile.incremental.cache.CompileCaches)1 GeneralCompileCaches (org.gradle.api.internal.tasks.compile.incremental.cache.GeneralCompileCaches)1 TaskAction (org.gradle.api.tasks.TaskAction)1