ModuleDef module =
ModuleDefLoader.loadFromClassPath(logger, compilerContext, moduleName);
compilerContext = compilerContextBuilder.module(module).build();
StandardLinkerContext linkerContext = new StandardLinkerContext(
TreeLogger.NULL, module, compilerContext.getPublicResourceOracle(), options.getOutput());
boolean generateOnShards = true;
if (!options.isEnabledGeneratingOnShards()) {
logger.log(TreeLogger.INFO, "Precompiling on the start node");
generateOnShards = false;
} else if (!linkerContext.allLinkersAreShardable()) {
TreeLogger legacyLinkersLogger =
logger.branch(TreeLogger.INFO,
"Precompiling on the start node, because some linkers are not updated");
if (legacyLinkersLogger.isLoggable(TreeLogger.INFO)) {
for (Linker linker : linkerContext.findUnshardableLinkers()) {
legacyLinkersLogger.log(TreeLogger.INFO, "Linker"
+ linker.getClass().getCanonicalName() + " is not updated");
}
}
generateOnShards = false;