Search in sources :

Example 1 with LoadingCallback

use of com.google.devtools.build.lib.pkgcache.LoadingCallback 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;
}
Also used : LoadingCallback(com.google.devtools.build.lib.pkgcache.LoadingCallback) LoadingResult(com.google.devtools.build.lib.pkgcache.LoadingResult) LoadingPhaseRunner(com.google.devtools.build.lib.pkgcache.LoadingPhaseRunner) BuildConfigurationCollection(com.google.devtools.build.lib.analysis.config.BuildConfigurationCollection) Collection(java.util.Collection) EnvironmentCollection(com.google.devtools.build.lib.analysis.constraints.EnvironmentCollection)

Aggregations

BuildConfigurationCollection (com.google.devtools.build.lib.analysis.config.BuildConfigurationCollection)1 EnvironmentCollection (com.google.devtools.build.lib.analysis.constraints.EnvironmentCollection)1 LoadingCallback (com.google.devtools.build.lib.pkgcache.LoadingCallback)1 LoadingPhaseRunner (com.google.devtools.build.lib.pkgcache.LoadingPhaseRunner)1 LoadingResult (com.google.devtools.build.lib.pkgcache.LoadingResult)1 Collection (java.util.Collection)1