This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 15964
    
  19

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
 
Similar Threads
File structure is detached from SVN repository.
in the javac compilation output i need *.properties file. how?
How Do You Set Up Your Dev Environment?
Maven - copying properties file from SVN to Linux based App Server machines
Problem using import task of svnAnt