• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

multiple jar creation for multiple directories

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my src area i have some 10 packages of which I am trying to create 10 different jars, currently in the ant script I have 10 such jar creation task, except the jar name in the task input directory output directory every thing is same, IS there a way instead of having 10 different task, can I have the packages names in properties file and pass them into script. Meaning my ant script will have only one jar creation script but gets the package names from properties file and do this in a loop. Any thoughts??
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could do this with an <antcall> for each JAR. You might also want to use one of the looping mechanisms available in the ant-contrib extensions.
http://ant-contrib.sourceforge.net/
 
senthil kumar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply, but I also tried below code and it worked like a charm.

<macrodef name="buildJavaJar" >
<attribute name="build.directory" />
<sequential>
<jar jarfile="${build.dir}/@{build.directory}.jar" basedir="${build.classes.dir}/@{build.directory}" />
</sequential>
</macrodef>

<target name="abc.jar" depends="compile">
<buildEjbJar build.directory="abc" />
</target>

<target name="def.jar" depends="compile">
<buildEjbJar build.directory="def" />
</target>
 
Could you hold this puppy for a sec? I need to adjust this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic