use of com.google.idea.blaze.base.settings.BuildSystemName in project intellij by bazelbuild.
the class SuggestBuildShardingNotification method suggestIncreasingServerMemory.
private static void suggestIncreasingServerMemory(Project project, BlazeContext context) {
BuildSystemName buildSystemName = Blaze.getBuildSystemName(project);
String message = String.format("The %s server ran out of memory during sync. You can work around this by " + "allocating more memory to the %s server, for example by adding this line to " + "your %s:<br>" + "startup --host_jvm_args=-Xmx15g --host_jvm_args=-Xms15g", buildSystemName.getName(), buildSystemName.getName(), buildSystemName == BuildSystemName.Bazel ? ".bazelrc" : "~/.blazerc");
IssueOutput.error(StringUtil.stripHtml(message, true)).submit(context);
showNotification(project, message, p -> {
});
}
use of com.google.idea.blaze.base.settings.BuildSystemName in project intellij by bazelbuild.
the class BlazeVcsHandler method vcsHandlerForProject.
@Nullable
static BlazeVcsHandler vcsHandlerForProject(Project project) {
BuildSystemName buildSystemName = Blaze.getBuildSystemName(project);
WorkspaceRoot workspaceRoot = WorkspaceRoot.fromProject(project);
for (BlazeVcsHandler candidate : BlazeVcsHandler.EP_NAME.getExtensions()) {
if (candidate.handlesProject(buildSystemName, workspaceRoot)) {
return candidate;
}
}
return null;
}
use of com.google.idea.blaze.base.settings.BuildSystemName in project intellij by bazelbuild.
the class BlazeCoverageProgramRunner method getBlazeInfo.
@Nullable
private static ListenableFuture<BlazeInfo> getBlazeInfo(Project project, BlazeCommandRunConfiguration config) {
ProjectViewSet viewSet = ProjectViewManager.getInstance(project).getProjectViewSet();
if (viewSet == null) {
return null;
}
BlazeInvocationContext invocationContext = BlazeInvocationContext.runConfigContext(ExecutorType.COVERAGE, BlazeCommandRunConfigurationType.getInstance(), /* beforeRunTask= */
false);
List<String> infoFlags = BlazeFlags.blazeFlags(project, viewSet, BlazeCommandName.INFO, BlazeContext.create(), invocationContext);
BuildSystemName buildSystemName = Blaze.getBuildSystemName(project);
return Scope.push(null, (ScopedFunction<ListenableFuture<BlazeInfo>>) context -> BlazeInfoRunner.getInstance().runBlazeInfo(context, buildSystemName, getBlazeBinary(config), WorkspaceRoot.fromProject(project), infoFlags));
}
use of com.google.idea.blaze.base.settings.BuildSystemName in project intellij by bazelbuild.
the class BlazeAndroidWorkspaceImporterTest method importJavaWorkspace.
private BlazeJavaImportResult importJavaWorkspace(WorkspaceRoot workspaceRoot, TargetMap targetMap, ProjectView projectView) {
BuildSystemName buildSystemName = Blaze.getBuildSystemName(project);
ProjectViewSet projectViewSet = ProjectViewSet.builder().add(projectView).build();
JavaSourceFilter sourceFilter = new JavaSourceFilter(buildSystemName, workspaceRoot, projectViewSet, targetMap);
BlazeJavaWorkspaceImporter blazeWorkspaceImporter = new BlazeJavaWorkspaceImporter(project, workspaceRoot, projectViewSet, workspaceLanguageSettings, targetMap, sourceFilter, jdepsMap, workingSet, FAKE_ARTIFACT_DECODER, /* oldSyncState= */
null);
return blazeWorkspaceImporter.importWorkspace(context);
}
use of com.google.idea.blaze.base.settings.BuildSystemName in project intellij by bazelbuild.
the class BlazeEditProjectViewControl method modifyInitialProjectView.
private static String modifyInitialProjectView(BuildSystemName buildSystemName, String initialProjectViewText, WorkspacePathResolver workspacePathResolver) {
BlazeContext context = BlazeContext.create();
ProjectViewParser projectViewParser = new ProjectViewParser(context, workspacePathResolver);
projectViewParser.parseProjectView(initialProjectViewText);
ProjectViewSet projectViewSet = projectViewParser.getResult();
ProjectViewFile projectViewFile = projectViewSet.getTopLevelProjectViewFile();
if (projectViewFile == null) {
return initialProjectViewText;
}
ProjectView projectView = projectViewFile.projectView;
// Sort default value providers to match the section order
List<SectionKey<?, ?>> sectionKeys = Sections.getParsers().stream().map(SectionParser::getSectionKey).collect(toList());
List<ProjectViewDefaultValueProvider> defaultValueProviders = Lists.newArrayList(ProjectViewDefaultValueProvider.EP_NAME.getExtensions());
defaultValueProviders.sort(Comparator.comparingInt(val -> sectionKeys.indexOf(val.getSectionKey())));
for (ProjectViewDefaultValueProvider defaultValueProvider : defaultValueProviders) {
projectView = defaultValueProvider.addProjectViewDefaultValue(buildSystemName, projectViewSet, projectView);
}
return ProjectViewParser.projectViewToString(projectView);
}
Aggregations