ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy Lambert <anto...@gmx.de>
Subject Re: deep-if/deep-unless
Date Tue, 15 Dec 2009 13:28:59 GMT
Stefan Bodewig wrote:
> On 2009-12-14, Antoine Levy Lambert <antoine@gmx.de> wrote:
>
>   
>> I have never thought about how this could be implemented and how much
>> work it is. It is probably a non-trivial addition because it means
>> that the list of targets to execute and their order will change
>> dynamically during the build depending upon how properties evaluate at
>> run time.
>>     
>
> If you made it fully dynamic, yes, and there are probably a lot of edge
> cases to consider.  In your construct
>
>   
>> <target name="foo" depends="bar" deep-if="someproperty"/>
>>     
>
> when would you evaluate someproperty?  Before bar is scheduled?  
Yes, I was thinking of evaluating someproperty before bar is scheduled.
> If you
> evaluate it when foo is about to execute it will be too late since bar
> has already been run.
>
> If we restricted deep-if to properties/conditions that can be evaluated
> at parser time, then the dependency tree wouldn't change at runtime and
> such a change wouldn't have as big an impact as a truely dynamic
> solution.
>   
I would go for the fully dynamic solution. This would work for 
situations like
<project name="get-all-from-oven" default="get-all-from-oven">
<target name="get-bread-from-oven" 
depends="get-oven-gloves,open-oven-door" 
deep-unless="bread-already-onthetable"/>
<target name="get-cake-from-oven" 
depends="get-oven-gloves,open-oven-door" 
deep-unless="cake-already-onthetable"/>
<target name="get-all-from-oven" 
depends="check-what-is-on-thetable,get-bread-from-oven,get-cake-from-oven,close-oven-door,remove-oven-gloves"/>
.... various subtargets go here
</project>


Antoine


> Stefan
>   


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


Mime
View raw message