Search in sources :

Example 11 with JavacFileManager

use of com.sun.tools.javac.file.JavacFileManager in project ceylon-compiler by ceylon.

the class A method getFileManager.

JavaFileManager getFileManager(String classpathProperty, boolean symFileKind, boolean zipFileIndexKind) throws IOException {
    Context ctx = new Context();
    Options options = Options.instance(ctx);
    options.put("useOptimizedZip", Boolean.toString(zipFileIndexKind == USE_ZIP_FILE_INDEX));
    if (symFileKind == IGNORE_SYMBOL_FILE)
        options.put("ignore.symbol.file", "true");
    JavacFileManager fm = new JavacFileManager(ctx, false, null);
    List<File> path = getPath(System.getProperty(classpathProperty));
    fm.setLocation(CLASS_PATH, path);
    return fm;
}
Also used : Context(com.sun.tools.javac.util.Context) JavacFileManager(com.sun.tools.javac.file.JavacFileManager) Options(com.sun.tools.javac.util.Options)

Example 12 with JavacFileManager

use of com.sun.tools.javac.file.JavacFileManager in project ceylon-compiler by ceylon.

the class T6358024 method main.

public static void main(String... args) throws Throwable {
    String self = T6358024.class.getName();
    String testSrc = System.getProperty("test.src");
    fm = new JavacFileManager(new Context(), false, null);
    JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + self + ".java");
    test(fm, f, new Option[] { new Option("-d", ".") }, 7);
    test(fm, f, new Option[] { new XOption("-XprintRounds"), new Option("-processorpath", "."), new Option("-processor", self) }, 12);
}
Also used : JavacFileManager(com.sun.tools.javac.file.JavacFileManager)

Example 13 with JavacFileManager

use of com.sun.tools.javac.file.JavacFileManager in project ceylon-compiler by ceylon.

the class T6358166 method main.

public static void main(String... args) throws Throwable {
    String self = T6358166.class.getName();
    String testSrc = System.getProperty("test.src");
    JavacFileManager fm = new JavacFileManager(new Context(), false, null);
    JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + self + ".java");
    test(fm, f, "-verbose", "-d", ".");
    test(fm, f, "-verbose", "-d", ".", "-XprintRounds", "-processorpath", ".", "-processor", self);
}
Also used : JavacFileManager(com.sun.tools.javac.file.JavacFileManager)

Example 14 with JavacFileManager

use of com.sun.tools.javac.file.JavacFileManager in project ceylon-compiler by ceylon.

the class T6838467 method createFileManager.

JavacFileManager createFileManager(boolean useOptimizedZip) {
    Context ctx = new Context();
    Options options = Options.instance(ctx);
    options.put("useOptimizedZip", Boolean.toString(useOptimizedZip));
    return new JavacFileManager(ctx, false, null);
}
Also used : Context(com.sun.tools.javac.util.Context) JavacFileManager(com.sun.tools.javac.file.JavacFileManager) Options(com.sun.tools.javac.util.Options)

Example 15 with JavacFileManager

use of com.sun.tools.javac.file.JavacFileManager in project ceylon-compiler by ceylon.

the class T6877206 method createFileManager.

JavacFileManager createFileManager(boolean useOptimizedZip, boolean useSymbolFile) {
    Context ctx = new Context();
    Options options = Options.instance(ctx);
    options.put("useOptimizedZip", Boolean.toString(useOptimizedZip));
    if (!useSymbolFile) {
        options.put("ignore.symbol.file", "true");
    }
    return new JavacFileManager(ctx, false, null);
}
Also used : Context(com.sun.tools.javac.util.Context) JavacFileManager(com.sun.tools.javac.file.JavacFileManager) Options(com.sun.tools.javac.util.Options)

Aggregations

JavacFileManager (com.sun.tools.javac.file.JavacFileManager)35 Context (com.sun.tools.javac.util.Context)19 JavaFileObject (javax.tools.JavaFileObject)10 File (java.io.File)9 IOException (java.io.IOException)7 PrintWriter (java.io.PrintWriter)7 JavaFileManager (javax.tools.JavaFileManager)7 VirtualFile (com.redhat.ceylon.compiler.typechecker.io.VirtualFile)5 Path (java.nio.file.Path)5 JavacTask (com.sun.source.util.JavacTask)4 Options (com.sun.tools.javac.util.Options)4 OutputStreamWriter (java.io.OutputStreamWriter)4 BufferedWriter (java.io.BufferedWriter)3 Deps (com.google.devtools.build.lib.view.proto.Deps)2 JavacTool (com.sun.tools.javac.api.JavacTool)2 JavaCompiler (com.sun.tools.javac.main.JavaCompiler)2 AnnotationProcessingError (com.sun.tools.javac.processing.AnnotationProcessingError)2 PropagatedException (com.sun.tools.javac.util.PropagatedException)2 DiagnosticCollector (javax.tools.DiagnosticCollector)2 Test (org.junit.Test)2