Browse Source

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.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268398 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 24 years ago
parent
commit
03d7f7d695
3 changed files with 29 additions and 1 deletions
  1. +9
    -0
      src/main/org/apache/tools/ant/taskdefs/Jar.java
  2. +10
    -1
      src/main/org/apache/tools/ant/taskdefs/War.java
  3. +10
    -0
      src/main/org/apache/tools/ant/taskdefs/Zip.java

+ 9
- 0
src/main/org/apache/tools/ant/taskdefs/Jar.java View File

@@ -129,4 +129,13 @@ public class Jar extends Zip {
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();
}
}

+ 10
- 1
src/main/org/apache/tools/ant/taskdefs/War.java View File

@@ -142,4 +142,13 @@ public class War extends Jar {
super.zipFile(file, zOut, vPath);
}
}
}

/**
* 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();
}
}

+ 10
- 0
src/main/org/apache/tools/ant/taskdefs/Zip.java View File

@@ -231,6 +231,8 @@ public class Zip extends MatchingTask {
}

throw new BuildException(msg, ioe, location);
} finally {
cleanUp();
}
}

@@ -525,4 +527,12 @@ public class Zip extends MatchingTask {
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() {}
}

Loading…
Cancel
Save