Browse Source

Mentioning workaround from #38040 re. eagerly evaluated properties.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@359077 13f79535-47bb-0310-9956-ffa450edef68
master
Jesse N. Glick 19 years ago
parent
commit
2c038ed85f
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      docs/manual/CoreTasks/presetdef.html

+ 15
- 0
docs/manual/CoreTasks/presetdef.html View File

@@ -146,6 +146,21 @@ called:
[showmessage] message is 'Message 2'
</pre>
</blockquote>
<p>
It is possible to use a trick to evaluate properties when the definition is
<em>made</em> rather than used. This can be useful if you do not expect some
properties to be available in child builds run with
<code>&lt;ant ... inheritall="false"&gt;</code>:
</p>
<blockquote><pre class="code">
&lt;macrodef name="showmessage-presetdef"&gt;
&lt;attribute name="messageval"/&gt;
&lt;presetdef name="showmessage"&gt;
&lt;echo&gt;message is '@{messageval}'&lt;/echo&gt;
&lt;/presetdef&gt;
&lt;/macrodef&gt;
&lt;showmessage-presetdef messageval="${message}"/&gt;
</pre></blockquote>
<hr></hr>
<p align="center">Copyright &copy; 2003-2005 Apache Software
Foundation. All rights Reserved.</p>


Loading…
Cancel
Save