when rebuilding project delete the contents of output roots and not roots directly to avoid unnecessary "roots changed" events in IDEA

This commit is contained in:
Eugene Zhuravlev
2012-09-27 16:40:38 +02:00
parent 9264f53527
commit 707c27c6e9
@@ -363,7 +363,11 @@ public class IncProjectBuilder {
}
}
if (okToDelete) {
filesToDelete.add(outputRoot);
// do not delete output root itself to avoid lots of unnecessary "roots_changed" events in IDEA
final File[] children = outputRoot.listFiles();
if (children != null) {
filesToDelete.addAll(Arrays.asList(children));
}
}
else {
context.processMessage(new CompilerMessage(BUILD_NAME, BuildMessage.Kind.WARNING, "Output path " + outputRoot.getPath() + " intersects with a source root. The output cannot be cleaned."));
@@ -375,7 +379,11 @@ public class IncProjectBuilder {
}
for (File annotationOutput : annotationOutputs) {
filesToDelete.add(annotationOutput);
// do not delete output root itself to avoid lots of unnecessary "roots_changed" events in IDEA
final File[] children = annotationOutput.listFiles();
if (children != null) {
filesToDelete.addAll(Arrays.asList(children));
}
}
context.processMessage(new ProgressMessage("Cleaning output directories..."));