use of org.gradle.internal.operations.logging.BuildOperationLogger in project gradle by gradle.
the class ExtractSymbols method extractSymbols.
// TODO: Need to track version/implementation of symbol extraction tool.
@TaskAction
protected void extractSymbols() {
BuildOperationLogger operationLogger = getServices().get(BuildOperationLoggerFactory.class).newOperationLogger(getName(), getTemporaryDir());
SymbolExtractorSpec spec = new DefaultSymbolExtractorSpec();
spec.setBinaryFile(binaryFile.get().getAsFile());
spec.setSymbolFile(symbolFile.get().getAsFile());
spec.setOperationLogger(operationLogger);
Compiler<SymbolExtractorSpec> symbolExtractor = createCompiler();
symbolExtractor = BuildOperationLoggingCompilerDecorator.wrap(symbolExtractor);
WorkResult result = symbolExtractor.execute(spec);
setDidWork(result.getDidWork());
}
use of org.gradle.internal.operations.logging.BuildOperationLogger in project gradle by gradle.
the class Assemble method assemble.
@TaskAction
public void assemble() {
BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
boolean cleanedOutputs = StaleOutputCleaner.cleanOutputs(getDeleter(), getOutputs().getPreviousOutputFiles(), getObjectFileDir());
DefaultAssembleSpec spec = new DefaultAssembleSpec();
spec.setTempDir(getTemporaryDir());
spec.setObjectFileDir(getObjectFileDir());
spec.source(getSource());
spec.include(getIncludes());
spec.args(getAssemblerArgs());
spec.setOperationLogger(operationLogger);
NativeToolChainInternal nativeToolChain = (NativeToolChainInternal) toolChain.get();
NativePlatformInternal nativePlatform = (NativePlatformInternal) targetPlatform.get();
Compiler<AssembleSpec> compiler = nativeToolChain.select(nativePlatform).newCompiler(AssembleSpec.class);
WorkResult result = BuildOperationLoggingCompilerDecorator.wrap(compiler).execute(spec);
setDidWork(result.getDidWork() || cleanedOutputs);
}
use of org.gradle.internal.operations.logging.BuildOperationLogger in project gradle by gradle.
the class SwiftCompile method compile.
@TaskAction
void compile(IncrementalTaskInputs inputs) {
final List<File> removedFiles = Lists.newArrayList();
final Set<File> changedFiles = Sets.newHashSet();
boolean isIncremental = inputs.isIncremental();
// which files changed and marking the compilation incremental or not.
if (isIncremental) {
inputs.outOfDate(new Action<InputFileDetails>() {
@Override
public void execute(InputFileDetails inputFileDetails) {
if (inputFileDetails.isModified()) {
changedFiles.add(inputFileDetails.getFile());
}
}
});
inputs.removed(new Action<InputFileDetails>() {
@Override
public void execute(InputFileDetails removed) {
removedFiles.add(removed.getFile());
}
});
Set<File> allSourceFiles = getSource().getFiles();
if (!allSourceFiles.containsAll(changedFiles)) {
// If a non-source file changed, the compilation cannot be incremental
// due to the way the Swift compiler detects changes from other modules
isIncremental = false;
}
}
BuildOperationLogger operationLogger = getServices().get(BuildOperationLoggerFactory.class).newOperationLogger(getName(), getTemporaryDir());
NativePlatformInternal targetPlatform = Cast.cast(NativePlatformInternal.class, this.targetPlatform.get());
SwiftCompileSpec spec = createSpec(operationLogger, isIncremental, changedFiles, removedFiles, targetPlatform);
Compiler<SwiftCompileSpec> baseCompiler = new IncrementalSwiftCompiler(createCompiler(), getOutputs(), compilerOutputFileNamingSchemeFactory);
Compiler<SwiftCompileSpec> loggingCompiler = BuildOperationLoggingCompilerDecorator.wrap(baseCompiler);
WorkResult result = loggingCompiler.execute(spec);
setDidWork(result.getDidWork());
}
use of org.gradle.internal.operations.logging.BuildOperationLogger in project gradle by gradle.
the class StripSymbols method stripSymbols.
// TODO: Need to track version/implementation of symbol strip tool.
@TaskAction
protected 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());
}
use of org.gradle.internal.operations.logging.BuildOperationLogger in project gradle by gradle.
the class CreateStaticLibrary method link.
// TODO: Need to track version/implementation of ar tool.
@TaskAction
protected 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());
}
Aggregations