Ant question

"Richard Hammer" <[email protected]>
Newsgroups gmane.org.user-groups.trijug.juglist
Message-ID <[email protected]>
In Ant, how do I loop over a FileSet? performing the same set of tasks 
on each file in the FileSet?

Background:
I have a directory full of jars which need to be signed with our 
certificate for use with Java Web Start.  But some of these jars are 
already signed, and in my experience you can't sign a jar twice, not if 
you want it to work thereafter, so first I have to unsign any jars which 
have already been signed.

This unsigning can be accomplished by removing everything in the 
meta-inf directory of the jar, and I can accomplish this on one jar 
(named subject.jar) as follows:

  <target name="removeSignature">
   <delete dir="work" />
   <unjar src="subject.jar" dest="work" />
   <delete dir="work/meta-inf" />
   <jar destfile="subject.jar" basedir="work" />
  </target>

But I would like to be able to perform those steps on each jar in
   <fileset id="libJarsList" dir="lib" includes="*.jar" />

Any suggestions?

Thank you,
Rich Hammer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.