ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: odd behavior on <target ... unless="someproperty">
Date Mon, 09 Sep 2002 18:17:20 GMT
Haven't read till the end, but by design target's run their dependencies
(targets listed in the 'depends' attribute) before evaluating the
'if'/'unless'. Confusing yes, but by design. --DD

-----Original Message-----
From: Jacob Kjome [] 
Sent: Monday, September 09, 2002 1:15 PM
To: Ant Users List
Subject: odd behavior on <target ... unless="someproperty">


I'm using Ant-1.5.1beta1.

I'm having an issue with a target running its dependencies even though
unless="someproperty" is specified on that target *and* the
"someproperty" was specified on the command line as

Here is the relevant Ant code...

        unless="subproject" >

            message="Please enter the subproject. eg...
            addproperty="subproject" />


        unless="subtarget" >

            message="Please enter the subtarget. eg...
            addproperty="subtarget" />


        depends="specify.subproject,specify.subtarget" />

        depends="" >


So, when the "check.subproject.control" gets called, it runs its
dependency first which is "", which should
skip its dependencies of "specify.subproject" and "specify.subtarget"
if the property "subprojectskip" exists which it does when entered on
the command line such as...

ant -Dsubprojectskip=true contrib

However, both the "specify.subproject" and "specify.subtarget" targets
get invoked and prompt me for input.  I want to be able to disable
prompting for input and it seems like what I'm currently doing should
properly disable it, but it doesn't seem to work.

Am I missing something here?

The other weird thing about this is that if I do the following, I
don't get prompted:

ant -Dsubproject=dbroggisch -subtarget=compile contrib

So, the "unless" on "specify.subproject" and "specify.subtarget" seem
to be honored....although they don't have dependencies so maybe if I
added dependencies I would see the same behavior of those dependencies
running when they shouldn't just like in "".

Any ideas?  Have I discovered a bug in Ant-1.5.1beta1?


Best regards,

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

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

View raw message