You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2001/01/04 13:37:20 UTC

cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Jar.java War.java Zip.java

bodewig     01/01/04 04:37:20

  Modified:    src/main/org/apache/tools/ant/taskdefs Jar.java War.java
                        Zip.java
  Log:
  Reset the global flags that say we have a MANIFEST.MF/web.xml after
  execute has been run.
  
  <jar> would print a warning in Ant's own bootstrap when it zipped
  ant.jar for the second time.
  
  Revision  Changes    Path
  1.13      +9 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java
  
  Index: Jar.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Jar.java	2001/01/03 14:18:30	1.12
  +++ Jar.java	2001/01/04 12:37:20	1.13
  @@ -129,4 +129,13 @@
               super.zipFile(file, zOut, vPath);
           }
       }
  +
  +    /**
  +     * Make sure we don't think we already have a MANIFEST next time this task
  +     * gets executed.
  +     */
  +    protected void cleanUp() {
  +        manifestAdded = false;
  +        super.cleanUp();
  +    }
   }
  
  
  
  1.8       +10 -1     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/War.java
  
  Index: War.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/War.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- War.java	2001/01/03 14:18:31	1.7
  +++ War.java	2001/01/04 12:37:20	1.8
  @@ -142,4 +142,13 @@
               super.zipFile(file, zOut, vPath);
           }
       }
  -}
  \ No newline at end of file
  +
  +    /**
  +     * Make sure we don't think we already have a web.xml next time this task
  +     * gets executed.
  +     */
  +    protected void cleanUp() {
  +        descriptorAdded = false;
  +        super.cleanUp();
  +    }
  +}
  
  
  
  1.25      +10 -0     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Zip.java
  
  Index: Zip.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Zip.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- Zip.java	2000/12/18 15:53:52	1.24
  +++ Zip.java	2001/01/04 12:37:20	1.25
  @@ -231,6 +231,8 @@
               }
   
               throw new BuildException(msg, ioe, location);
  +        } finally {
  +            cleanUp();
           }
       }
   
  @@ -525,4 +527,12 @@
               addFiles(ds, zOut, prefix, fullpath);
           }
       }
  +
  +    /**
  +     * Do any clean up necessary to allow this instance to be used again.
  +     *
  +     * <p>When we get here, the Zip file has been closed and all we
  +     * need to do is to reset some globals.</p>
  +     */
  +    protected void cleanUp() {}
   }