use of org.gradle.api.internal.tasks.SimpleWorkResult in project gradle by gradle.
the class GoogleClosureCompiler method execute.
@Override
public WorkResult execute(JavaScriptCompileSpec spec) {
JavaScriptCompileDestinationCalculator destinationCalculator = new JavaScriptCompileDestinationCalculator(spec.getDestinationDir());
List<String> allErrors = Lists.newArrayList();
for (RelativeFile sourceFile : spec.getSources()) {
allErrors.addAll(compile(sourceFile, spec, destinationCalculator));
}
if (allErrors.isEmpty()) {
return new SimpleWorkResult(true);
} else {
throw new SourceTransformationException(String.format("Minification failed with the following errors:\n\t%s", StringUtils.join(allErrors, "\n\t")), null);
}
}
use of org.gradle.api.internal.tasks.SimpleWorkResult in project gradle by gradle.
the class ArStaticLibraryArchiver method execute.
@Override
public WorkResult execute(final StaticLibraryArchiverSpec spec) {
deletePreviousOutput(spec);
List<String> args = argsTransformer.transform(spec);
invocationContext.getArgAction().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.api.internal.tasks.SimpleWorkResult in project gradle by gradle.
the class LinkExeLinker method execute.
@Override
public WorkResult execute(final LinkerSpec spec) {
LinkerSpec transformedSpec = specTransformer.transform(spec);
List<String> args = argsTransformer.transform(transformedSpec);
invocationContext.getArgAction().execute(args);
new VisualCppOptionsFileArgsWriter(spec.getTempDir()).execute(args);
final CommandLineToolInvocation invocation = invocationContext.createInvocation("linking " + 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.api.internal.tasks.SimpleWorkResult in project gradle by gradle.
the class GccLinker method execute.
@Override
public WorkResult execute(final LinkerSpec spec) {
List<String> args = argsTransformer.transform(spec);
invocationContext.getArgAction().execute(args);
if (useCommandFile) {
new GccOptionsFileArgsWriter(spec.getTempDir()).execute(args);
}
final CommandLineToolInvocation invocation = invocationContext.createInvocation("linking " + 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.api.internal.tasks.SimpleWorkResult in project gradle by gradle.
the class TarCopyAction method execute.
public WorkResult execute(final CopyActionProcessingStream stream) {
final OutputStream outStr;
try {
outStr = compressor.createArchiveOutputStream(tarFile);
} catch (Exception e) {
throw new GradleException(String.format("Could not create TAR '%s'.", tarFile), e);
}
IoActions.withResource(outStr, new ErroringAction<OutputStream>() {
@Override
protected void doExecute(final OutputStream outStr) throws Exception {
TarOutputStream tarOutStr;
try {
tarOutStr = new TarOutputStream(outStr);
} catch (Exception e) {
throw new GradleException(String.format("Could not create TAR '%s'.", tarFile), e);
}
tarOutStr.setLongFileMode(TarOutputStream.LONGFILE_GNU);
stream.process(new StreamAction(tarOutStr));
tarOutStr.close();
}
});
return new SimpleWorkResult(true);
}
Aggregations