Search in sources :

Example 31 with TargetExpression

use of com.google.idea.blaze.base.model.primitives.TargetExpression 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

TargetExpression (com.google.idea.blaze.base.model.primitives.TargetExpression)31 Test (org.junit.Test)11 WildcardTargetPattern (com.google.idea.blaze.base.model.primitives.WildcardTargetPattern)10 WorkspacePath (com.google.idea.blaze.base.model.primitives.WorkspacePath)8 File (java.io.File)6 Label (com.google.idea.blaze.base.model.primitives.Label)5 ImmutableList (com.google.common.collect.ImmutableList)3 TargetKey (com.google.idea.blaze.base.ideinfo.TargetKey)3 BlazeCommandRunConfigurationCommonState (com.google.idea.blaze.base.run.state.BlazeCommandRunConfigurationCommonState)3 ImmutableMap (com.google.common.collect.ImmutableMap)2 Lists (com.google.common.collect.Lists)2 Maps (com.google.common.collect.Maps)2 Futures (com.google.common.util.concurrent.Futures)2 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)2 ListeningExecutorService (com.google.common.util.concurrent.ListeningExecutorService)2 FutureUtil (com.google.idea.blaze.base.async.FutureUtil)2 BuildSystemProvider (com.google.idea.blaze.base.bazel.BuildSystemProvider)2 BlazeCommand (com.google.idea.blaze.base.command.BlazeCommand)2 TargetIdeInfo (com.google.idea.blaze.base.ideinfo.TargetIdeInfo)2 Kind (com.google.idea.blaze.base.model.primitives.Kind)2