/** * Returns the location of the compiler output. (Changes after every recompile.) * @param outputModuleName the module name that the GWT compiler used in its output. */ public File getCurrentWarDir(String outputModuleName) { return outboxes.findByOutputModuleName(outputModuleName).getWarDir(); }
private Response makePolicyFilePage(String target) { int secondSlash = target.indexOf('/', 1); if (secondSlash < 1) { return new ErrorPage("invalid URL for policy file: " + target); } String rest = target.substring(secondSlash + 1); if (rest.contains("/") || !rest.endsWith(".gwt.rpc")) { return new ErrorPage("invalid name for policy file: " + rest); } File fileToSend = outboxTable.findPolicyFile(rest); if (fileToSend == null) { return new ErrorPage("Policy file not found: " + rest); } return Responses.newFileResponse("text/plain", fileToSend); }
private JsonArray exportOutputModuleNames() { JsonArray moduleNames = new JsonArray(); for (String module : outboxes.getOutputModuleNames()) { moduleNames.add(module); } return moduleNames; }
/** * 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; }
for (Outbox box : outboxTable.getOutboxes()) { List<PolicyFile> policies = box.readRpcPolicyManifest(); if (!policies.isEmpty()) {
outboxes.defaultCompileAll(logger); } catch (Throwable t) { t.printStackTrace();
@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; } }
private Response makeDeployFilePage(String target) { int secondSlash = target.indexOf('/', 1); if (secondSlash < 1) { return new ErrorPage("invalid URL for deploy file: " + target); } String rest = target.substring(secondSlash + 1); String allow = System.getProperty("allowed.policies"); if (allow == null || !rest.matches(allow)) { return new ErrorPage("invalid name for deploy file: " + rest); } File fileToSend = outboxes.findDeployFile(rest); if (fileToSend == null) { return new ErrorPage("Deploy file not found: " + rest); } return Responses.newFileResponse("text/plain", fileToSend); }
/** * 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; }
for (Outbox box : outboxes.getOutboxes()) { List<PolicyFile> policies = box.readRpcPolicyManifest(); if (!policies.isEmpty()) {
outboxTable.defaultCompileAll(logger); } catch (Throwable t) { t.printStackTrace();
/** * Returns the location of the compiler output. (Changes after every recompile.) * @param outputModuleName the module name that the GWT compiler used in its output. */ public File getCurrentWarDir(String outputModuleName) { return outboxTable.findByOutputModuleName(outputModuleName).getWarDir(); }
private JsonArray exportOutputModuleNames() { JsonArray moduleNames = new JsonArray(); for (String module : outboxTable.getOutputModuleNames()) { moduleNames.add(module); } return moduleNames; }
private Response makePolicyFilePage(String target) { int secondSlash = target.indexOf('/', 1); if (secondSlash < 1) { return new ErrorPage("invalid URL for policy file: " + target); } String rest = target.substring(secondSlash + 1); if (rest.contains("/") || !rest.endsWith(".gwt.rpc")) { return new ErrorPage("invalid name for policy file: " + rest); } File fileToSend = outboxes.findPolicyFile(rest); if (fileToSend == null) { return new ErrorPage("Policy file not found: " + rest); } return Responses.newFileResponse("text/plain", fileToSend); }
private Response makeModulePage(String moduleName) { Outbox box = outboxes.findByOutputModuleName(moduleName); if (box == null) { return new ErrorPage("No such module: " + moduleName); } JsonObject json = jsonExporter.exportModulePageVars(box); return Pages.newHtmlPage("config", json, "modulepage.html"); }
private Response makeModulePage(String moduleName) { Outbox box = outboxTable.findByOutputModuleName(moduleName); if (box == null) { return new ErrorPage("No such module: " + moduleName); } JsonObject json = jsonExporter.exportModulePageVars(box); return Pages.newHtmlPage("config", json, "modulepage.html"); }
Outbox box = outboxes.findByOutputModuleName(moduleName); if (box == null) { return new ErrorPage("No such module: " + moduleName);
Outbox box = outboxTable.findByOutputModuleName(moduleName); if (box == null) { return new ErrorPage("No such module: " + moduleName);
Response handle(String target, HttpServletRequest request, TreeLogger logger) { String moduleName = getModuleNameFromRequest(target); if (moduleName == null) { throw new RuntimeException("invalid request (shouldn't happen): " + target); } Outbox box = outboxTable.findByOutputModuleName(moduleName); if (box == null) { return new ErrorPage("No such module: " + moduleName); } else if (box.containsStubCompile()) { return new ErrorPage("This module hasn't been compiled yet."); } String rootDir = SYMBOLMAP_PATH + moduleName + "/"; String rest = target.substring(rootDir.length()); if (rest.isEmpty()) { return new ErrorPage("Missing permutation id"); } else if (rest.endsWith("/")) { return new ErrorPage("Can not list directory"); } else { String strongName = getStrongNameFromSymbolmapFilename(rest); if (strongName != null) { File symbolMap = box.findSymbolMap(strongName).getAbsoluteFile(); return Responses.newFileResponse("text/plain", symbolMap); } else { return new ErrorPage("page not found"); } } }
Outbox box = outboxTable.findByOutputModuleName(moduleName); if (box == null) { return new ErrorPage("No such module: " + moduleName);