Search in sources :

Example 1 with SimpleStaleClassCleaner

use of org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner in project gradle by gradle.

the class CleaningPlayToolCompiler method execute.

@Override
public WorkResult execute(T spec) {
    SimpleStaleClassCleaner cleaner = new SimpleStaleClassCleaner(taskOutputs);
    cleaner.setDestinationDir(spec.getDestinationDir());
    cleaner.execute();
    return delegate.execute(spec);
}
Also used : SimpleStaleClassCleaner(org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner)

Example 2 with SimpleStaleClassCleaner

use of org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner in project gradle by gradle.

the class AbstractLinkTask method link.

@TaskAction
public void link() {
    SimpleStaleClassCleaner cleaner = new SimpleStaleClassCleaner(getOutputs());
    cleaner.setDestinationDir(getDestinationDir());
    cleaner.execute();
    if (getSource().isEmpty()) {
        setDidWork(false);
        return;
    }
    LinkerSpec spec = createLinkerSpec();
    spec.setTargetPlatform(getTargetPlatform());
    spec.setTempDir(getTemporaryDir());
    spec.setOutputFile(getOutputFile());
    spec.objectFiles(getSource());
    spec.libraries(getLibs());
    spec.args(getLinkerArgs());
    BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
    spec.setOperationLogger(operationLogger);
    Compiler<LinkerSpec> compiler = Cast.uncheckedCast(toolChain.select(targetPlatform).newCompiler(spec.getClass()));
    compiler = BuildOperationLoggingCompilerDecorator.wrap(compiler);
    WorkResult result = compiler.execute(spec);
    setDidWork(result.getDidWork());
}
Also used : LinkerSpec(org.gradle.nativeplatform.internal.LinkerSpec) BuildOperationLogger(org.gradle.internal.operations.logging.BuildOperationLogger) WorkResult(org.gradle.api.tasks.WorkResult) SimpleStaleClassCleaner(org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner) TaskAction(org.gradle.api.tasks.TaskAction)

Example 3 with SimpleStaleClassCleaner

use of org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner in project gradle by gradle.

the class IncrementalNativeCompiler method cleanPreviousOutputs.

private boolean cleanPreviousOutputs(NativeCompileSpec spec) {
    SimpleStaleClassCleaner cleaner = new SimpleStaleClassCleaner(getTask().getOutputs());
    cleaner.setDestinationDir(spec.getObjectFileDir());
    cleaner.execute();
    return cleaner.getDidWork();
}
Also used : SimpleStaleClassCleaner(org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner)

Example 4 with SimpleStaleClassCleaner

use of org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner in project gradle by gradle.

the class Assemble method assemble.

@TaskAction
public void assemble() {
    BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
    SimpleStaleClassCleaner cleaner = new SimpleStaleClassCleaner(getOutputs());
    cleaner.setDestinationDir(getObjectFileDir());
    cleaner.execute();
    DefaultAssembleSpec spec = new DefaultAssembleSpec();
    spec.setTempDir(getTemporaryDir());
    spec.setObjectFileDir(getObjectFileDir());
    spec.source(getSource());
    spec.args(getAssemblerArgs());
    spec.setOperationLogger(operationLogger);
    Compiler<AssembleSpec> compiler = toolChain.select(targetPlatform).newCompiler(AssembleSpec.class);
    WorkResult result = BuildOperationLoggingCompilerDecorator.wrap(compiler).execute(spec);
    setDidWork(result.getDidWork());
}
Also used : BuildOperationLogger(org.gradle.internal.operations.logging.BuildOperationLogger) AssembleSpec(org.gradle.nativeplatform.toolchain.internal.compilespec.AssembleSpec) DefaultAssembleSpec(org.gradle.language.assembler.internal.DefaultAssembleSpec) DefaultAssembleSpec(org.gradle.language.assembler.internal.DefaultAssembleSpec) WorkResult(org.gradle.api.tasks.WorkResult) SimpleStaleClassCleaner(org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner) TaskAction(org.gradle.api.tasks.TaskAction)

Example 5 with SimpleStaleClassCleaner

use of org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner in project gradle by gradle.

the class JavaScriptMinify method compileJavaScriptSources.

@TaskAction
void compileJavaScriptSources() {
    StaleClassCleaner cleaner = new SimpleStaleClassCleaner(getOutputs());
    cleaner.setDestinationDir(getDestinationDir());
    cleaner.execute();
    MinifyFileVisitor visitor = new MinifyFileVisitor();
    getSource().visit(visitor);
    JavaScriptCompileSpec spec = new DefaultJavaScriptCompileSpec(visitor.relativeFiles, getDestinationDir(), getForkOptions());
    getCompiler().execute(spec);
}
Also used : SimpleStaleClassCleaner(org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner) StaleClassCleaner(org.gradle.language.base.internal.tasks.StaleClassCleaner) SimpleStaleClassCleaner(org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner) DefaultJavaScriptCompileSpec(org.gradle.play.internal.javascript.DefaultJavaScriptCompileSpec) JavaScriptCompileSpec(org.gradle.play.internal.javascript.JavaScriptCompileSpec) DefaultJavaScriptCompileSpec(org.gradle.play.internal.javascript.DefaultJavaScriptCompileSpec) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

SimpleStaleClassCleaner (org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner)7 TaskAction (org.gradle.api.tasks.TaskAction)3 StaleClassCleaner (org.gradle.language.base.internal.tasks.StaleClassCleaner)3 WorkResult (org.gradle.api.tasks.WorkResult)2 BuildOperationLogger (org.gradle.internal.operations.logging.BuildOperationLogger)2 DefaultAssembleSpec (org.gradle.language.assembler.internal.DefaultAssembleSpec)1 LinkerSpec (org.gradle.nativeplatform.internal.LinkerSpec)1 AssembleSpec (org.gradle.nativeplatform.toolchain.internal.compilespec.AssembleSpec)1 DefaultJavaScriptCompileSpec (org.gradle.play.internal.javascript.DefaultJavaScriptCompileSpec)1 JavaScriptCompileSpec (org.gradle.play.internal.javascript.JavaScriptCompileSpec)1