mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not update graph when no data
GitOrigin-RevId: d32b797a0ac241c0db85b79f7c68715d0e855f17
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a211bb2988
commit
5fa9887bf4
@@ -83,6 +83,7 @@ class CompilerBuildViewTest : BaseCompilerTestCase() {
|
||||
Running 'before' tasks
|
||||
Checking sources
|
||||
Copying resources… [a]
|
||||
Updating dependency information… [a]
|
||||
Parsing java… [a]
|
||||
Writing classes… [a]
|
||||
Adding nullability assertions… [a]
|
||||
@@ -118,6 +119,7 @@ class CompilerBuildViewTest : BaseCompilerTestCase() {
|
||||
Running 'before' tasks
|
||||
Checking sources
|
||||
Copying resources… [a]
|
||||
Updating dependency information… [a]
|
||||
Parsing java… [a]
|
||||
Writing classes… [a]
|
||||
Adding nullability assertions… [a]
|
||||
|
||||
@@ -131,17 +131,20 @@ public final class JavaBuilderUtil {
|
||||
BuildDataManager dataManager = context.getProjectDescriptor().dataManager;
|
||||
GraphConfiguration graphConfig = dataManager.getDependencyGraph();
|
||||
if(isDepGraphEnabled() && graphConfig != null) {
|
||||
Delta delta = null;
|
||||
Set<File> inputFiles = getFilesContainer(context, FILES_TO_COMPILE_KEY);
|
||||
Set<String> deletedFiles = getRemovedPaths(chunk, dirtyFilesHolder);
|
||||
Delta delta = graphConfig.getGraph().createDelta(
|
||||
Iterators.map(inputFiles, graphConfig.getPathMapper()::toNodeSource),
|
||||
Iterators.map(deletedFiles, graphConfig.getPathMapper()::toNodeSource),
|
||||
false
|
||||
);
|
||||
BackendCallbackToGraphDeltaAdapter callback = GRAPH_DELTA_CALLBACK_KEY.get(context);
|
||||
if (callback != null) {
|
||||
for (var nodeData : callback.getNodes()) {
|
||||
delta.associate(nodeData.getFirst(), nodeData.getSecond());
|
||||
if (callback != null || !inputFiles.isEmpty() || !deletedFiles.isEmpty()) {
|
||||
delta = graphConfig.getGraph().createDelta(
|
||||
Iterators.map(inputFiles, graphConfig.getPathMapper()::toNodeSource),
|
||||
Iterators.map(deletedFiles, graphConfig.getPathMapper()::toNodeSource),
|
||||
false
|
||||
);
|
||||
if (callback != null) {
|
||||
for (var nodeData : callback.getNodes()) {
|
||||
delta.associate(nodeData.getFirst(), nodeData.getSecond());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -549,9 +552,7 @@ public final class JavaBuilderUtil {
|
||||
}
|
||||
|
||||
if (performIntegrate) {
|
||||
if (!Iterators.isEmpty(diffResult.getAffectedSources()) || !Iterators.isEmpty(diffResult.getDeletedNodes())) { // avoid excessive messaging
|
||||
context.processMessage(new ProgressMessage(JpsBuildBundle.message("progress.message.updating.dependency.information.0", chunk.getPresentableShortName())));
|
||||
}
|
||||
context.processMessage(new ProgressMessage(JpsBuildBundle.message("progress.message.updating.dependency.information.0", chunk.getPresentableShortName())));
|
||||
dependencyGraph.integrate(diffResult);
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -162,7 +162,12 @@ public final class LibraryDependenciesUpdater {
|
||||
}
|
||||
}
|
||||
else if (diffParams.isCalculateAffected()) {
|
||||
markAffectedFilesDirty(context, map(diffResult.getAffectedSources(), ns -> pathMapper.toPath(ns)));
|
||||
Iterable<NodeSource> affectedSources = diffResult.getAffectedSources();
|
||||
final String infoMessage = JpsBuildBundle.message("progress.message.dependency.analysis.found.0.affected.files", count(affectedSources));
|
||||
LOG.info(infoMessage);
|
||||
context.processMessage(new ProgressMessage(infoMessage));
|
||||
|
||||
markAffectedFilesDirty(context, map(affectedSources, ns -> pathMapper.toPath(ns)));
|
||||
}
|
||||
|
||||
graph.integrate(diffResult);
|
||||
@@ -179,11 +184,6 @@ public final class LibraryDependenciesUpdater {
|
||||
if (isEmpty(affectedFiles)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final String infoMessage = JpsBuildBundle.message("progress.message.dependency.analysis.found.0.affected.files", count(affectedFiles));
|
||||
LOG.info(infoMessage);
|
||||
context.processMessage(new ProgressMessage(infoMessage));
|
||||
|
||||
ProjectDescriptor projectDescriptor = context.getProjectDescriptor();
|
||||
BuildRootIndex buildRootIndex = projectDescriptor.getBuildRootIndex();
|
||||
JavaModuleIndex moduleIndex = JpsJavaExtensionService.getInstance().getJavaModuleIndex(projectDescriptor.getProject());
|
||||
|
||||
Reference in New Issue
Block a user