Example usage for org.eclipse.jdt.internal.compiler.batch FileSystem getClasspath

List of usage examples for org.eclipse.jdt.internal.compiler.batch FileSystem getClasspath

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.batch FileSystem getClasspath.

Prototype

public static Classpath getClasspath(String classpathName, String encoding, AccessRuleSet accessRuleSet) 

Source Link

Usage

From source file:io.gige.compiler.internal.ClasspathContainer.java

License:Apache License

public static FileSystem configure(StandardJavaFileManager standardManager) {
    Classpath[] paths = Arrays// w ww .java 2  s.  c  o  m
            .asList(StandardLocation.PLATFORM_CLASS_PATH, StandardLocation.SOURCE_PATH,
                    StandardLocation.SOURCE_OUTPUT, StandardLocation.CLASS_PATH)
            .stream().map(loc -> Optional.ofNullable(standardManager.getLocation(loc)))
            .filter(Optional::isPresent).map(Optional::get)
            .<File>flatMap(files -> stream(files.spliterator(), false))
            .map(file -> FileSystem.getClasspath(file.getAbsolutePath(), null, null)).toArray(Classpath[]::new);
    return new ClasspathContainer(paths, null);
}

From source file:lombok.RunTestsViaEcj.java

License:Open Source License

private FileSystem createFileSystem(File file) {
    List<String> classpath = new ArrayList<String>();
    classpath.addAll(Arrays.asList(System.getProperty("sun.boot.class.path").split(File.pathSeparator)));
    for (Iterator<String> i = classpath.iterator(); i.hasNext();) {
        if (FileSystem.getClasspath(i.next(), "UTF-8", null) == null) {
            i.remove();/*from  w w  w .j  av a 2  s .  co m*/
        }
    }
    classpath.add("bin");
    classpath.add("dist/lombok.jar");
    classpath.add("lib/test/commons-logging-commons-logging.jar");
    classpath.add("lib/test/org.slf4j-slf4j-api.jar");
    classpath.add("lib/test/org.slf4j-slf4j-ext.jar");
    classpath.add("lib/test/log4j-log4j.jar");
    classpath.add("lib/test/org.apache.logging.log4j-log4j-api.jar");
    classpath.add("lib/test/com.google.guava-guava.jar");
    classpath.add("lib/test/com.google.code.findbugs-findbugs.jar");
    return new FileSystem(classpath.toArray(new String[0]), new String[] { file.getAbsolutePath() }, "UTF-8");
}

From source file:org.eclipse.tycho.compiler.jdt.CompilerMain.java

License:Open Source License

private void scanForArchives(ArrayList classPathList, File dir) {
    if (dir.isDirectory()) {
        File[] zipFiles = dir.listFiles(POTENTIAL_ZIP_FILTER);
        if (zipFiles != null) {
            for (File zipFile : zipFiles) {
                classPathList.add(FileSystem.getClasspath(zipFile.getAbsolutePath(), null, null));
            }// w ww .  j ava 2s.  co  m
        }
    }
}