jQuery in Action, 3rd edition
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
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

ant build files and where to put them

Wendy Gibbons

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: 17417

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link: http://aspose.com/file-tools
subject: ant build files and where to put them
It's not a secret anymore!