use of com.google.idea.blaze.base.scope.scopes.SharedStringPoolScope in project intellij by bazelbuild.
the class CommandLineBlazeCommandRunner method run.
@Override
public BlazeBuildOutputs run(Project project, BlazeCommand.Builder blazeCommandBuilder, BuildResultHelper buildResultHelper, WorkspaceRoot workspaceRoot, BlazeContext context) {
int retVal = ExternalTask.builder(workspaceRoot).addBlazeCommand(blazeCommandBuilder.build()).context(context).stderr(LineProcessingOutputStream.of(BlazeConsoleLineProcessorProvider.getAllStderrLineProcessors(context))).build().run();
BuildResult buildResult = BuildResult.fromExitCode(retVal);
if (buildResult.status == Status.FATAL_ERROR) {
return BlazeBuildOutputs.noOutputs(buildResult);
}
try {
context.output(PrintOutput.log("Build command finished. Retrieving BEP outputs..."));
Interner<String> stringInterner = Optional.ofNullable(context.getScope(SharedStringPoolScope.class)).map(SharedStringPoolScope::getStringInterner).orElse(null);
return BlazeBuildOutputs.fromParsedBepOutput(buildResult, buildResultHelper.getBuildOutput(stringInterner));
} catch (GetArtifactsException e) {
IssueOutput.error("Failed to get build outputs: " + e.getMessage()).submit(context);
return BlazeBuildOutputs.noOutputs(buildResult);
}
}
use of com.google.idea.blaze.base.scope.scopes.SharedStringPoolScope in project intellij by bazelbuild.
the class SyncPhaseCoordinator method setupScopes.
/**
* Sets up the root {@link BlazeContext} for the given {@link SyncPhase}.
*/
private void setupScopes(BlazeSyncParams syncParams, BlazeContext context, ProgressIndicator indicator, SyncPhase phase, Task task) {
boolean clearProblems = phase != SyncPhase.PROJECT_UPDATE;
boolean notifyFinished = phase != SyncPhase.BUILD;
context.push(new ExperimentScope());
if (BlazeUserSettings.getInstance().getShowPerformanceWarnings()) {
context.push(new PerformanceWarningScope());
}
context.push(new ProgressIndicatorScope(indicator));
context.push(new NetworkTrafficTrackingScope());
context.push(new SharedStringPoolScope());
BlazeUserSettings userSettings = BlazeUserSettings.getInstance();
context.push(new ToolWindowScope.Builder(project, task).setProgressIndicator(indicator).setPopupBehavior(syncParams.backgroundSync() ? FocusBehavior.NEVER : userSettings.getShowBlazeConsoleOnSync()).setIssueParsers(BlazeIssueParser.defaultIssueParsers(project, WorkspaceRoot.fromProject(project), ContextType.Sync)).build()).push(new BlazeConsoleScope.Builder(project, indicator).setPopupBehavior(syncParams.backgroundSync() ? FocusBehavior.NEVER : userSettings.getShowBlazeConsoleOnSync()).addConsoleFilters(new IssueOutputFilter(project, WorkspaceRoot.fromProject(project), ContextType.Sync, true)).setClearPreviousState(clearProblems).build()).push(new ProblemsViewScope(project, syncParams.backgroundSync() ? FocusBehavior.NEVER : userSettings.getShowProblemsViewOnSync(), /* resetProblemsContext= */
clearProblems)).push(new IdeaLogScope());
if (notifyFinished && !syncParams.backgroundSync() && syncParams.syncMode() != SyncMode.NO_BUILD) {
context.push(new NotificationScope(project, "Sync", "Sync project", "Sync successful", "Sync failed"));
}
context.output(new StatusOutput(String.format("Syncing project: %s...", syncParams)));
}
Aggregations