You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by David Weintraub <qa...@gmail.com> on 2010/05/02 03:10:56 UTC

Re: ANT 1.7.1 property evaluation

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