use of org.gradle.plugins.javascript.base.SourceTransformationException 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);
}
}
Aggregations