ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sushil Sureka" <>
Subject Re: Passing a property from sub project to main project
Date Sun, 27 Jul 2003 20:58:42 GMT
But isn't the behavior of antcall is same as ant, meaning it won't be able
pass the property back if the target was invoked using antcall. How are you
guys invoking your target, using something like

<target name="main" depends="subprojectA targets, subprojectB targets " />

I guess in this case it will work. Mine is more logic oriented where in if a
property is defined, then invoke the target

<target name=main>
        <isset property="installSoftwareA" />
            <antcall target=subprojectA targets />

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 targets.


----- Original Message ----- 
From: "John Birtley" <>
To: "Ant Users List" <>
Sent: Sunday, July 27, 2003 3:13 PM
Subject: RE: Passing a property from sub project to main project

We encountered a similar problem (multie sub-projects all having to hang
off a master build) and solved the problem by having all of the
sub-projects in subscripts, but only at the <target>...</target> level,
and then using XML-level includes.

Not only did this take care of `passing' properties between subtasks and
the main task, but it also took care of dependencies in the sub-projects
- making sure each target was only invoked once.

Another added bonus of doing this is that it allows you to build up
`libraries' of reusable tasks that you can just cut and paste the entity
references into build scripts.

As an example:


<project name="foo" basedir="." Default="all">

! XML entity references for the subscripts
! -->
<!DOCTYPE project [

! Include the sub-projects
! -->

<target name="all" depends="sub1, sub2">

<target name="sub1">

<target name="sub2">

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

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

View raw message