Esempio n. 1
0
  @NotNull
  private URL[] getClassPathURLs() {
    List<URL> urls = Lists.newArrayList();
    for (File file : JvmContentRootsKt.getJvmClasspathRoots(myEnvironment.getConfiguration())) {
      try {
        urls.add(file.toURI().toURL());
      } catch (MalformedURLException e) {
        throw new RuntimeException(e);
      }
    }

    return urls.toArray(new URL[urls.size()]);
  }
Esempio n. 2
0
  public static void resolveAllKotlinFiles(KotlinCoreEnvironment environment) throws IOException {
    List<ContentRoot> paths =
        environment.getConfiguration().get(CommonConfigurationKeys.CONTENT_ROOTS);
    if (paths == null) return;
    List<KtFile> jetFiles = Lists.newArrayList();
    for (ContentRoot root : paths) {
      if (!(root instanceof KotlinSourceRoot)) continue;

      String path = ((KotlinSourceRoot) root).getPath();
      File file = new File(path);
      if (file.isFile()) {
        jetFiles.add(loadJetFile(environment.getProject(), file));
      } else {
        //noinspection ConstantConditions
        for (File childFile : file.listFiles()) {
          if (childFile.getName().endsWith(".kt")) {
            jetFiles.add(loadJetFile(environment.getProject(), childFile));
          }
        }
      }
    }
    LazyResolveTestUtil.resolve(environment.getProject(), jetFiles, environment);
  }