track errors on per-chunk basis

This commit is contained in:
Eugene Zhuravlev
2012-07-05 22:06:33 +02:00
parent 03587b3fcb
commit ec645b7b9b
2 changed files with 9 additions and 12 deletions
@@ -41,7 +41,7 @@ public class CompileContext extends UserDataHolderBase implements MessageHandler
private final Set<Pair<Module, DirtyMarkScope>> myNonIncrementalModules = new HashSet<Pair<Module, DirtyMarkScope>>();
private final ProjectPaths myProjectPaths;
private volatile boolean myErrorsFound = false;
private volatile boolean myErrorsFoundInCurrentChunk = false;
private final long myCompilationStartStamp;
private final ProjectDescriptor myProjectDescriptor;
private final Timestamps myTimestamps;
@@ -281,6 +281,7 @@ public class CompileContext extends UserDataHolderBase implements MessageHandler
public void onChunkBuildStart(ModuleChunk chunk) {
myProjectDescriptor.fsState.setContextChunk(chunk);
myErrorsFoundInCurrentChunk = false;
}
void onChunkBuildComplete(@NotNull ModuleChunk chunk) throws IOException {
@@ -290,7 +291,7 @@ public class CompileContext extends UserDataHolderBase implements MessageHandler
final BuildDataManager dataManager = getDataManager();
try {
if (!myErrorsFound && !myCancelStatus.isCanceled()) {
if (!myErrorsFoundInCurrentChunk && !myCancelStatus.isCanceled()) {
final DirtyMarkScope dirtyScope = compilingTests ? DirtyMarkScope.TESTS : DirtyMarkScope.PRODUCTION;
boolean marked = false;
for (Module module : chunk.getModules()) {
@@ -334,7 +335,7 @@ public class CompileContext extends UserDataHolderBase implements MessageHandler
public void processMessage(BuildMessage msg) {
if (msg.getKind() == BuildMessage.Kind.ERROR) {
myErrorsFound = true;
myErrorsFoundInCurrentChunk = true;
}
if (msg instanceof ProgressMessage) {
((ProgressMessage)msg).setDone(myDone);
@@ -348,8 +349,8 @@ public class CompileContext extends UserDataHolderBase implements MessageHandler
}
}
public boolean errorsDetected() {
return myErrorsFound;
public boolean errorsDetectedInCurrentChunk() {
return myErrorsFoundInCurrentChunk;
}
public void processFilesToRecompile(ModuleChunk chunk, FileProcessor processor) throws IOException {
@@ -470,7 +471,7 @@ public class CompileContext extends UserDataHolderBase implements MessageHandler
return myProjectDescriptor;
}
public static enum DirtyMarkScope{
public enum DirtyMarkScope{
PRODUCTION, TESTS, BOTH
}
@@ -63,12 +63,8 @@ public abstract class ModuleLevelBuilder extends Builder {
* @return true if additional compilation pass is required, false otherwise
* @throws Exception
*/
public final boolean updateMappings(CompileContext context,
final Mappings delta,
ModuleChunk chunk,
Collection<File> filesToCompile,
Collection<File> successfullyCompiled) throws IOException {
if (context.errorsDetected()) {
public final boolean updateMappings(CompileContext context, final Mappings delta, ModuleChunk chunk, Collection<File> filesToCompile, Collection<File> successfullyCompiled) throws IOException {
if (context.errorsDetectedInCurrentChunk()) {
return false;
}
try {