예제 #1
0
 private static String getModuleOutput(CompileContext context, ModuleChunk chunk) {
   final Module representativeModule = chunk.getModules().iterator().next();
   File moduleOutputDir =
       context
           .getProjectPaths()
           .getModuleOutputDir(representativeModule, context.isCompilingTests());
   assert moduleOutputDir != null;
   String moduleOutputPath = FileUtil.toCanonicalPath(moduleOutputDir.getPath());
   return moduleOutputPath.endsWith("/") ? moduleOutputPath : moduleOutputPath + "/";
 }
예제 #2
0
  private static List<String> generateClasspath(CompileContext context, ModuleChunk chunk) {
    final Set<String> cp = new LinkedHashSet<String>();
    // groovy_rt.jar
    // IMPORTANT! must be the first in classpath
    cp.add(ClasspathBootstrap.getResourcePath(GroovyCompilerWrapper.class).getPath());

    for (File file :
        context
            .getProjectPaths()
            .getClasspathFiles(chunk, ClasspathKind.compile(context.isCompilingTests()), false)) {
      cp.add(FileUtil.toCanonicalPath(file.getPath()));
    }
    for (File file :
        context
            .getProjectPaths()
            .getClasspathFiles(chunk, ClasspathKind.runtime(context.isCompilingTests()), false)) {
      cp.add(FileUtil.toCanonicalPath(file.getPath()));
    }
    return new ArrayList<String>(cp);
  }