コード例 #1
0
 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()));
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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);
 }
コード例 #5
0
 public URI getUrl() {
   return baseUrl == null ? null : fileResolver.resolveUri(baseUrl);
 }
コード例 #6
0
ファイル: CopySpecImpl.java プロジェクト: jgibson/gradle
 public FileTree getSource() {
   return resolver.resolveFilesAsTree(sourcePaths).matching(getPatternSet());
 }
コード例 #7
0
ファイル: DefaultTaskInputs.java プロジェクト: ryfow/gradle
 public TaskInputs sourceDir(Object path) {
   sourceFiles.from(resolver.resolveFilesAsTree(path));
   return this;
 }
コード例 #8
0
ファイル: DefaultTaskInputs.java プロジェクト: ryfow/gradle
 public TaskInputs dir(Object dirPath) {
   inputFiles.from(resolver.resolveFilesAsTree(dirPath));
   return this;
 }
コード例 #9
0
 protected File resolve(Object path) {
   return fileResolver.resolve(path);
 }