DiskCachingUtil.computePreferredCacheDir(options.getModuleNames(), logger); UnitCache unitCache = UnitCacheSingleton.get(logger, null, baseCacheDir); MinimalRebuildCacheManager minimalRebuildCacheManager =
DiskCachingUtil.computePreferredCacheDir(options.getModuleNames(), logger); UnitCache unitCache = UnitCacheSingleton.get(logger, null, baseCacheDir, new CompilerOptionsImpl(options));
/** * Configures and compiles all the modules (unless {@link Options#getNoPrecompile} is false). */ private static OutboxTable makeOutboxTable(Options options, TreeLogger logger, UnitCache unitCache, MinimalRebuildCacheManager minimalRebuildCacheManager) throws IOException, UnableToCompleteException { File workDir = ensureWorkDir(options); logger.log(Type.INFO, "workDir: " + workDir); LauncherDir launcherDir = LauncherDir.maybeCreate(options); int nextOutboxId = 1; OutboxTable outboxTable = new OutboxTable(); for (String moduleName : options.getModuleNames()) { OutboxDir outboxDir = OutboxDir.create(new File(workDir, moduleName), logger); Recompiler recompiler = new Recompiler(outboxDir, launcherDir, moduleName, options, unitCache, minimalRebuildCacheManager); // The id should be treated as an opaque string since we will change it again. // TODO: change outbox id to include binding properties. String outboxId = moduleName + "_" + nextOutboxId; nextOutboxId++; outboxTable.addOutbox(new Outbox(outboxId, recompiler, options, logger)); } return outboxTable; }
/** * Configures and compiles all the modules (unless {@link Options#getNoPrecompile} is false). */ private static OutboxTable makeOutboxes(Options options, TreeLogger logger, UnitCache unitCache, MinimalRebuildCacheManager minimalRebuildCacheManager) throws IOException, UnableToCompleteException { File workDir = ensureWorkDir(options); logger.log(Type.INFO, "workDir: " + workDir); LauncherDir launcherDir = LauncherDir.maybeCreate(options); int nextOutboxId = 1; OutboxTable outboxes = new OutboxTable(); for (String moduleName : options.getModuleNames()) { OutboxDir outboxDir = OutboxDir.create(new File(workDir, moduleName), logger); Recompiler recompiler = new Recompiler(outboxDir, launcherDir, moduleName, options, unitCache, minimalRebuildCacheManager); // The id should be treated as an opaque string since we will change it again. // TODO: change outbox id to include binding properties. String outboxId = moduleName + "_" + nextOutboxId; nextOutboxId++; outboxes.addOutbox(new Outbox(outboxId, recompiler, options, logger)); } return outboxes; }
/** * 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; }
/** * 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, new CompilerOptionsImpl(options)); MinimalRebuildCacheManager minimalRebuildCacheManager = createMinimalRebuildCacheManager(topLogger, options, baseCacheDir); OutboxTable outboxTable = makeOutboxTable(options, startupLogger, unitCache, minimalRebuildCacheManager); JobEventTable eventTable = new JobEventTable(); JobRunner runner = new JobRunner(eventTable, minimalRebuildCacheManager); JsonExporter exporter = new JsonExporter(options, outboxTable); SourceHandler sourceHandler = new SourceHandler(outboxTable, exporter); SymbolMapHandler symbolMapHandler = new SymbolMapHandler(outboxTable); WebServer webServer = new WebServer(sourceHandler, symbolMapHandler, exporter, outboxTable, runner, eventTable, options.getBindAddress(), options.getPort()); webServer.start(topLogger); return webServer; }