File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes need ANT help Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "need ANT help" Watch "need ANT help" New topic
Author

need ANT help

Daniil Sosonkin
Ranch Hand

Joined: Jan 15, 2004
Posts: 76
Hi,
I'm trying to write an ANT build.xml and having sort of a problem. I have several related targets which all do the same basic actions which only differ depending on few paramers. For example, I have a target that copies files from dir1 to target1 and creates application1.jar then I have a target that does the same only it copies files from dir2 to target1 and creates application2.jar and so on etc. To identify which application to build and where to copy files from I use <property name="title" value="1"/> or value="2"/> etc...
I have about 10 or so of those targets. What I wanted to do is create one target which will compile all those sequentially. I thought of creating a blank target which depends on all those but I discovered that once you set property value, you can't change it. Which is a problem. Does anyone know how to solve this issue?
Thank you,
Daniil
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11945
You could look into using <antcall> and give parameters to that.


Author of Test Driven (Manning Publications, 2007) [Blog] [HowToAskQuestionsOnJavaRanch]
Daniil Sosonkin
Ranch Hand

Joined: Jan 15, 2004
Posts: 76
thank you very much! it worked like a charm
 
 
subject: need ANT help
 
Threads others viewed
Reading the property value from custom task inside calling target
AndroMDA using Ant
ANT is lame... so limited :(
Submission Jar: test case + Ant build script
Executing multiple targets in subprojects
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture