use of com.google.idea.blaze.base.scope.output.StatusOutput in project intellij by bazelbuild.
the class BlazeSyncTask method updateInMemoryState.
private void updateInMemoryState(Project project, BlazeContext parentContext, ProjectViewSet projectViewSet, BlazeProjectData blazeProjectData) {
Scope.push(parentContext, context -> {
context.push(new TimingScope("UpdateInMemoryState", EventType.Other));
context.output(new StatusOutput("Updating in-memory state..."));
ApplicationManager.getApplication().runReadAction(() -> {
Module workspaceModule = ModuleFinder.getInstance(project).findModuleByName(BlazeDataStorage.WORKSPACE_MODULE_NAME);
for (BlazeSyncPlugin blazeSyncPlugin : BlazeSyncPlugin.EP_NAME.getExtensions()) {
blazeSyncPlugin.updateInMemoryState(project, context, workspaceRoot, projectViewSet, blazeProjectData, workspaceModule);
}
});
});
}
use of com.google.idea.blaze.base.scope.output.StatusOutput in project intellij by bazelbuild.
the class BlazeSyncTask method getIdeQueryResult.
private BlazeIdeInterface.IdeResult getIdeQueryResult(Project project, BlazeContext parentContext, ProjectViewSet projectViewSet, BlazeVersionData blazeVersionData, BlazeConfigurationHandler configHandler, ShardedTargetList shardedTargets, WorkspaceLanguageSettings workspaceLanguageSettings, ArtifactLocationDecoder artifactLocationDecoder, Builder syncStateBuilder, @Nullable SyncState previousSyncState, boolean mergeWithOldState) {
return Scope.push(parentContext, context -> {
context.push(new TimingScope("IdeQuery", EventType.BlazeInvocation));
context.output(new StatusOutput("Building IDE info files..."));
context.setPropagatesErrors(false);
BlazeIdeInterface blazeIdeInterface = BlazeIdeInterface.getInstance();
return blazeIdeInterface.updateTargetMap(project, context, workspaceRoot, projectViewSet, blazeVersionData, configHandler, shardedTargets, workspaceLanguageSettings, artifactLocationDecoder, syncStateBuilder, previousSyncState, mergeWithOldState);
});
}
use of com.google.idea.blaze.base.scope.output.StatusOutput in project intellij by bazelbuild.
the class BlazeBuildTargetSharder method expandWildcardTargets.
/**
* Expand wildcard target patterns into individual blaze targets.
*/
private static ExpandedTargetsResult expandWildcardTargets(Project project, BlazeContext parentContext, WorkspaceRoot workspaceRoot, ProjectViewSet projectViewSet, WorkspacePathResolver pathResolver, List<TargetExpression> targets) {
return Scope.push(parentContext, context -> {
context.push(new TimingScope("ShardSyncTargets", EventType.Other));
context.output(new StatusOutput("Sharding: expanding wildcard target patterns..."));
context.setPropagatesErrors(false);
return doExpandWildcardTargets(project, context, workspaceRoot, projectViewSet, pathResolver, targets);
});
}
use of com.google.idea.blaze.base.scope.output.StatusOutput in project intellij by bazelbuild.
the class NotificationScope method onScopeEnd.
@Override
public void onScopeEnd(@NotNull BlazeContext context) {
if (project.isDisposed()) {
return;
}
if (context.isCancelled()) {
context.output(new StatusOutput(notificationName + " cancelled"));
return;
}
long duration = System.currentTimeMillis() - startTime;
if (duration < NOTIFICATION_THRESHOLD_MS) {
return;
}
String notificationText = !context.hasErrors() ? this.notificationText : this.notificationErrorText;
SystemNotifications.getInstance().notify(notificationName, notificationTitle, notificationText);
if (context.hasErrors()) {
context.output(PrintOutput.error(notificationName + " failed"));
}
}
use of com.google.idea.blaze.base.scope.output.StatusOutput in project intellij by bazelbuild.
the class BlazeAndroidSyncPlugin method installSdks.
@Override
public void installSdks(BlazeContext context) {
if (ApplicationManager.getApplication().isUnitTestMode()) {
return;
}
File path = IdeSdks.getInstance().getAndroidSdkPath();
if (path != null) {
context.output(new StatusOutput("Installing SDK platforms..."));
ApplicationManager.getApplication().invokeAndWait(() -> {
IdeSdks.getInstance().createAndroidSdkPerAndroidTarget(path);
}, ModalityState.defaultModalityState());
}
}
Aggregations