You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Steve Cohen <St...@ignitesports.com> on 2001/12/20 20:25:08 UTC
jar task question
I wish to create a jar after a build nested at a particular root, but
not including every directory under this root. I know I could probably
do this
with <excludes> in a fileset but I would rather do it with <includes>;
that way if other stuff is added, I don't have to change my build
file.
However I find this doesn't work as I want.
If I define this operation thus
<jar jarfile="${dist.dir}/lib/${project.name}-lite.jar"
basedir= ${build.classes} compress="yes">
<fileset
dir="${build.classes}/com/whatever/somepackage" includes="**/*.*" />
<fileset
dir="${build.classes}/com/whatever/anotherpackage" includes="**/*.*" />
</jar>
I wind up with a bigger jar than if I specified no filesets. Everything
is included, my includes twice.
If I do it this way
<jar jarfile="${dist.dir}/lib/${project.name}-lite.jar"
compress="yes">
<fileset
dir="${build.classes}/com/whatever/somepackage" includes="**/*.*" />
<fileset
dir="${build.classes}/com/whatever/anotherpackage" includes="**/*.*" />
</jar>
I get just the files I want but they are not pathed correctly.
This to me is counter-intuitive. I should be able to specify a fileset
using either exclude or include syntax and get the same results.
Am I doing something wrong.
-----------------------------------------------------------------
Steve Cohen
Sr. Software Engineer
Ignite Sports, Inc.
stevec@ignitesports.com
Re: jar task question
Posted by Diane Holt <ho...@yahoo.com>.
Does:
<jar jarfile="${dist.dir}/lib/${project.name}-lite.jar"
basedir="${build.classes}"
compress="yes">
<include name="com/whatever/somepackage/**/*.*"/>
<include name="com/whatever/anotherpackage/**/*.*"/>
</jar>
do what you need? (I'm not sure what correct "pathing" you want.)
Diane
=====
(holtdl@yahoo.com)
__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>