ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig Longman <cra...@begeek.com>
Subject Re: global properties
Date Thu, 20 Sep 2001 16:12:35 GMT
On Thu, 2001-09-20 at 07:54, Conor MacNeill wrote:
> Why not just do without the antcall's altogether - something like this, 
> perhaps

i had considered doing almost exactly this, and aside from the desire to
not use the depends in such a way, it was appearing that the antcall was
just not going to be up to snuff.  my main concern was that you have no
direct control over the ORDER of the depends.  in this example, the
default2 assumes the responsibility of the 'init' target, and absolutely
has to be run before the other targets.

so, i was doing it this way but it was not appearing to work.  so, i
tried your suggestion, although i couldn't see any difference.  and
guess what?  the <fail.../> is never called!  it almost seems like the
decision to run or not run a target is made before any one of the
depends is executed.

any idea why this doesn't do the right thing?

aside from my real problem with how to make a target called by antcall
set a property that other targets will be able to see.

> <project name="test" default="default2">
> 
> <target name="default1">
>          <property name="use.target1" value="true"/>
>          <property name="use.target2" value="true"/>
> </target>
> 
> <target name="default2" depends="default1, target1, target2">
>          <echo message="${prop2}"/>
> </target>
> 
> <target name="target1" depends="check" if="use.target1">
>          <property name="prop1" value="test1a"/>
>          <property name="prop2" value="test2a"/>
> </target>
> 
> <target name="target2" depends="check" if="use.target2">
>          <property name="prop1" value="test1b"/>
>          <property name="prop2" value="test2b"/>
> </target>
> 
> <target name="check" if="prop1">
>          <fail message="prop1 already set"/>
> </target>
> 
> </project>


cheers,

     CraigL->Thx();



Mime
View raw message