ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: how to (usably) include one JAR in another?
Date Thu, 01 Dec 2005 16:29:59 GMT
--- Thomas L Roche <tlroche@us.ibm.com> wrote:
[SNIP]
> I tried it, but it just copies:
> 
> <target name="project.jar" depends="init, compile" 
>   description="Build project.jar">
>   <jar 
>     jarfile="${build.result.folder}/project.jar">
>     <fileset dir="${compile.outdir}">
>         <include name="**/*.class"/>
>     </fileset>
>     <zipfileset dir="${lib.dir}">
>         <include name="**/*.jar"/>
>     </zipfileset>
>     <manifest>
>        <attribute name="Main-Class"
> value="foo.bar.project"/>
>     </manifest>
>   </jar>
> </target>
> 

Firstly, you're using zipfileset incorrectly.

Next, If you don't know all the jars, you'll have to
iterate.  I would suggest you use ant-contrib <for>: 
for each file @{f} in <fileset dir="${lib.dir}"
includes="**/*.jar" />, add <zipfileset src="@{f}" />
to ${build.result.folder}/project.jar with <jar
update="true" /> (not tested).

This is an interesting use-case for which we can
hopefully come up with a better solution using
resource collections in Ant 1.7

HTH,
Matt


		
__________________________________ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free. 
http://music.yahoo.com/unlimited/

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


Mime
View raw message