ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <qazw...@gmail.com>
Subject Re: ANT 1.7.1 property evaluation
Date Sun, 02 May 2010 01:10:56 GMT
On Fri, Apr 30, 2010 at 1:25 PM, Shawn Castrianni> I am messing with
IA2009 which comes with a custom ant task in their iaant.jar.   The
[task] seems to use nested ant task elements called <configuration>.
Within this nested ant task elements, are sub elements that use plain
text arguments instead of xml attributes.  For example:
>
> <configuration>
>                <option1>value</option1>
>                <option2>value</option2>
> </configuration>
>
> My problem is that if I specify an ant property for these values:
> are passed directly to the custom IA2009 ant task WITHOUT being evaluated by ANT first.
 I have never needed to know the answer to this before, but:

That is very strange. I would assume that the values would be
evaluated before being passed to the custom task. Yes, the values are
passed outside of a XML attribute, which is unusual in Ant, but not
unheard of. The <echo> task also allows you to surround what you want
with <echo></echo> and that allows the parameters to get passed
through.

Try executing Ant with the debug switch to see if this gives you any
more information what is going on.

You might be able to get around this by putting this custom task
inside a macro. That way, the macro fills in the valued.

<my-ai
   option1="${option1}"
   option2="${option2}"
/>

<macrodef name="myia">
    <attribute name="option1"/>
    <attribute name="option2"/>
    <sequencial>
        <ai-custom-task>
                <configuration>
                     <option1>@{option1}</option1>
                     <option2>@{option2}</option2>
                <configuration
        </ai-custom-task>
    </sequential>
</macrodef>

-- 
David Weintraub
qazwart@gmail.com

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


Mime
View raw message