public <T extends CompileSpec> Compiler<T> newCompiler(Class<T> spec) {
   if (TwirlCompileSpec.class.isAssignableFrom(spec)) {
     TwirlCompiler twirlCompiler = TwirlCompilerFactory.create(targetPlatform);
     return cast(
         new DaemonPlayCompiler<TwirlCompileSpec>(
             fileResolver.resolve("."),
             twirlCompiler,
             compilerDaemonManager,
             twirlClasspath,
             twirlCompiler.getClassLoaderPackages()));
   } else if (RoutesCompileSpec.class.isAssignableFrom(spec)) {
     RoutesCompiler routesCompiler = RoutesCompilerFactory.create(targetPlatform);
     return cast(
         new DaemonPlayCompiler<RoutesCompileSpec>(
             fileResolver.resolve("."),
             routesCompiler,
             compilerDaemonManager,
             routesClasspath,
             routesCompiler.getClassLoaderPackages()));
   } else if (JavaScriptCompileSpec.class.isAssignableFrom(spec)) {
     GoogleClosureCompiler javaScriptCompiler = new GoogleClosureCompiler();
     return cast(
         new DaemonPlayCompiler<JavaScriptCompileSpec>(
             fileResolver.resolve("."),
             javaScriptCompiler,
             compilerDaemonManager,
             javaScriptClasspath,
             javaScriptCompiler.getClassLoaderPackages()));
   }
   throw new IllegalArgumentException(
       String.format(
           "Cannot create Compiler for unsupported CompileSpec type '%s'", spec.getSimpleName()));
 }
 public File getDir() {
   if (dir == null) {
     throw new InvalidUserDataException(
         "A base directory must be specified in the task or via a method argument!");
   }
   return resolver.resolve(dir);
 }
 private void applyScript(Object script) {
   URI scriptUri = resolver.resolveUri(script);
   UriScriptSource scriptSource = new UriScriptSource("script", scriptUri);
   ClassLoaderScope classLoaderScopeChild = classLoaderScope.createChild();
   ScriptHandler scriptHandler = scriptHandlerFactory.create(scriptSource, classLoaderScopeChild);
   ScriptPlugin configurer =
       configurerFactory.create(
           scriptSource,
           scriptHandler,
           classLoaderScopeChild,
           classLoaderScope,
           "buildscript",
           DefaultScript.class,
           false);
   for (Object target : targets) {
     configurer.apply(target);
   }
 }
Пример #4
0
 /**
  * The file the descriptor will be written to.
  *
  * @return The file the descriptor will be written to
  */
 @OutputFile
 public File getDestination() {
   return destination == null ? null : fileResolver.resolve(destination);
 }
 public URI getUrl() {
   return baseUrl == null ? null : fileResolver.resolveUri(baseUrl);
 }
Пример #6
0
 public FileTree getSource() {
   return resolver.resolveFilesAsTree(sourcePaths).matching(getPatternSet());
 }
Пример #7
0
 public TaskInputs sourceDir(Object path) {
   sourceFiles.from(resolver.resolveFilesAsTree(path));
   return this;
 }
Пример #8
0
 public TaskInputs dir(Object dirPath) {
   inputFiles.from(resolver.resolveFilesAsTree(dirPath));
   return this;
 }
Пример #9
0
 protected File resolve(Object path) {
   return fileResolver.resolve(path);
 }