use of com.google.idea.blaze.base.settings.BuildBinaryType in project intellij by bazelbuild.
the class BlazeBuildParams method fromProject.
public static BlazeBuildParams fromProject(Project project) {
BuildSystemProvider provider = Blaze.getBuildSystemProvider(project);
BuildBinaryType binaryType = provider.getSyncBinaryType();
return builder().setBlazeBinaryPath(provider.getSyncBinaryPath(project)).setBlazeBinaryType(binaryType).setParallelizeBuilds(binaryType.isRemote).build();
}
use of com.google.idea.blaze.base.settings.BuildBinaryType in project intellij by bazelbuild.
the class BlazeBuildTargetSharder method expandAndShardTargets.
/**
* Expand wildcard target patterns and partition the resulting target list.
*/
public static ShardedTargetsResult expandAndShardTargets(Project project, BlazeContext context, WorkspaceRoot workspaceRoot, BlazeBuildParams buildParams, ProjectViewSet viewSet, WorkspacePathResolver pathResolver, List<TargetExpression> targets) {
BuildBinaryType buildType = buildParams.blazeBinaryType();
ShardingApproach approach = getShardingApproach(viewSet, buildType.isRemote);
switch(approach) {
case SHARD_WITHOUT_EXPANDING:
int suggestedSize = getTargetShardSize(viewSet);
return new ShardedTargetsResult(new ShardedTargetList(shardTargetsRetainingOrdering(targets, suggestedSize), ShardStats.ShardingApproach.PARTITION_WITHOUT_EXPANDING, suggestedSize), BuildResult.SUCCESS);
case EXPAND_AND_SHARD:
ExpandedTargetsResult expandedTargets = expandWildcardTargets(project, context, workspaceRoot, buildParams, viewSet, pathResolver, targets);
if (expandedTargets.buildResult.status == BuildResult.Status.FATAL_ERROR) {
return new ShardedTargetsResult(new ShardedTargetList(ImmutableList.of(), ShardStats.ShardingApproach.ERROR, 0), expandedTargets.buildResult);
}
return new ShardedTargetsResult(shardSingleTargets(expandedTargets.singleTargets, buildType, getTargetShardSize(viewSet)), expandedTargets.buildResult);
default:
throw new IllegalStateException("Unhandled sharding approach: " + approach);
}
}
Aggregations