From 2c038ed85f6a53e1d046038bf91b448a37bdd748 Mon Sep 17 00:00:00 2001 From: "Jesse N. Glick" Date: Mon, 26 Dec 2005 16:51:31 +0000 Subject: [PATCH] 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 --- docs/manual/CoreTasks/presetdef.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/manual/CoreTasks/presetdef.html b/docs/manual/CoreTasks/presetdef.html index 9b9aa8d2e..80c3902cd 100644 --- a/docs/manual/CoreTasks/presetdef.html +++ b/docs/manual/CoreTasks/presetdef.html @@ -146,6 +146,21 @@ called: [showmessage] message is 'Message 2' +

+It is possible to use a trick to evaluate properties when the definition is +made rather than used. This can be useful if you do not expect some +properties to be available in child builds run with +<ant ... inheritall="false">: +

+
+<macrodef name="showmessage-presetdef">
+  <attribute name="messageval"/>
+  <presetdef name="showmessage">
+    <echo>message is '@{messageval}'</echo>
+  </presetdef>
+</macrodef>
+<showmessage-presetdef messageval="${message}"/>
+

Copyright © 2003-2005 Apache Software Foundation. All rights Reserved.