DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19523>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19523

zip/unzip should have the capability to use a mapper





------- Additional Comments From [EMAIL PROTECTED]  2003-05-02 01:07 -------
Simon,
Let me explain. The only reason I marked your request as a duplicate of mine 
(and not the other way around, as would have been natural) is because I have 
expanded on the original by adding a request for zip to honor selectors and I 
was afraid that this would get lost. Sorry, I know that this procedure was 
less than polite. 

In addition, I have provided an implementation of both features, so I am 
hoping that this way there is more of a chance that our requests will get into 
the codebase. 

If you wan't to try out my code, here is what you have to do:
1. Get the source.
2. Copy the class org.apache.tools.ant.taskdefs.Zip to a package of your own.
3. Fix the baseclass reference by importing it.
4. Replace the method addResources with the one I have supplied.
5. Add the rest of the code I have supplied to the class.
6. Compile it and place it in a jar, say ext.jar
7. In your build file add <taskdef name="zipx" classname="your.package.Zip" 
classpath="ext.jar"/>
8. Use <zipx ...> instead of <zip...>. You can now use this with a mapper as 
in your example.

I had to use this technique instead of extending the original Zip task because 
the key method (addResources) is final.

On second examination your request may require a little more work, because the 
nested filesets would have to allow mapper. My version is simpler, the 
question is would that satisfy you? In my version there can be only one mapper 
per zip being built, in your version one could use several filesets, each with 
its own mapper, so it is more general. However, in practice, allowing only the 
single mapper, the same result can be achieved by using more than one zip task 
and spcifying update="yes" on all but the first. This of course is less 
elegant than having multiple mappers.

Reply via email to