use of com.google.devtools.build.lib.pkgcache.LoadingPhaseRunner in project bazel by bazelbuild.
the class BuildViewTestCase method update.
protected AnalysisResult update(List<String> targets, List<String> aspects, boolean keepGoing, int loadingPhaseThreads, boolean doAnalysis, EventBus eventBus) throws Exception {
LoadingOptions loadingOptions = Options.getDefaults(LoadingOptions.class);
BuildView.Options viewOptions = Options.getDefaults(BuildView.Options.class);
viewOptions.keepGoing = keepGoing;
viewOptions.loadingPhaseThreads = loadingPhaseThreads;
LoadingPhaseRunner runner = new LegacyLoadingPhaseRunner(getPackageManager(), Collections.unmodifiableSet(ruleClassProvider.getRuleClassMap().keySet()));
LoadingResult loadingResult = runner.execute(reporter, targets, PathFragment.EMPTY_FRAGMENT, loadingOptions, viewOptions.keepGoing, /*determineTests=*/
false, /*callback=*/
null);
if (!doAnalysis) {
// TODO(bazel-team): What's supposed to happen in this case?
return null;
}
return view.update(loadingResult, masterConfig, aspects, viewOptions, AnalysisTestUtil.TOP_LEVEL_ARTIFACT_CONTEXT, reporter, eventBus);
}
use of com.google.devtools.build.lib.pkgcache.LoadingPhaseRunner in project bazel by bazelbuild.
the class BuildTool method evaluateTargetPatterns.
private final LoadingResult evaluateTargetPatterns(final BuildRequest request, final TargetValidator validator) throws LoadingFailedException, TargetParsingException, InterruptedException {
Profiler.instance().markPhase(ProfilePhase.LOAD);
initializeOutputFilter(request);
final boolean keepGoing = request.getViewOptions().keepGoing;
LoadingCallback callback = new LoadingCallback() {
@Override
public void notifyTargets(Collection<Target> targets) throws LoadingFailedException {
if (validator != null) {
validator.validateTargets(targets, keepGoing);
}
}
};
LoadingPhaseRunner loadingPhaseRunner = env.getSkyframeExecutor().getLoadingPhaseRunner(runtime.getPackageFactory().getRuleClassNames(), request.getLoadingOptions().useSkyframeTargetPatternEvaluator);
LoadingResult result = loadingPhaseRunner.execute(getReporter(), request.getTargets(), env.getRelativeWorkingDirectory(), request.getLoadingOptions(), keepGoing, request.shouldRunTests(), callback);
return result;
}
Aggregations