Skip to content

Commit

Permalink
Tune setting classpath info
Browse files Browse the repository at this point in the history
  • Loading branch information
guw committed Feb 17, 2024
1 parent 029e5a3 commit 44ce368
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,7 @@ void updateClasspath(BazelWorkspace bazelWorkspace, List<BazelProject> projects,
var projectClasspath =
bazelProject.isWorkspaceProject() ? workspaceProjectClasspath : classpaths.get(bazelProject);

saveAndSetContainer(
javaProject,
projectClasspath,
monitor.split(1, "Setting classpath " + bazelProject.getName()));
saveAndSetContainer(javaProject, projectClasspath, monitor.slice(1));
}
} finally {
if (progress != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public Map<BazelProject, Collection<ClasspathEntry>> computeClasspaths(Collectio
aspects,
new BazelWorkspaceBlazeInfo(workspace),
format(
"Running build with IntelliJ aspects to collect classpath information (shard %d of %d, %d targets)",
"Running build with IDE aspects (shard %d of %d, %d targets)",
currentShardCount,
shardsToBuild.size(),
targetsToBuild.size()));
Expand All @@ -160,21 +160,25 @@ public Map<BazelProject, Collection<ClasspathEntry>> computeClasspaths(Collectio
command.setInterner(interner);

monitor.subTask(
format(
"Running Bazel build with aspects (shard %d of %d)",
currentShardCount,
shardsToBuild.size()));
format("Running build with IDE aspects (shard %d of %d)", currentShardCount, shardsToBuild.size()));
var result = workspace.getCommandExecutor()
.runDirectlyWithinExistingWorkspaceLock(
command,
shard.keySet().stream().map(BazelProject::getProject).collect(toList()),
monitor.slice(3));

// populate map from result
var subMonitor = monitor.split(
2,
format(
"Analyze Bazel aspect info (shard %d of %d, %d targets)",
currentShardCount,
shardsToBuild.size(),
targetsToBuild.size()));
var aspectsInfo = new JavaAspectsInfo(result, workspace);
for (BazelProject bazelProject : shard.keySet()) {
monitor.subTask(bazelProject.getName());
monitor.checkCanceled();
subMonitor.subTask(bazelProject.getName());
subMonitor.checkCanceled();

// build index of classpath info
var classpathInfo = new JavaAspectsClasspathInfo(aspectsInfo, workspace);
Expand Down Expand Up @@ -217,7 +221,7 @@ public Map<BazelProject, Collection<ClasspathEntry>> computeClasspaths(Collectio
&& entry.getPath().equals(bazelProject.getProject().getFullPath()));

classpathsByProject.put(bazelProject, classpath);
monitor.worked(1);
subMonitor.worked(1);
}
}

Expand Down

0 comments on commit 44ce368

Please sign in to comment.