mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
track errors on per-chunk basis
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user