/** * Returns the contents of a nocache.js file that will compile and then run a GWT application * using Super Dev Mode. */ static String generateStubNocacheJs(String outputModuleName, Options options) throws IOException { URL url = Resources.getResource(Recompiler.class, "stub.nocache.js"); final String template = Resources.toString(url, Charsets.UTF_8); return template .replace("__MODULE_NAME__", outputModuleName) .replace("__SUPERDEV_PORT__", String.valueOf(options.getPort())); }
/** * Returns the contents of a nocache.js file that will compile and then run a GWT application * using Super Dev Mode. */ static String generateStubNocacheJs(String outputModuleName, Options options) throws IOException { URL url = Resources.getResource(Recompiler.class, "stub.nocache.js"); final String template = Resources.toString(url, Charsets.UTF_8); return template .replace("__MODULE_NAME__", outputModuleName) .replace("__SUPERDEV_PORT__", String.valueOf(options.getPort())); }
Recompiler(OutboxDir outboxDir, LauncherDir launcherDir, String inputModuleName, Options options, UnitCache unitCache, MinimalRebuildCacheManager minimalRebuildCacheManager) { this.outboxDir = outboxDir; this.launcherDir = launcherDir; this.inputModuleName = inputModuleName; this.options = options; this.unitCache = unitCache; this.minimalRebuildCacheManager = minimalRebuildCacheManager; this.serverPrefix = options.getPreferredHost() + ":" + options.getPort(); compilerContext = compilerContextBuilder.build(); }
Recompiler(OutboxDir outboxDir, LauncherDir launcherDir, String inputModuleName, Options options, UnitCache unitCache, MinimalRebuildCacheManager minimalRebuildCacheManager) { this.outboxDir = outboxDir; this.launcherDir = launcherDir; this.inputModuleName = inputModuleName; this.options = options; this.unitCache = unitCache; this.minimalRebuildCacheManager = minimalRebuildCacheManager; this.serverPrefix = options.getPreferredHost() + ":" + options.getPort(); compilerContext = compilerContextBuilder.build(); }
start(options); String url = "http://" + options.getPreferredHost() + ":" + options.getPort() + "/";
start(options); String url = "http://" + options.getPreferredHost() + ":" + options.getPort() + "/";
/** * 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; }