Author: sp...@google.com
Date: Thu Apr  9 14:07:53 2009
New Revision: 5207

Modified:
    trunk/dev/core/src/com/google/gwt/dev/Precompile.java

Log:
When sharded precompiles are on, force the option "retain
compilation state" to be on except for the last precompile
shard.  Otherwise, state is discarded that is actually needed
for the next shard.

Review by: scottb

Modified: trunk/dev/core/src/com/google/gwt/dev/Precompile.java
==============================================================================
--- trunk/dev/core/src/com/google/gwt/dev/Precompile.java       (original)
+++ trunk/dev/core/src/com/google/gwt/dev/Precompile.java       Thu Apr  9  
14:07:53 2009
@@ -497,6 +497,8 @@
    }

    public boolean run(TreeLogger logger) throws UnableToCompleteException {
+    boolean originalCompilationStateRetained =  
options.isCompilationStateRetained();
+
      for (String moduleName : options.getModuleNames()) {
        File compilerWorkDir = options.getCompilerWorkDir(moduleName);
        Util.recursiveDelete(compilerWorkDir, true);
@@ -553,6 +555,18 @@
             */
            if (potentialFirstPerm != 0) {
              module.getCompilationState(branch).refresh(branch);
+          }
+
+          if (potentialFirstPerm + numPermsToPrecompile <  
potentialPermutations) {
+            /*
+             * On all iterations but the last, force  
retainCompilationState to
+             * be true. Otherwise, state will be discarded that is needed  
on
+             * later iterations.
+             */
+            options.setCompilationStateRetained(true);
+          } else {
+            // On the last iteration, use whatever the original setting was
+             
options.setCompilationStateRetained(originalCompilationStateRetained);
            }

            Precompilation precompilation = precompile(branch, options,  
module,

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to