use of org.gradle.internal.operations.RunnableBuildOperation in project gradle by gradle.
the class RuntimeShadedJarFactory method get.
public File get(final RuntimeShadedJarType type, final Collection<? extends File> classpath) {
final File jarFile = cache.get(type.getIdentifier(), new Action<File>() {
@Override
public void execute(final File file) {
buildOperationExecutor.run(new RunnableBuildOperation() {
@Override
public void run(BuildOperationContext context) {
RuntimeShadedJarCreator creator = new RuntimeShadedJarCreator(progressLoggerFactory, new ImplementationDependencyRelocator(type), directoryFileTreeFactory);
creator.create(file, classpath);
}
@Override
public BuildOperationDescriptor.Builder description() {
String displayName = "Generating Jar " + file.getName();
return BuildOperationDescriptor.displayName(displayName).progressDisplayName(displayName);
}
});
}
});
LOGGER.debug("Using Gradle runtime shaded JAR file: {}", jarFile);
return jarFile;
}
use of org.gradle.internal.operations.RunnableBuildOperation 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);
}
Aggregations