public BaseErrorProneJavaCompiler(ScannerSupplier scannerSupplier) { this(JavacTool.create(), scannerSupplier); }
private JCCompilationUnit doCompile( final JavaFileObject input, Iterable<JavaFileObject> files, Context context) throws IOException { JavacTool tool = JavacTool.create(); DiagnosticCollector<JavaFileObject> diagnosticsCollector = new DiagnosticCollector<>(); ErrorProneOptions errorProneOptions; JavacTaskImpl task = (JavacTaskImpl) tool.getTask( CharStreams.nullWriter(), fileManager,
private void init() { if( _fm != null ) { return; } synchronized( this ) { if( _fm != null ) { return; } _javacTool = JavacTool.create(); StandardJavaFileManager fm = _javacTool.getStandardFileManager( null, null, Charset.forName( "UTF-8" ) ); try { fm.setLocation( StandardLocation.SOURCE_PATH, _module.getCollectiveSourcePath().stream().map( IResource::toJavaFile ).filter( f -> !SourcePathUtil.excludeFromTestPath( f.getAbsolutePath() ) ).collect( Collectors.toList() ) ); fm.setLocation( StandardLocation.CLASS_PATH, _module.getCollectiveJavaClassPath().stream().map( IResource::toJavaFile ).filter( f -> !SourcePathUtil.excludeFromTestPath( f.getAbsolutePath() ) ).collect( Collectors.toList() ) ); _fm = fm; } catch( IOException e ) { throw new RuntimeException( e ); } } }
fileManager = getStandardFileManager(diagnosticListener, null, null); fileManager = ccw.wrap(fileManager); processOptions(context, fileManager, options); Main compiler = new Main("javacTask", context.get(Log.outKey)); return new JavacTaskImpl(compiler, options, context, classes, compilationUnits);
BasicJavacTask task = (BasicJavacTask)_javacTool.getTask( errors, _fm, null, Arrays.asList( "-proc:none", "-source", "1.8", "-Xprefer:source" ), null, null ); if( errors.getBuffer().length() > 0 ) BasicJavacTask task = (BasicJavacTask)_javacTool.getTask( errors, _wfm, null, Arrays.asList( "-proc:none", "-source", "1.8", "-Xprefer:source" ), null, null ); if( errors.getBuffer().length() > 0 )
/** * Static factory method for creating new instances of this tool. * @return new instance of this tool */ public static JavacTool create() { return new JavacTool(); }
fileManager = getStandardFileManager(diagnosticListener, null, null); context.put(JavaFileManager.class, fileManager); processOptions(context, fileManager, options); Main compiler = new Main("javacTask", context.get(Log.outKey)); return new JavacTaskImpl(this, compiler, options, context, classes, compilationUnits);
Log.instance(context).setWriter(Log.WriterKind.ERROR, stderr); com.sun.tools.javac.api.JavacTool.processOptions(context, smartFileManager, the_options); fileManagerBase.setContext(context); smartFileManager.setVisibleSources(visibleSources);
/** * Prepare the compiler thread for use. It is not yet started. * It will be started by the executor service. */ public synchronized void use() { assert(!inUse); inUse = true; compiler = com.sun.tools.javac.api.JavacTool.create(); fileManager = compiler.getStandardFileManager(null, null, null); fileManagerBase = (BaseFileManager)fileManager; smartFileManager = new SmartFileManager(fileManager); context = new Context(); context.put(JavaFileManager.class, smartFileManager); ResolveWithDeps.preRegister(context); JavaCompilerWithDeps.preRegister(context, this); subTasks = new ArrayList<Future<?>>(); }
fileManager = getStandardFileManager(diagnosticListener, null, null); fileManager = ccw.wrap(fileManager); processOptions(context, fileManager, options); Main compiler = new Main("javacTask", context.get(Log.outKey)); return new JavacTaskImpl(compiler, options, context, classes, compilationUnits);
JavacTask task = ((JavacTool) compiler) .getTask(
/** * Static factory method for creating new instances of this tool. * @return new instance of this tool */ public static JavacTool create() { return new JavacTool(); }
fileManager = getStandardFileManager(diagnosticListener, null, null); context.put(JavaFileManager.class, fileManager); processOptions(context, fileManager, options); Main compiler = new Main("javacTask", context.get(Log.outKey)); return new JavacTaskImpl(this, compiler, options, context, classes, compilationUnits);
public ErrorProneJavaCompiler(ScannerSupplier scannerSupplier) { super(JavacTool.create(), scannerSupplier); } }
JavacTask task = ((JavacTool) compiler) .getTask(
/** * Static factory method for creating new instances of this tool. * @return new instance of this tool */ public static JavacTool create() { return new JavacTool(); }
public ErrorProneJavaCompiler() { this(JavacTool.create()); }
InMemoryJavaFileManager fileManager = new InMemoryJavaFileManager( compiler.getStandardFileManager(diagnosticCollector, Locale.getDefault(), UTF_8)); JavacTask task = ((JavacTool) compiler).getTask(