use of com.google.idea.blaze.base.scope.scopes.TimingScope in project intellij by bazelbuild.
the class BlazeIdeInterfaceAspectsImpl method doResolveIdeArtifacts.
/**
* Blaze build invocation requesting the 'intellij-resolve' aspect output group.
*
* <p>Prefetches the output artifacts built by this invocation.
*/
private static BuildResult doResolveIdeArtifacts(Project project, BlazeContext context, WorkspaceRoot workspaceRoot, ProjectViewSet projectViewSet, BlazeVersionData blazeVersionData, WorkspaceLanguageSettings workspaceLanguageSettings, List<TargetExpression> targets) {
try (BuildResultHelper buildResultHelper = BuildResultHelper.forFiles(getGenfilePrefetchFilter())) {
BlazeCommand.Builder blazeCommandBuilder = BlazeCommand.builder(getBinaryPath(project), BlazeCommandName.BUILD).addTargets(targets).addBlazeFlags(BlazeFlags.KEEP_GOING).addBlazeFlags(buildResultHelper.getBuildFlags()).addBlazeFlags(BlazeFlags.blazeFlags(project, projectViewSet, BlazeCommandName.BUILD, BlazeInvocationContext.Sync));
// Request the 'intellij-resolve' aspect output group.
AspectStrategyProvider.findAspectStrategy(blazeVersionData).addAspectAndOutputGroups(blazeCommandBuilder, OutputGroup.RESOLVE, workspaceLanguageSettings.activeLanguages);
// Run the blaze build command, parsing any output artifacts produced.
int retVal = ExternalTask.builder(workspaceRoot).addBlazeCommand(blazeCommandBuilder.build()).context(context).stderr(LineProcessingOutputStream.of(BlazeConsoleLineProcessorProvider.getAllStderrLineProcessors(context))).build().run(new TimingScope("ExecuteBlazeCommand", EventType.BlazeInvocation));
BuildResult result = BuildResult.fromExitCode(retVal);
if (result.status != BuildResult.Status.FATAL_ERROR) {
prefetchGenfiles(project, context, buildResultHelper.getBuildArtifacts());
} else {
buildResultHelper.close();
}
return result;
}
}
use of com.google.idea.blaze.base.scope.scopes.TimingScope in project intellij by bazelbuild.
the class WildcardTargetExpander method expandToSingleTargets.
/**
* Runs a sharded blaze query to expand wildcard targets to individual blaze targets
*/
static ExpandedTargetsResult expandToSingleTargets(Project project, BlazeContext parentContext, WorkspaceRoot workspaceRoot, ProjectViewSet projectViewSet, List<TargetExpression> allTargets) {
return Scope.push(parentContext, context -> {
context.push(new TimingScope("ExpandTargetsQuery", EventType.BlazeInvocation));
context.setPropagatesErrors(false);
return doExpandToSingleTargets(project, context, workspaceRoot, projectViewSet, allTargets);
});
}
Aggregations