示例#1
0
  private Path computeBootClassPath() {
    bootClassPathRtJar = null;
    String optionValue;
    Path path = new Path();

    path.addFiles(options.get(XBOOTCLASSPATH_PREPEND));

    if ((optionValue = options.get(ENDORSEDDIRS)) != null) path.addDirectories(optionValue);
    else path.addDirectories(System.getProperty("java.endorsed.dirs"), false);

    if ((optionValue = options.get(BOOTCLASSPATH)) != null) {
      path.addFiles(optionValue);
    } else {
      // Standard system classes for this compiler's release.
      String files = System.getProperty("sun.boot.class.path");
      path.addFiles(files, false);
      File rt_jar = new File("rt.jar");
      for (File file : getPathEntries(files)) {
        if (new File(file.getName()).equals(rt_jar)) bootClassPathRtJar = file;
      }
    }

    path.addFiles(options.get(XBOOTCLASSPATH_APPEND));

    // Strictly speaking, standard extensions are not bootstrap
    // classes, but we treat them identically, so we'll pretend
    // that they are.
    if ((optionValue = options.get(EXTDIRS)) != null) path.addDirectories(optionValue);
    else path.addDirectories(System.getProperty("java.ext.dirs"), false);

    return path;
  }
示例#2
0
  private Path computeUserClassPath() {
    String cp = options.get(CLASSPATH);

    /*
     * Ceylon: disabled because we use the -cp flag or set it up via module repos
     *
    // CLASSPATH environment variable when run from `javac'.
    if (cp == null) cp = System.getProperty("env.class.path");

    // If invoked via a java VM (not the javac launcher), use the
    // platform class path
    if (cp == null && System.getProperty("application.home") == null)
        cp = System.getProperty("java.class.path");

    // Default to current working directory.
    if (cp == null) cp = ".";
    */

    Path ret =
        new Path()
            .expandJarClassPaths(true) // Only search user jars for Class-Paths
            .emptyPathDefault(new File(".")); // Empty path elt ==> current directory
    if (cp != null) ret.addFiles(cp);
    return ret;
  }
示例#3
0
  private Path computeSourcePath() {
    List<String> sourcePathArgs = options.getMulti(SOURCEPATH);
    // Ceylon: default source path
    if (sourcePathArgs.isEmpty())
      sourcePathArgs = FileUtil.filesToPathList(DefaultToolOptions.getCompilerSourceDirs(config));

    Path path = new Path();
    for (String pathArg : sourcePathArgs) {
      path.addFiles(pathArg);
    }
    return path;
  }