You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Scott Ellsworth <sc...@alodar.com> on 2002/08/09 23:59:11 UTC
Did we know that zipfileset does not take if/unless?
Hi, all.
I did a quick search of bugzilla and the mailing list archives, and did
not spot this one.
In a jar task, I would like to do:
<zipfileset dir="${project.work.dir}" includes="images/*"
if="jar.ignoreImages"/>
so that if there is a directory named images in the filesystem, and they
have not set jar.ignoreImages, then there will be a directory in the
resulting jar file that contains the images in that directory.
In other words, if the file system is:
foo
-source
-images
--pretty.jpg
the jar will contain
foo.jar
-images
--pretty.jpg
The above works just fine, except that the if and unless attributes of
the underlying fileset/patternset are not recognized.
(I used zipfileset so that I have access to the special zipfileset
extensions. I have things relative to the root so that I am covered if
the images directory does not exist.)
Scott
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Did we know that zipfileset does not take if/unless?
Posted by Scott Ellsworth <sc...@alodar.com>.
On Friday, August 9, 2002, at 03:50 PM, Diane Holt wrote:
> <zipfileset dir="${project.work.dir}">
> <include name="images/*" if="jar.ignoreImages"/>
> </zipfileset>
Got it in one.
> (Although I'm thinkin it should actually be 'unless' -- but hey, maybe
> it
> makes sense on your end :)
It was in my original draft, then I changed it to see whether the
problem was with "unless". Turns out no.
This has one other bennie. I can now include several directories in
this the same way, vis:
<include name="images/*" unless="jar.ignoreImages"/>
<include name="properties/*" unless="jar.ignoreProperties"/>
making exactly what we are doing somewhat clearer.
Scott
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Did we know that zipfileset does not take if/unless?
Posted by Diane Holt <ho...@yahoo.com>.
--- Scott Ellsworth <sc...@alodar.com> wrote:
> <zipfileset dir="${project.work.dir}" includes="images/*"
> if="jar.ignoreImages"/>
Try:
<zipfileset dir="${project.work.dir}">
<include name="images/*" if="jar.ignoreImages"/>
</zipfileset>
(Although I'm thinkin it should actually be 'unless' -- but hey, maybe it
makes sense on your end :)
Diane
=====
(holtdl@yahoo.com)
__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>