ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sushil Sureka" <sushil_sur...@hotmail.com>
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>
    <if>
        <isset property="installSoftwareA" />
        <then>
            <antcall target=subprojectA targets />
   <if>
....

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.

Thanks
Sushil



----- Original Message ----- 
From: "John Birtley" <John.Birtley@apollosoft.net>
To: "Ant Users List" <user@ant.apache.org>
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:

build.xml

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

<!--
! XML entity references for the subscripts
! -->
<!DOCTYPE project [
<!ENTITY SubProject1 SYSTEM
"subscripts/subproject1.xml">
<!ENTITY SubProject2 SYSTEM
"subscripts/subproject2.xml">
]>

<!--
! Include the sub-projects
! -->
&SubProject1;
&SubProject2;

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


subscripts/subproject1.xml:
<target name="sub1">
</target>


subscripts/subproject2.xml:
<target name="sub2">
</target>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message