ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Adding absolute filenames to a jar
Date Thu, 02 Oct 2003 09:22:21 GMT
Look at the file="..." attribute on filesets.  It allows for 
single-file filesets much easier than dealing with dir/includes 
attributes.

    <fileset file="${some.absolute.file.property}"/>

	Erik


On Wednesday, October 1, 2003, at 05:33  PM, Lopez, William wrote:

> ...not tested but try this
>
> <jar destfile="goo.jar">
>   <fileset dir="/home/olhotak"
>            includes="foo.txt"/>
>   <fileset dir="/tmp"
>            includes="bar.txt"/>
> </jar>
>
> ...will these directories be relative to your build file's base 
> directory?
> If not just copy the files under the main class source dir ( use the 
> basedir
> attribute)...see the Ant Manual jar task doco.
>
> HTH,
> -Will
>
>
> -----Original Message-----
> From: Ondrej Lhotak [mailto:olhotak@sable.mcgill.ca]
> Sent: Wednesday, October 01, 2003 10:09 AM
> To: user@ant.apache.org
> Subject: Adding absolute filenames to a jar
>
>
> I'm using the <jar> task to create a jar file. The absolute pathnames 
> of the
> files to be included in the jar are in separate properties. How can I 
> get
> the <jar> task to include them? <fileset> requires a dir and a relative
> filename, and I have absolute names.
>
> For example:
> <property name="file1" location="/home/olhotak/foo.txt"/>
> <property name="file2" location="/tmp/bar.txt"/>
> <jar destfile="goo.jar">
>     <!-- How to include ${file1} and ${file2} in the jar? --> </jar>
>
> Ondrej
>
> ---------------------------------------------------------------------
> 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


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


Mime
View raw message