Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ant build files and where to put them

 
Wendy Gibbons
Bartender
Posts: 1110
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18012
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic