ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Duncan Davidson <dun...@x180.net>
Subject Re: Need if/unless features
Date Tue, 02 Jan 2001 22:09:11 GMT
On 12/29/00 4:36 AM, "Peter Donald" <donaldp@apache.org> wrote:

> Agreed - this is a problem ant2.0 will address hopefully. Many people have
> asked for it in one way or another ... What I suggest is something like
> 
> <target name="t1" depends="t2"/>
> <target name="t2" if="execute.t2"/>
> 
> <target name="t1" if="execute.t1">
> <ant-call target="t1"/>
> </target>
> 
> It is not efficient or pretty but it does work ;)

Um, do you really mean to define the same target twice? That doesn't flow
very well.

The way that I think it should be solved is via a "execute-target" task.

<target name="main">
   <execute-target name="foo" if="property.foo"/>
</target>

<target name="foo" depends="bar, bap">..</target>

Having it as just a task means that nothing else gets done unless the
property is set to 1 or true.

.duncan

-- 
James Duncan Davidson                                        duncan@x180.net
                                                                  !try; do()


Mime
View raw message