use of org.gradle.play.internal.twirl.TwirlCompileSpec in project gradle by gradle.
the class TwirlCompile method compile.
@TaskAction
void compile(IncrementalTaskInputs inputs) {
RelativeFileCollector relativeFileCollector = new RelativeFileCollector();
getSource().visit(relativeFileCollector);
TwirlCompileSpec spec = new DefaultTwirlCompileSpec(relativeFileCollector.relativeFiles, getOutputDirectory(), getForkOptions(), getDefaultImports(), userTemplateFormats, additionalImports);
if (!inputs.isIncremental()) {
new CleaningPlayToolCompiler<TwirlCompileSpec>(getCompiler(), getOutputs()).execute(spec);
} else {
final Set<File> sourcesToCompile = new HashSet<File>();
inputs.outOfDate(new Action<InputFileDetails>() {
public void execute(InputFileDetails inputFileDetails) {
sourcesToCompile.add(inputFileDetails.getFile());
}
});
final Set<File> staleOutputFiles = new HashSet<File>();
inputs.removed(new Action<InputFileDetails>() {
public void execute(InputFileDetails inputFileDetails) {
staleOutputFiles.add(inputFileDetails.getFile());
}
});
if (cleaner == null) {
cleaner = new TwirlStaleOutputCleaner(getOutputDirectory());
}
cleaner.execute(staleOutputFiles);
getCompiler().execute(spec);
}
}
Aggregations