ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1182250 - /ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java
Date Wed, 12 Oct 2011 08:07:40 GMT
Author: bodewig
Date: Wed Oct 12 08:07:40 2011
New Revision: 1182250

URL: http://svn.apache.org/viewvc?rev=1182250&view=rev
Log:
Use proper out-of-dateness check

Modified:
    ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java

Modified: ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java
URL: http://svn.apache.org/viewvc/ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java?rev=1182250&r1=1182249&r2=1182250&view=diff
==============================================================================
--- ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java
(original)
+++ ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java
Wed Oct 12 08:07:40 2011
@@ -27,6 +27,9 @@ import org.apache.tools.ant.BuildExcepti
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.Task;
 import org.apache.tools.ant.types.Environment;
+import org.apache.tools.ant.types.resources.FileResource;
+import org.apache.tools.ant.types.selectors.SelectorUtils;
+import org.apache.tools.ant.util.FileUtils;
 
 /**
  * Task to "normalize" a JAR archive so that a signature applied to it
@@ -83,7 +86,13 @@ public class Pack200Normalize extends Ta
             throw new BuildException("srcFile attribute is required");
         }
         if (force ||
-            (dest != null && dest.lastModified() <= src.lastModified())) {
+            (dest != null
+             && SelectorUtils.isOutOfDate(new FileResource(src),
+                                          new FileResource(dest),
+                                          FileUtils.getFileUtils()
+                                          .getFileTimestampGranularity())
+             )
+            ) {
             if (dest != null) {
                 log("Normalizing " + src + " to " + dest + ".");
             } else {



Mime
View raw message