Search in sources :

Example 16 with StatusOutput

use of com.google.idea.blaze.base.scope.output.StatusOutput in project intellij by bazelbuild.

the class WildcardTargetExpander method doExpandToSingleTargets.

private static ExpandedTargetsResult doExpandToSingleTargets(Project project, BlazeContext context, WorkspaceRoot workspaceRoot, ProjectViewSet projectViewSet, List<TargetExpression> allTargets) {
    ShardedTargetList shards = BlazeBuildTargetSharder.shardTargets(allTargets, BlazeBuildTargetSharder.PACKAGE_SHARD_SIZE);
    ImmutableSet<String> handledRuleTypes = handledRuleTypes(projectViewSet);
    ExpandedTargetsResult output = null;
    for (int i = 0; i < shards.shardedTargets.size(); i++) {
        List<TargetExpression> shard = shards.shardedTargets.get(i);
        context.output(new StatusOutput(String.format("Expanding wildcard target patterns, shard %s of %s", i + 1, shards.shardedTargets.size())));
        ExpandedTargetsResult result = queryIndividualTargets(project, context, workspaceRoot, handledRuleTypes, shard);
        output = output == null ? result : ExpandedTargetsResult.merge(output, result);
        if (output.buildResult.status == Status.FATAL_ERROR) {
            return output;
        }
    }
    return output;
}
Also used : StatusOutput(com.google.idea.blaze.base.scope.output.StatusOutput) TargetExpression(com.google.idea.blaze.base.model.primitives.TargetExpression)

Aggregations

StatusOutput (com.google.idea.blaze.base.scope.output.StatusOutput)16 TimingScope (com.google.idea.blaze.base.scope.scopes.TimingScope)8 IssueOutputFilter (com.google.idea.blaze.base.issueparser.IssueOutputFilter)3 Label (com.google.idea.blaze.base.model.primitives.Label)3 ProjectViewSet (com.google.idea.blaze.base.projectview.ProjectViewSet)3 BlazeContext (com.google.idea.blaze.base.scope.BlazeContext)3 BlazeConsoleScope (com.google.idea.blaze.base.scope.scopes.BlazeConsoleScope)3 IssuesScope (com.google.idea.blaze.base.scope.scopes.IssuesScope)3 BuildResult (com.google.idea.blaze.base.sync.aspects.BuildResult)3 Kind (com.google.idea.blaze.base.model.primitives.Kind)2 WorkspaceRoot (com.google.idea.blaze.base.model.primitives.WorkspaceRoot)2 BlazeConsolePopupBehavior (com.google.idea.blaze.base.settings.BlazeUserSettings.BlazeConsolePopupBehavior)2 BlazeIdeInterface (com.google.idea.blaze.base.sync.aspects.BlazeIdeInterface)2 Function (com.google.common.base.Function)1 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)1 Preconditions.checkState (com.google.common.base.Preconditions.checkState)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Futures (com.google.common.util.concurrent.Futures)1