ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
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 [mailto:hoju@visi.com] 
Sent: Monday, September 09, 2002 1:15 PM
To: Ant Users List
Subject: odd behavior on <target ... unless="someproperty">


Hi,

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
"-Dsomeproperty=true".

Here is the relevant Ant code...

    <target
        name="specify.subproject"
        unless="subproject" >

        <input
            message="Please enter the subproject. eg...
[all|dbroggisch|other...]:"
            addproperty="subproject" />

    </target>

    <target
        name="specify.subtarget"
        unless="subtarget" >

        <input
            message="Please enter the subtarget. eg...
[all|clean|compile|install|remove]:"
            addproperty="subtarget" />

    </target>

    <target
        name="specify.property.control"
        unless="subprojectskip"
        depends="specify.subproject,specify.subtarget" />

    <target
        name="check.subproject.control"
        depends="specify.property.control" >

        ....
        ....
        ....
    </target>

So, when the "check.subproject.control" gets called, it runs its
dependency first which is "specify.property.control", 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 "specify.property.control".

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

Jake

-- 
Best regards,
 Jacob                          mailto:hoju@visi.com


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

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


Mime
View raw message