ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis GALIEGUE <...@one2team.com>
Subject Re: isset within macrodef...
Date Mon, 05 Oct 2009 07:34:12 GMT
On Mon, Oct 5, 2009 at 09:28, EetieD <khn@leanapps.com> wrote:
>
> Hi,
>
> I am trying to use "<isset" within macrodef to test for an attribute that
> has been set. When I use the code below, it never comes into the part after
> <isset property="valueFile", even if valueFile is set. What should I use
> instead of "<isset property=.."?
>
> Thanks for helping.
>
>
> <macrodef name="checkcheck">
>        <attribute name="valueFile" default="" />
>        <attribute name="valueText" default="" />
>        <sequential>
>                <if><isset property="valueFile" /><then>
>                        <!-- it never comes here, even if valueFile is
set -->
[...]
>

Attributes within macros are not properties!

You should use:

<macrodef name="checkcheck">
    <attribute name="valueFile" default="NOTSET"/>
    <sequential>
        <if>
            <not>
                <equals arg1="@{valuefile}" arg2="NOTSET"/>
            </not>
<!-- etc etc - note, @{valuefile}, not ${valuefile} -->



-- 

Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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


Mime
View raw message