use of org.gradle.plugins.javascript.coffeescript.compile.internal.CoffeeScriptCompileDestinationCalculator in project gradle by gradle.
the class CoffeeScriptCompilerWorker method process.
public void process(SerializableCoffeeScriptCompileSpec spec) {
Scriptable coffeeScriptScope = parse(spec.getCoffeeScriptJs(), "UTF-8", new Action<Context>() {
public void execute(Context context) {
context.setOptimizationLevel(-1);
}
});
String encoding = spec.getOptions().getEncoding();
CoffeeScriptCompileDestinationCalculator destinationCalculator = new CoffeeScriptCompileDestinationCalculator(spec.getDestinationDir());
for (RelativeFile target : spec.getSource()) {
String source = readFile(target.getFile(), encoding);
String output = compile(coffeeScriptScope, source, target.getRelativePath().getPathString());
writeFile(output, destinationCalculator.transform(target.getRelativePath()), encoding);
}
}
Aggregations