use of com.google.idea.blaze.base.issueparser.IssueOutputFilter in project intellij by bazelbuild.
the class BlazeAndroidRunConfigurationRunner method executeBeforeRunTask.
@Override
public boolean executeBeforeRunTask(ExecutionEnvironment env) {
final Project project = env.getProject();
BlazeConsolePopupBehavior consolePopupBehavior = BlazeUserSettings.getInstance().getSuppressConsoleForRunAction() ? BlazeConsolePopupBehavior.NEVER : BlazeConsolePopupBehavior.ALWAYS;
return Scope.root(context -> {
context.push(new IssuesScope(project, true)).push(new ExperimentScope()).push(new BlazeConsoleScope.Builder(project).setPopupBehavior(consolePopupBehavior).addConsoleFilters(new IssueOutputFilter(project, WorkspaceRoot.fromProject(project), BlazeInvocationContext.NonSync, true)).build()).push(new IdeaLogScope());
BlazeAndroidRunContext runContext = env.getCopyableUserData(RUN_CONTEXT_KEY);
if (runContext == null) {
IssueOutput.error("Could not find run context. Please try again").submit(context);
return false;
}
BlazeAndroidDeviceSelector.DeviceSession deviceSession = env.getCopyableUserData(DEVICE_SESSION_KEY);
BlazeApkBuildStep buildStep = runContext.getBuildStep();
try {
return buildStep.build(context, deviceSession);
} catch (Exception e) {
LOG.error(e);
return false;
}
});
}
use of com.google.idea.blaze.base.issueparser.IssueOutputFilter in project intellij by bazelbuild.
the class BlazeSyncTask method run.
@Override
public void run(final ProgressIndicator indicator) {
Scope.root((BlazeContext context) -> {
context.push(new ExperimentScope());
if (showPerformanceWarnings) {
context.push(new PerformanceWarningScope());
}
context.push(new ProgressIndicatorScope(indicator));
if (!syncParams.backgroundSync) {
context.push(new BlazeConsoleScope.Builder(project, indicator).setPopupBehavior(BlazeUserSettings.getInstance().getShowBlazeConsoleOnSync()).addConsoleFilters(new IssueOutputFilter(project, workspaceRoot, BlazeInvocationContext.Sync, true)).build()).push(new IssuesScope(project, true)).push(new IdeaLogScope()).push(new NotificationScope(project, "Sync", "Sync project", "Sync successful", "Sync failed"));
}
context.output(new StatusOutput(String.format("Syncing project: %s...", syncParams)));
syncProject(context);
});
}
Aggregations