ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@gmail.com>
Subject Re: How to merge jars and directories specified by path resource into a single jar
Date Fri, 14 Feb 2014 07:45:11 GMT
The problem is that, presumably, you want the classes beneath the
class.dirs elements to be added to the jar relative to each element. Off
the top of my head it occurs to me that you could iterate using antcontrib
<for> and update the jar for each directory.

HTH,
Matt
On Feb 13, 2014 3:27 PM, "Edwin Castro" <0ptikGhost@gmx.us> wrote:

> I have a handful of paths defined as
>
> <path id="class.libs">
>     <pathelement location="blah/blah.jar"/>
>     ...
> </path>
>
> <path id="class.dirs">
>     <pathelement location="blah/blah"/>
>     ...
> </path>
>
> <path id="class.path">
>     <pathelement refid="class.libs"/>
>     <pathelement refid="class.dirs"/>
> </path>
>
> I have a need to merge the .class files in the jars and directories
> specified by class.libs and class.dirs into a single jar. I can merge
> the jars using
>
> <pathconvert property="class.libs" refid="class.libs"/>
>
> <jar destfile="${jar.file}">
>     <fileset dir="${classes.dir}" includes="*.class"/>
>     <restrict>
>         <name name="**/*.class"/>
>         <archives>
>             <zips>
>                 <path path="${class.libs}"/>
>             </zips>
>         </archives>
>     </restrict>
> </jar>
>
> How do I include all of the .class files in the directories specified in
> class.dirs in ${jar.file} as well?
>
> --
> Edwin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message