precompilationOptions.setGenDir(null);
compilerContext = compilerContextBuilder.options(precompilationOptions).build();
ModuleDef module = ModuleDefLoader.loadFromClassPath(logger, compilerContext, moduleName);
compilerContext = compilerContextBuilder.module(module).build();
PropertyPermutations allPermutations = new PropertyPermutations(
module.getProperties(), module.getActiveLinkerNames());
List<PropertyPermutations> collapsedPermutations = allPermutations.collapseProperties();
int[] perms = options.getPermsToCompile();
if (perms == null) {
perms = new int[collapsedPermutations.size()];
for (int i = 0; i < perms.length; ++i) {
perms[i] = i;
}
}
logger = logger.branch(TreeLogger.INFO, "Compiling " + perms.length
+ " permutation" + (perms.length > 1 ? "s" : ""));
for (int permId : perms) {
/*
* TODO(spoon,scottb): move Precompile out of the loop to run only once
* per shard. Then figure out a way to avoid copying the generated
* artifacts into every perm result on a shard.
*/
PropertyPermutations onePerm = collapsedPermutations.get(permId);
Precompilation precompilation =
Precompile.precompile(logger, compilerContext, permId, onePerm);
if (precompilation == null) {
return false;