ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Birtley" <>
Subject RE: Passing a property from sub project to main project
Date Sun, 27 Jul 2003 21:24:11 GMT
> But isn't the behavior of antcall is same as ant, meaning it won't be
> pass the property back if the target was invoked using antcall. How
> you
> guys invoking your target, using something like
> <target name="main" depends="subprojectA targets, subprojectB targets
" />
Correct.  Using entity references effectively creates a huge single XML
file (from the Ant perspective).

This means that you just reference the targets directly, without using
<ant> or <antcall> and that would require some changes in your logic
(the way we used to have to do it before <if>):

	<target name="main" depends="installSoftwareA">

	 ! This is possibly in a subscript
	 ! -->
	<target name="installSoftwareA" if="installSoftwareA">
		 ! install the software
		 ! -->

		 ! Set some property to indtcate that the software
		 ! has been installed, or where it has been installed,
		 ! or the version or whatever
		 ! -->

Like most things in Ant, there are several ways of cracking a particular
nut and there are trade-offs for pretty much all of them.

> In this case the subprojects A will be invoked in a new project
meaning I
> can not get the property back whatever was defined by project A
If you absolutely must have separate build files then, as Antoine says,
you need to persist the properties that you want to set outside of the
build script, in a properties file for instance.

Good luck.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message