private boolean doCompile(TreeLogger compileLogger, CompileDir compileDir, Job job)
throws UnableToCompleteException {
job.onProgress("Loading modules");
CompilerOptions loadOptions = new CompilerOptionsImpl(compileDir, inputModuleName, options);
compilerContext = compilerContextBuilder.options(loadOptions).build();
ModuleDef module = loadModule(compileLogger);
// We need to generate the stub before restricting permutations
String recompileJs = generateModuleRecompileJs(module, compileLogger);
Map<String, String> bindingProperties = restrictPermutations(compileLogger, module,
job.getBindingProperties());
// Propagates module rename.
String newModuleName = module.getName();
outputModuleName.set(newModuleName);
// Check if we can skip the compile altogether.
InputSummary input = new InputSummary(bindingProperties, module);
if (input.equals(lastBuildInput)) {
compileLogger.log(Type.INFO, "skipped compile because no input files have changed");
job.setCompileStrategy(CompileStrategy.SKIPPED);
return true;
}
// Force a recompile if we don't succeed.
lastBuildInput = null;
job.onProgress("Compiling");
// TODO: use speed tracer to get more compiler events?
CompilerOptions runOptions = new CompilerOptionsImpl(compileDir, newModuleName, options);
compilerContext = compilerContextBuilder.options(runOptions).build();
// Looks up the matching rebuild cache using the final set of overridden binding properties.
MinimalRebuildCache knownGoodMinimalRebuildCache =
getKnownGoodMinimalRebuildCache(bindingProperties);