use of org.gradle.internal.operations.logging.BuildOperationLogger in project gradle by gradle.
the class AbstractNativeCompileTask method compile.
@TaskAction
public void compile(IncrementalTaskInputs inputs) {
BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
NativeCompileSpec spec = createCompileSpec();
spec.setTargetPlatform(targetPlatform.get());
spec.setTempDir(getTemporaryDir());
spec.setObjectFileDir(objectFileDir.get().getAsFile());
spec.include(includes);
spec.source(getSource());
spec.setMacros(getMacros());
spec.args(getCompilerArgs().get());
spec.setPositionIndependentCode(isPositionIndependentCode());
spec.setDebuggable(isDebuggable());
spec.setOptimized(isOptimized());
spec.setIncrementalCompile(inputs.isIncremental());
spec.setOperationLogger(operationLogger);
configureSpec(spec);
NativeToolChainInternal nativeToolChain = (NativeToolChainInternal) toolChain.get();
NativePlatformInternal nativePlatform = (NativePlatformInternal) targetPlatform.get();
PlatformToolProvider platformToolProvider = nativeToolChain.select(nativePlatform);
setDidWork(doCompile(spec, platformToolProvider).getDidWork());
}
use of org.gradle.internal.operations.logging.BuildOperationLogger in project gradle by gradle.
the class WindowsResourceCompile method compile.
@TaskAction
public void compile(IncrementalTaskInputs inputs) {
BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
NativeCompileSpec spec = new DefaultWindowsResourceCompileSpec();
spec.setTempDir(getTemporaryDir());
spec.setObjectFileDir(getOutputDir());
spec.include(getIncludes());
spec.source(getSource());
spec.setMacros(getMacros());
spec.args(getCompilerArgs());
spec.setIncrementalCompile(inputs.isIncremental());
spec.setOperationLogger(operationLogger);
NativeToolChainInternal nativeToolChain = (NativeToolChainInternal) toolChain.get();
NativePlatformInternal nativePlatform = (NativePlatformInternal) targetPlatform.get();
PlatformToolProvider platformToolProvider = nativeToolChain.select(nativePlatform);
WorkResult result = doCompile(spec, platformToolProvider);
setDidWork(result.getDidWork());
}
use of org.gradle.internal.operations.logging.BuildOperationLogger in project gradle by gradle.
the class WindowsResourceCompile method compile.
@TaskAction
public void compile(InputChanges inputs) {
BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
NativeCompileSpec spec = new DefaultWindowsResourceCompileSpec();
spec.setTempDir(getTemporaryDir());
spec.setObjectFileDir(getOutputDir());
spec.include(getIncludes());
spec.source(getSource());
spec.setMacros(getMacros());
spec.args(getCompilerArgs().get());
spec.setIncrementalCompile(inputs.isIncremental());
spec.setOperationLogger(operationLogger);
NativeToolChainInternal nativeToolChain = (NativeToolChainInternal) toolChain.get();
NativePlatformInternal nativePlatform = (NativePlatformInternal) targetPlatform.get();
PlatformToolProvider platformToolProvider = nativeToolChain.select(nativePlatform);
WorkResult result = doCompile(spec, platformToolProvider);
setDidWork(result.getDidWork());
}
use of org.gradle.internal.operations.logging.BuildOperationLogger in project gradle by gradle.
the class SwiftCompile method compile.
@TaskAction
protected void compile(InputChanges inputs) {
final List<File> removedFiles = Lists.newArrayList();
final Set<File> changedFiles = Sets.newHashSet();
boolean isIncremental = inputs.isIncremental();
// which files changed .
if (isIncremental) {
for (FileChange fileChange : inputs.getFileChanges(getSource())) {
if (fileChange.getChangeType() == ChangeType.REMOVED) {
removedFiles.add(fileChange.getFile());
} else {
changedFiles.add(fileChange.getFile());
}
}
}
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, deleter);
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 AbstractLinkTask method link.
@TaskAction
protected void link() {
boolean cleanedOutputs = StaleOutputCleaner.cleanOutputs(getDeleter(), getOutputs().getPreviousOutputFiles(), getDestinationDirectory().get().getAsFile());
if (getSource().isEmpty()) {
setDidWork(cleanedOutputs);
return;
}
LinkerSpec spec = createLinkerSpec();
spec.setTargetPlatform(getTargetPlatform().get());
spec.setTempDir(getTemporaryDir());
spec.setOutputFile(getLinkedFile().get().getAsFile());
spec.objectFiles(getSource());
spec.libraries(getLibs());
spec.args(getLinkerArgs().get());
spec.setDebuggable(getDebuggable().get());
BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
spec.setOperationLogger(operationLogger);
Compiler<LinkerSpec> compiler = createCompiler();
compiler = BuildOperationLoggingCompilerDecorator.wrap(compiler);
WorkResult result = compiler.execute(spec);
setDidWork(result.getDidWork() || cleanedOutputs);
}
Aggregations