Merge remote-tracking branch 'origin/master'

This commit is contained in:
anna
2012-02-09 20:49:43 +01:00
4 changed files with 38 additions and 31 deletions
+2
View File
@@ -157,6 +157,8 @@ def layoutFull(String home, String targetDirectory, String patchedDescriptorDir
jar("jps-server.jar") {
module("jps-builders")
module("jps-model")
}
jar("groovy-rt.jar") {
module("groovy-rt")
}
@@ -171,36 +171,35 @@ public class CompileContext extends UserDataHolderBase implements MessageHandler
myFsState.beforeNextRoundStart();
}
public void clearContextRoundData() {
myFsState.clearContextRoundData();
}
void onChunkBuildComplete(@NotNull ModuleChunk chunk) throws IOException {
myDataManager.flush(true);
try {
if (!myErrorsFound && !myCancelStatus.isCanceled()) {
final boolean compilingTests = isCompilingTests();
final DirtyMarkScope dirtyScope = compilingTests ? DirtyMarkScope.TESTS : DirtyMarkScope.PRODUCTION;
boolean marked = false;
for (Module module : chunk.getModules()) {
if (isMake()) {
// ensure non-incremental flag cleared
myNonIncrementalModules.remove(new Pair<Module, DirtyMarkScope>(module, dirtyScope));
}
if (isProjectRebuild()) {
myFsState.markInitialScanPerformed(module, compilingTests);
}
final List<RootDescriptor> roots = myRootsIndex.getModuleRoots(module);
for (RootDescriptor descriptor : roots) {
if (compilingTests? descriptor.isTestRoot : !descriptor.isTestRoot) {
marked |= myFsState.markAllUpToDate(getScope(), descriptor, myTsStorage, myCompilationStartStamp);
}
}
if (!myErrorsFound && !myCancelStatus.isCanceled()) {
final boolean compilingTests = isCompilingTests();
final DirtyMarkScope dirtyScope = compilingTests ? DirtyMarkScope.TESTS : DirtyMarkScope.PRODUCTION;
boolean marked = false;
for (Module module : chunk.getModules()) {
if (isMake()) {
// ensure non-incremental flag cleared
myNonIncrementalModules.remove(new Pair<Module, DirtyMarkScope>(module, dirtyScope));
}
if (marked) {
processMessage(UptoDateFilesSavedEvent.INSTANCE);
if (isProjectRebuild()) {
myFsState.markInitialScanPerformed(module, compilingTests);
}
final List<RootDescriptor> roots = myRootsIndex.getModuleRoots(module);
for (RootDescriptor descriptor : roots) {
if (compilingTests? descriptor.isTestRoot : !descriptor.isTestRoot) {
marked |= myFsState.markAllUpToDate(getScope(), descriptor, myTsStorage, myCompilationStartStamp);
}
}
}
}
finally {
myFsState.clearContextRoundData();
if (marked) {
processMessage(UptoDateFilesSavedEvent.INSTANCE);
}
}
}
@@ -441,6 +441,8 @@ public class IncProjectBuilder {
}
}
while (nextPassRequired);
context.clearContextRoundData();
}
private void runProjectLevelBuilders(CompileContext context) throws ProjectBuildException {
@@ -161,14 +161,18 @@ public class GroovyCompilerWrapper {
private static void processException(Exception exception, List collector, boolean forStubs) {
if (exception instanceof GroovyRuntimeException) {
addErrorMessage((GroovyRuntimeException) exception, collector);
} else if (forStubs) {
addMessageWithoutLocation(collector, "Groovyc stub generation failed: " + exception.getMessage(), false);
} else {
final StringWriter writer = new StringWriter();
//noinspection IOResourceOpenedButNotSafelyClosed
exception.printStackTrace(new PrintWriter(writer));
addMessageWithoutLocation(collector, writer.toString(), true);
return;
}
if (forStubs) {
collector.add(new CompilerMessage(CompilerMessage.INFORMATION,
"Groovyc stub generation failed", null, -1, -1));
}
final StringWriter writer = new StringWriter();
//noinspection IOResourceOpenedButNotSafelyClosed
exception.printStackTrace(new PrintWriter(writer));
collector.add(new CompilerMessage(forStubs ? CompilerMessage.INFORMATION : CompilerMessage.ERROR, writer.toString(), null, -1, -1));
}
private static void addMessageWithoutLocation(List collector, String message, boolean error) {