You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Thomas Stein <th...@email.com> on 2004/10/16 12:52:08 UTC

How to add multiple filesets at once (to a jar target) ?

I want to add a couple of files to a jar archive.
The files are spread over three different directories.
Simplified the situation is as follows:

1.) Include all files from directory ${blah} and its subdirectories
2.) Include exactly the files karl.txt and paul.txt from directory ${test}
3.) All files from directory ${myproj} (but NOT its subdirectories) except the file log.dat

Can I achieve this with ONE jar target with three filesets?
The following doesn't work. The first part is collected successfully but there
are differences with the latter two. The files from the second part are not included
whereas the files from the subdirectories are included in the third part.

How can it be done better?
(All files are existing)

    <target name="bbb" description="Build test jar file" depends="aaa">
       <jar destfile="mytest.jar">
           <fileset dir="${blah}" />
           <fileset dir="${test}" >
               <filename name="**/karl.txt" />
               <filename name="**/paul.txt" />
           </fileset> 
           <fileset dir="${myproj}" excludefile="${myproj}/log.dat" />
       </jar>
    </target>

Thomas
-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: How to add multiple filesets at once (to a jar target) ?

Posted by Kris Read <kr...@gmail.com>.
I am sure you can do it. 

However, in our own build file we find its convenient to just copy all
of the files we want in our final JAR file into a single directory,
then jar the contents of that directory.

In our case there are also other reasons to have the files copied to a
new directory, but its just an idea.

--



On Sat, 16 Oct 2004 05:52:08 -0500, Thomas Stein <th...@email.com> wrote:
> I want to add a couple of files to a jar archive.
> The files are spread over three different directories.
> Simplified the situation is as follows:
> 
> 1.) Include all files from directory ${blah} and its subdirectories
> 2.) Include exactly the files karl.txt and paul.txt from directory ${test}
> 3.) All files from directory ${myproj} (but NOT its subdirectories) except the file log.dat
> 
> Can I achieve this with ONE jar target with three filesets?
> The following doesn't work. The first part is collected successfully but there
> are differences with the latter two. The files from the second part are not included
> whereas the files from the subdirectories are included in the third part.
> 
> How can it be done better?
> (All files are existing)
> 
>     <target name="bbb" description="Build test jar file" depends="aaa">
>        <jar destfile="mytest.jar">
>            <fileset dir="${blah}" />
>            <fileset dir="${test}" >
>                <filename name="**/karl.txt" />
>                <filename name="**/paul.txt" />
>            </fileset>
>            <fileset dir="${myproj}" excludefile="${myproj}/log.dat" />
>        </jar>
>     </target>
> 
> Thomas
> --
> ___________________________________________________________
> Sign-up for Ads Free at Mail.com
> http://promo.mail.com/adsfreejump.htm
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org