Search in sources :

Example 1 with MaskedFileManager

use of com.google.errorprone.MaskedClassLoader.MaskedFileManager in project error-prone by google.

the class BaseErrorProneCompiler method run.

public Result run(String[] argv) {
    try {
        argv = CommandLine.parse(argv);
    } catch (IOException e) {
        throw new IOError(e);
    }
    List<String> javacOpts = new ArrayList<>();
    List<String> sources = new ArrayList<>();
    for (String arg : argv) {
        // TODO(cushon): is there a better way to categorize javacopts?
        if (!arg.startsWith("-") && arg.endsWith(".java")) {
            sources.add(arg);
        } else {
            javacOpts.add(arg);
        }
    }
    StandardJavaFileManager fileManager = new MaskedFileManager();
    return run(javacOpts.toArray(new String[0]), fileManager, ImmutableList.copyOf(fileManager.getJavaFileObjectsFromStrings(sources)), /* processors= */
    null);
}
Also used : MaskedFileManager(com.google.errorprone.MaskedClassLoader.MaskedFileManager) IOError(java.io.IOError) ArrayList(java.util.ArrayList) StandardJavaFileManager(javax.tools.StandardJavaFileManager) IOException(java.io.IOException)

Aggregations

MaskedFileManager (com.google.errorprone.MaskedClassLoader.MaskedFileManager)1 IOError (java.io.IOError)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 StandardJavaFileManager (javax.tools.StandardJavaFileManager)1