force rebuild module chunk when groovyc stub generation fails due to classloading...
authorpeter <peter@jetbrains.com>
Tue, 31 Jan 2012 19:16:17 +0000 (20:16 +0100)
committerpeter <peter@jetbrains.com>
Tue, 31 Jan 2012 19:16:17 +0000 (20:16 +0100)
jps/jps-builders/src/org/jetbrains/jps/incremental/groovy/GroovyBuilder.java
plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GroovyCompilerTest.groovy

index f0742ba9bcdbdbef490f0131fb410f03a2071472..0364cd2f4dd3bef74c505800f96493ecaa265b81 100644 (file)
@@ -91,6 +91,17 @@ public class GroovyBuilder extends ModuleLevelBuilder {
           }
         });
 
+        if (myForStubs && handler.shouldRetry()) {
+          File marker = new File(moduleOutput, "groovy_stubs_retry");
+          if (marker.exists()) {
+            FileUtil.delete(marker);
+          } else {
+            FileUtil.createIfDoesntExist(marker);
+            exitCode = ExitCode.CHUNK_REBUILD_REQUIRED;
+            return exitCode;
+          }
+        }
+
         successfullyCompiled = handler.getSuccessfullyCompiled();
 
         for (CompilerMessage message : handler.getCompilerMessages()) {
index b2c31a80db633c2a1c0f6552458f48239d76b311..181111c001cad8c4b14238d729790aff4845a935 100644 (file)
@@ -503,6 +503,11 @@ class Indirect {
     if (!useJps()) {
       assertEmpty compileFiles(used.virtualFile, main)
     }
+
+    touch(used.virtualFile)
+    touch(main)
+    assertEmpty make()
+
     assertEmpty compileModule(myModule)
     assertEmpty compileModule(myModule)