ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Irvine" <>
Subject RE: "Recursiveness" / property already used in a "generic" build...
Date Fri, 16 Jun 2006 00:04:57 GMT
Well, I managed to sort this out using the <subant> task and <propertyset>
to pass only the required properties along.

No more hard-coded folder lists or duplicated build files now!  




From: Greg Irvine [] 
Sent: Thursday, 15 June 2006 4:08 PM
To: 'Ant Users List'
Subject: "Recursiveness" / property already used in a "generic" build...


Hi all.


I'm trying to write a generic build file that uses a properties file to
inform the generic build file of which subprojects to build. 


So, the build.xml loads a which has a property buildorder
which is a list of subprojects in that directory to build, and this order is
specific due to dependencies.


I have this working just fine (generally).


This works if multiple folders have the same level do the same thing.  I'm
assuming this works because once the explicit call to build Folder1 returns,
any properties set in Folder1 or lower are cleared, so when Folder2 build
loads the the buildorder property set in Folder1 has been


Parent -> Build.xml explicitly calls build on Folder1 and Folder2

          Folder1 -> build.xml + (buildorder=SubFolder1,
SubFolder2, SubFolder3)

                      -> SubFolder1

                      -> SubFolder2

                      -> SubFolder3

          Folder2-> build.xml + (buildorder=SubFolder1,
SubFolder2, SubFolder3)

                      -> SubFolder1

                      -> SubFolder2

                      -> SubFolder3


The problem I have is that if one of those projects is in fact a folder that
itself has a list of projects to build I find the property buildorder is
already set by the parent build file and fails trying to build the same
stuff again but in the subfolder.

          Folder1 -> build.xml + (buildorder=SubFolder1,
SubFolder2, SubFolder3)

                      -> SubFolder1 -> build.xml +
(buildorder=SubSubFolder1, SubSubFolder2, SubSubFolder3)

                                      -> SubSubFolder1

                                      -> SubSubFolder2

                                      -> SubSubFolder3

                      -> SubFolder2

                      -> SubFolder3


i.e. Folder1 build loads buildorder from and calls
build.xml in SubFolder1 (as specific in which tries to
load it's which tries to define buildorder and of course

Hence, the build in SubFolder1 tries to build SubFolder1, SubFolder2,
SubFolder3 as defined by the parent buildorder again instead of the "new"


Any suggestions on how to get around this would be great.


Thanks and regards,




Ps. If you REALLY think Maven is a better option let me know and I'll just
have to do an ROI analysis.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message