Magesh Umasankar wrote:
From: Steve Loughran <steve_l () iseran ! com>
Date: 2004-06-17 9:27:18
I am now convinced we need local properties; without
it macrodef doesnt work fully.
Why do you need them? I typically append an attribute
value to a property name to get the unique property that
I want.
I have had reasonable success with a <break> task[*]
that compensates for lack of if/unless/depends on
macros.
I see three places where it/unless attributes could be added to macrodef.
1) at the macrodef definition.
<macrodef name="showdir" if="on.windows">
<attribute name="dir"/>
<sequential>
<ac:shellscript script="cmd.exe" tmpsuffix=".bat">
<ac:value="/c"/>
<ac:value="call"/>
dir @{dir}
</ac:shellscript>
</sequential>
</macrodef>
<macrodef name="showdir" if="on.linux">
<sequential>
<ac:shellscript script="bash">
ls -rlta @{dir}
</ac:shellscript>
</sequential>
</macrodef>
2) on the sequential element:
<macrodef name="ejb">
<attribute name="module">
<sequential unless="@{module}-uptodate">
<...>
</sequential>
</macrodef>
3) at the macrodef use:
<ejb module="x" unless="x-uptodate"/>
Peter
Cheers,
Magesh
[*]
Syntax: <break [if|unless]="property.name"/>
How does this work?
Peter
<macrodef name="check-and-do-ejb">
<attribute name="module">
<sequential>
<check-ejb module="@{module}"/>
<break if="@{module}-uptodate"/>
<ejb module="@{module}"/>
</sequential>
</macrodef>
(or)
<macrodef name="ejb">
<attribute name="module">
<sequential>
<break if="@{module}-uptodate"/>
<...>
</sequential>
</macrodef>
<macrodef name="check-and-do-ejb">
<attribute name="module">
<sequential>
<check-ejb module="@{module}"/>
<ejb module="@{module}"/>
</sequential>
</macrodef>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]