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 ant build files and where to put them Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ant build files and where to put them" Watch "ant build files and where to put them" New topic
Author

ant build files and where to put them

Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

I am storing all the project specific ant buildfiles inside the top level dir of each project (in svn). I have a master buildfile stored oustide of svn on my machine.
This was working well but now i want properties files. So i have to have a copy task before each ant call to copy the properties file, as having one in each project is pointless.
Is there a standard way of doing this? I have tried searching the web, but either there is nothing or i don't know the terms.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

I don't actually copy properties files, but since Ant has a "first definition wins" policy, I have set up Ant buildfiles to run a hierarchy of property file locations, much as Unix/Linux apps do. That usually means I attempt to pull build properties from the following sequence of locations:

1. Machine global properties
2. build.properties file in my home directory.
3. project properties file in my home directory ("projectname.properties")
4. project properties file in the project itself.

And, of course, for special occasions, the ant command-line trumps all.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ant build files and where to put them