Search in sources :

Example 16 with WorkResult

use of org.gradle.api.tasks.WorkResult in project gradle by gradle.

the class CreateStaticLibrary method link.

// TODO: Need to track version/implementation of ar tool.
@TaskAction
public void link() {
    StaticLibraryArchiverSpec spec = new DefaultStaticLibraryArchiverSpec();
    spec.setTempDir(getTemporaryDir());
    spec.setOutputFile(getOutputFile().get().getAsFile());
    spec.objectFiles(getSource());
    spec.args(getStaticLibArgs().get());
    BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
    spec.setOperationLogger(operationLogger);
    Compiler<StaticLibraryArchiverSpec> compiler = createCompiler();
    WorkResult result = BuildOperationLoggingCompilerDecorator.wrap(compiler).execute(spec);
    setDidWork(result.getDidWork());
}
Also used : DefaultStaticLibraryArchiverSpec(org.gradle.nativeplatform.internal.DefaultStaticLibraryArchiverSpec) StaticLibraryArchiverSpec(org.gradle.nativeplatform.internal.StaticLibraryArchiverSpec) DefaultStaticLibraryArchiverSpec(org.gradle.nativeplatform.internal.DefaultStaticLibraryArchiverSpec) BuildOperationLogger(org.gradle.internal.operations.logging.BuildOperationLogger) WorkResult(org.gradle.api.tasks.WorkResult) TaskAction(org.gradle.api.tasks.TaskAction)

Example 17 with WorkResult

use of org.gradle.api.tasks.WorkResult in project gradle by gradle.

the class StripSymbols method stripSymbols.

// TODO: Need to track version/implementation of symbol strip tool.
@TaskAction
public void stripSymbols() {
    BuildOperationLogger operationLogger = getServices().get(BuildOperationLoggerFactory.class).newOperationLogger(getName(), getTemporaryDir());
    StripperSpec spec = new DefaultStripperSpec();
    spec.setBinaryFile(binaryFile.get().getAsFile());
    spec.setOutputFile(outputFile.get().getAsFile());
    spec.setOperationLogger(operationLogger);
    Compiler<StripperSpec> symbolStripper = createCompiler();
    symbolStripper = BuildOperationLoggingCompilerDecorator.wrap(symbolStripper);
    WorkResult result = symbolStripper.execute(spec);
    setDidWork(result.getDidWork());
}
Also used : BuildOperationLoggerFactory(org.gradle.internal.operations.logging.BuildOperationLoggerFactory) BuildOperationLogger(org.gradle.internal.operations.logging.BuildOperationLogger) DefaultStripperSpec(org.gradle.nativeplatform.internal.DefaultStripperSpec) StripperSpec(org.gradle.nativeplatform.internal.StripperSpec) WorkResult(org.gradle.api.tasks.WorkResult) DefaultStripperSpec(org.gradle.nativeplatform.internal.DefaultStripperSpec) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

WorkResult (org.gradle.api.tasks.WorkResult)17 TaskAction (org.gradle.api.tasks.TaskAction)8 BuildOperationLogger (org.gradle.internal.operations.logging.BuildOperationLogger)7 BuildOperationLoggerFactory (org.gradle.internal.operations.logging.BuildOperationLoggerFactory)3 NativePlatformInternal (org.gradle.nativeplatform.platform.internal.NativePlatformInternal)3 RelativePath (org.gradle.api.file.RelativePath)2 CopyActionProcessingStreamAction (org.gradle.api.internal.file.CopyActionProcessingStreamAction)2 SimpleStaleClassCleaner (org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner)2 NativeToolChainInternal (org.gradle.nativeplatform.toolchain.internal.NativeToolChainInternal)2 File (java.io.File)1 HashSet (java.util.HashSet)1 FileTree (org.gradle.api.file.FileTree)1 MinimalFileTree (org.gradle.api.internal.file.collections.MinimalFileTree)1 DefaultGroovyJavaJointCompileSpec (org.gradle.api.internal.tasks.compile.DefaultGroovyJavaJointCompileSpec)1 OutputFile (org.gradle.api.tasks.OutputFile)1 InputFileDetails (org.gradle.api.tasks.incremental.InputFileDetails)1 PatternFilterable (org.gradle.api.tasks.util.PatternFilterable)1 PatternSet (org.gradle.api.tasks.util.PatternSet)1 DefaultAssembleSpec (org.gradle.language.assembler.internal.DefaultAssembleSpec)1 DefaultWindowsResourceCompileSpec (org.gradle.language.rc.internal.DefaultWindowsResourceCompileSpec)1