@Override public Void call() throws UnableToCompleteException { long beforeMs = System.nanoTime() / 1000000L; minimalRebuildCacheManager.deleteCaches(); UnitCacheSingleton.clearCache(); long afterMs = System.nanoTime() / 1000000L; logger.log(TreeLogger.INFO, String.format("Cleaned in %sms.", (afterMs - beforeMs))); return null; } }
UnitCache unitCache = UnitCacheSingleton.get(logger, null, baseCacheDir); MinimalRebuildCacheManager minimalRebuildCacheManager = new MinimalRebuildCacheManager(logger, baseCacheDir); outboxes = makeOutboxes(options, logger, unitCache, minimalRebuildCacheManager); } catch (Throwable t) {
private static MinimalRebuildCacheManager createMinimalRebuildCacheManager( PrintWriterTreeLogger logger, Options options,File baseCacheDir) { return new MinimalRebuildCacheManager( logger, baseCacheDir, ImmutableMap.of( "style", options.getOutput().name(), "closureFormattedOutput", String.valueOf(options.isClosureFormattedOutput()), "generateJsInteropExports", String.valueOf(options.shouldGenerateJsInteropExports()), "exportFilters", options.getJsInteropExportFilter().toString(), "methodDisplayMode", options.getMethodNameDisplayMode().name())); }
/** * Starts the code server with the given command line options. To shut it down, see * {@link WebServer#stop}. * * <p>Only one code server should be started at a time because the GWT compiler uses * a lot of static variables.</p> */ public static WebServer start(Options options) throws IOException, UnableToCompleteException { PrintWriterTreeLogger topLogger = new PrintWriterTreeLogger(); topLogger.setMaxDetail(options.getLogLevel()); TreeLogger startupLogger = topLogger.branch(Type.INFO, "Super Dev Mode starting up"); File baseCacheDir = DiskCachingUtil.computePreferredCacheDir(options.getModuleNames(), startupLogger); UnitCache unitCache = UnitCacheSingleton.get(startupLogger, null, baseCacheDir); MinimalRebuildCacheManager minimalRebuildCacheManager = new MinimalRebuildCacheManager(topLogger, baseCacheDir); OutboxTable outboxes = makeOutboxes(options, startupLogger, unitCache, minimalRebuildCacheManager); JobEventTable eventTable = new JobEventTable(); JobRunner runner = new JobRunner(eventTable, minimalRebuildCacheManager); JsonExporter exporter = new JsonExporter(options, outboxes); SourceHandler sourceHandler = new SourceHandler(outboxes, exporter); WebServer webServer = new WebServer(sourceHandler, exporter, outboxes, runner, eventTable, options.getBindAddress(), options.getPort()); webServer.start(topLogger); return webServer; }
@Override public Void call() throws UnableToCompleteException { long beforeMs = System.nanoTime() / 1000000L; minimalRebuildCacheManager.deleteCaches(); UnitCacheSingleton.clearCache(); outboxTable.forceNextRecompileAll(); long afterMs = System.nanoTime() / 1000000L; logger.log(TreeLogger.INFO, String.format("Cleaned in %sms.", (afterMs - beforeMs))); return null; } }