Package org.gradle.play.internal.twirl

Examples of org.gradle.play.internal.twirl.TwirlCompileSpec


    @TaskAction
    void compile(IncrementalTaskInputs inputs) {
        String compilerVersion = detectCompilerVersion();
        if (!inputs.isIncremental()) {
            TwirlCompileSpec spec = generateSpec(getSource().getFiles(), compilerVersion);
            if(compiler==null){
                compiler = new CleaningPlayToolCompiler<TwirlCompileSpec>(getCompiler(spec), getOutputs());
            }
            compiler.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);
            TwirlCompileSpec spec = generateSpec(sourcesToCompile, compilerVersion);
            getCompiler(spec).execute(spec);
        }
    }
View Full Code Here


        }
        return compiler;
    }

    private TwirlCompileSpec generateSpec(Set<File> sourceFiles, String compilerClassName) {
        return new TwirlCompileSpec(getSourceDirectory(), sourceFiles, getCompilerClasspath().getFiles(), getOutputDirectory(), compilerClassName, fork);
    }
View Full Code Here

TOP

Related Classes of org.gradle.play.internal.twirl.TwirlCompileSpec

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.