static List<String> getGroovyRtRoots() {
   File rt = ClasspathBootstrap.getResourceFile(GroovyBuilder.class);
   File constants = ClasspathBootstrap.getResourceFile(GroovyRtConstants.class);
   return Arrays.asList(
       new File(rt.getParentFile(), rt.isFile() ? "groovy_rt.jar" : "groovy_rt").getPath(),
       new File(
               constants.getParentFile(),
               constants.isFile() ? "groovy-rt-constants.jar" : "groovy-rt-constants")
           .getPath());
 }
Пример #2
0
 public ContextImpl(
     @NotNull JavaCompiler compiler,
     @NotNull DiagnosticOutputConsumer outConsumer,
     @NotNull OutputFileConsumer sink,
     CanceledStatus canceledStatus,
     boolean canUseOptimizedmanager) {
   myOutConsumer = outConsumer;
   myOutputFileSink = sink;
   myCanceledStatus = canceledStatus;
   StandardJavaFileManager stdManager = null;
   if (canUseOptimizedmanager) {
     final Class<StandardJavaFileManager> optimizedManagerClass =
         ClasspathBootstrap.getOptimizedFileManagerClass();
     if (optimizedManagerClass != null) {
       try {
         stdManager = optimizedManagerClass.newInstance();
       } catch (Throwable e) {
         if (SystemInfo.isWindows) {
           System.err.println(
               "Failed to load JPS optimized file manager for javac: " + e.getMessage());
         }
       }
     }
   }
   if (stdManager != null) {
     myStdManager = stdManager;
   } else {
     myStdManager = compiler.getStandardFileManager(outConsumer, Locale.US, null);
   }
 }
 protected JpsSdk<JpsDummyElement> addJdk(final String name) {
   try {
     return addJdk(
         name,
         FileUtil.toSystemIndependentName(
             ClasspathBootstrap.getResourceFile(Object.class).getCanonicalPath()));
   } catch (IOException e) {
     throw new RuntimeException(e);
   }
 }