ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vilius Vaivada" <vilius.vaiv...@chp.co.uk>
Subject Pull multiple .class files from multiple .jars into one .jar
Date Tue, 01 Mar 2011 10:43:30 GMT
Hi all,

I'm new to ant, so I might be missing something fairly obvious. My
problem:
* I have a lib/ directory full of .jar files
* I have 2 patternsets for some .class files that I want to put into two
new jar files.

After a bit of googling I have this:

<target name="foo">
  <foreach target="bar" param="jar">
    <path>
      <fileset dir="path" includes=" *.jar"/>
    </path>
  </foreach>
</target>

<target name="bar">
  <jar destfile="foo.jar">
    <zipfileset src="${jar}">
      <patternset refid="pattern_client"/>
      <patternset refid="pattern_ear"/>
    </zipfileset>
  </jar>
</target>

Obviously, it doesn't quite work (and is ugly already). I could try to
collect the .class files (zipfilesets) and jar them up afterwards
(how?). But most probably there's a much better way to do this in the
first place - please advise.

Thank you

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


Mime
View raw message