View Single Post
  #4 (permalink)  
Old 11-29-2007
jrray jrray is offline
Registered User
 
Name: J Robert Ray
Organization: Imageworks
Project: cutlist server
 
Join Date: Nov 2007
Posts: 1
Dependency problem when using --checksum

I ran into a problem with the ant dependency feature after I enabled checksums. If a built detects that only some of the slice files need to be rebuilt, my checksum class is remade from only the out of date slice files, and the class is then missing entries.

I made this patch to change the dependency tracking into an all-or-nothing rebuild, if the checksum feature is enabled.

Code:
--- ant/Slice2JavaTask.java     (revision 153092)
+++ ant/Slice2JavaTask.java     (revision 153093)
@@ -118,6 +118,7 @@
         // last updated or a slice file it depends on changed).
         //
         java.util.Vector buildList = new java.util.Vector();
+        java.util.Vector skipList = new java.util.Vector();
         java.util.Iterator p = _fileSets.iterator();
         while(p.hasNext())
         {
@@ -137,7 +138,27 @@
                 }
                 else
                 {
-                    log("skipping " + files[i]);
+                    skipList.addElement(slice);
+                }
+            }
+
+            if(   _checksum != null && _checksum.length() > 0
+               && !buildList.isEmpty())
+            {
+                //
+                // If generating a checksum, all slice files must be compiled
+                // if any are out of date so that the checksum class contains
+                // all the entities from all the slice files.
+                //
+                buildList.addAll(skipList);
+            }
+            else
+            {
+                java.util.Iterator i = skipList.iterator();
+                while(i.hasNext())
+                {
+                    File file = (File)i.next();
+                    log("skipping " + file.getName());
                 }
             }
         }

Last edited by jrray : 11-29-2007 at 04:42 PM.
Reply With Quote