do not rebuild artifacts on project rebuild (IDEA-94132)

This commit is contained in:
nik
2012-11-27 12:06:46 +04:00
parent 7f89a3ec9e
commit 91082a45d4
2 changed files with 17 additions and 7 deletions
@@ -187,9 +187,15 @@ public class CompileDriver {
}
public void rebuild(CompileStatusNotification callback) {
CompileScope projectScope = ArtifactCompileScope.createScopeWithArtifacts(new ProjectCompileScope(myProject),
ArtifactUtil.getArtifactWithOutputPaths(myProject), false);
final CompileScope compileScope = useOutOfProcessBuild() ? projectScope : addAdditionalRoots(projectScope, ALL_EXCEPT_SOURCE_PROCESSING);
final CompileScope compileScope;
ProjectCompileScope projectScope = new ProjectCompileScope(myProject);
if (useOutOfProcessBuild()) {
compileScope = projectScope;
}
else {
CompileScope scopeWithArtifacts = ArtifactCompileScope.createScopeWithArtifacts(projectScope, ArtifactUtil.getArtifactWithOutputPaths(myProject), false);
compileScope = addAdditionalRoots(scopeWithArtifacts, ALL_EXCEPT_SOURCE_PROCESSING);
}
doRebuild(callback, null, true, compileScope);
}
@@ -321,7 +321,9 @@ public class IncProjectBuilder {
}
else {
for (BuildTarget<?> target : projectDescriptor.getBuildTargetIndex().getAllTargets()) {
clearOutputFiles(context, target);
if (context.getScope().isAffected(target)) {
clearOutputFiles(context, target);
}
}
}
}
@@ -389,9 +391,11 @@ public class IncProjectBuilder {
ProjectDescriptor projectDescriptor = context.getProjectDescriptor();
for (BuildTarget<?> target : projectDescriptor.getBuildTargetIndex().getAllTargets()) {
final Collection<File> outputs = target.getOutputRoots(context);
for (File file : outputs) {
rootsToDelete.putValue(file, target);
if (context.getScope().isAffected(target)) {
final Collection<File> outputs = target.getOutputRoots(context);
for (File file : outputs) {
rootsToDelete.putValue(file, target);
}
}
}