use of org.gradle.internal.operations.BuildOperationQueue in project gradle by gradle.
the class LibExeStaticLibraryArchiver method execute.
@Override
public WorkResult execute(final StaticLibraryArchiverSpec spec) {
final StaticLibraryArchiverSpec transformedSpec = specTransformer.transform(spec);
final List<String> args = argsTransformer.transform(transformedSpec);
invocationContext.getArgAction().execute(args);
new VisualCppOptionsFileArgsWriter(spec.getTempDir()).execute(args);
final CommandLineToolInvocation invocation = invocationContext.createInvocation("archiving " + spec.getOutputFile().getName(), args, spec.getOperationLogger());
buildOperationProcessor.run(commandLineToolInvocationWorker, new Action<BuildOperationQueue<CommandLineToolInvocation>>() {
@Override
public void execute(BuildOperationQueue<CommandLineToolInvocation> buildQueue) {
buildQueue.setLogLocation(spec.getOperationLogger().getLogLocation());
buildQueue.add(invocation);
}
});
return new SimpleWorkResult(true);
}
use of org.gradle.internal.operations.BuildOperationQueue in project gradle by gradle.
the class NativeCompiler method execute.
@Override
public WorkResult execute(final T spec) {
final T transformedSpec = specTransformer.transform(spec);
final List<String> genericArgs = getArguments(transformedSpec);
final File objectDir = transformedSpec.getObjectFileDir();
buildOperationProcessor.run(commandLineToolInvocationWorker, new Action<BuildOperationQueue<CommandLineToolInvocation>>() {
@Override
public void execute(BuildOperationQueue<CommandLineToolInvocation> buildQueue) {
buildQueue.setLogLocation(spec.getOperationLogger().getLogLocation());
for (File sourceFile : transformedSpec.getSourceFiles()) {
CommandLineToolInvocation perFileInvocation = createPerFileInvocation(genericArgs, sourceFile, objectDir, spec);
buildQueue.add(perFileInvocation);
}
}
});
return new SimpleWorkResult(!transformedSpec.getSourceFiles().isEmpty());
}
use of org.gradle.internal.operations.BuildOperationQueue in project gradle by gradle.
the class Binary2JUnitXmlReportGenerator method generate.
public void generate() {
Timer clock = Time.startTimer();
buildOperationExecutor.run(new RunnableBuildOperation() {
@Override
public void run(BuildOperationContext context) {
File[] oldXmlFiles = testResultsDir.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.startsWith("TEST") && name.endsWith(".xml");
}
});
for (File oldXmlFile : oldXmlFiles) {
GFileUtils.deleteQuietly(oldXmlFile);
}
}
@Override
public BuildOperationDescriptor.Builder description() {
return BuildOperationDescriptor.displayName("Delete old JUnit XML results");
}
});
buildOperationExecutor.runAll(new Action<BuildOperationQueue<JUnitXmlReportFileGenerator>>() {
@Override
public void execute(final BuildOperationQueue<JUnitXmlReportFileGenerator> queue) {
testResultsProvider.visitClasses(new Action<TestClassResult>() {
public void execute(final TestClassResult result) {
final File reportFile = new File(testResultsDir, getReportFileName(result));
queue.add(new JUnitXmlReportFileGenerator(result, reportFile, xmlWriter));
}
});
}
});
LOG.info("Finished generating test XML results ({}) into: {}", clock.getElapsed(), testResultsDir);
}
use of org.gradle.internal.operations.BuildOperationQueue in project gradle by gradle.
the class SwiftLinker method newInvocationAction.
@Override
protected Action<BuildOperationQueue<CommandLineToolInvocation>> newInvocationAction(final LinkerSpec spec, List<String> args) {
final CommandLineToolInvocation invocation = newInvocation("linking " + spec.getOutputFile().getName(), spec.getOutputFile().getParentFile(), args, spec.getOperationLogger());
return new Action<BuildOperationQueue<CommandLineToolInvocation>>() {
@Override
public void execute(BuildOperationQueue<CommandLineToolInvocation> buildQueue) {
buildQueue.setLogLocation(spec.getOperationLogger().getLogLocation());
buildQueue.add(invocation);
}
};
}
use of org.gradle.internal.operations.BuildOperationQueue in project gradle by gradle.
the class GccLinker method newInvocationAction.
@Override
protected Action<BuildOperationQueue<CommandLineToolInvocation>> newInvocationAction(final LinkerSpec spec, List<String> args) {
final CommandLineToolInvocation invocation = newInvocation("linking " + spec.getOutputFile().getName(), args, spec.getOperationLogger());
return new Action<BuildOperationQueue<CommandLineToolInvocation>>() {
@Override
public void execute(BuildOperationQueue<CommandLineToolInvocation> buildQueue) {
buildQueue.setLogLocation(spec.getOperationLogger().getLogLocation());
buildQueue.add(invocation);
}
};
}
Aggregations