jhm 2004/04/13 23:40:08
Modified: xdocs faq.xml
docs faq.html
Log:
Add macrodef-solution to 'propertycopy'. Thanks Stefan
Revision Changes Path
1.52 +12 -1 ant/xdocs/faq.xml
Index: faq.xml
===================================================================
RCS file: /home/cvs/ant/xdocs/faq.xml,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- faq.xml 15 Mar 2004 11:23:48 -0000 1.51
+++ faq.xml 14 Apr 2004 06:40:08 -0000 1.52
@@ -581,6 +581,17 @@
]]></source>
<p>With AntContrib (external task library) you can do <code>
<propertycopy name="prop" from="${anotherprop}"/></code>.</p>
+ <p>With Ant 1.6 you can simulate the AntContribs
<propertycopy>
+ and avoid the need of an external library:</p>
+ <source><![CDATA[
+<macrodef name="propertycopy">
+ <attribute name="name"/>
+ <attribute name="from"/>
+ <sequential>
+ <property name="@{name}" value="[EMAIL PROTECTED]"/>
+ </sequential>
+</macrodef>
+]]></source>
</answer>
</faq>
</faqsection>
@@ -1426,4 +1437,4 @@
</faq>
</faqsection>
-</document>
+</document>
\ No newline at end of file
1.96 +11 -0 ant/docs/faq.html
Index: faq.html
===================================================================
RCS file: /home/cvs/ant/docs/faq.html,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- faq.html 15 Mar 2004 11:23:48 -0000 1.95
+++ faq.html 14 Apr 2004 06:40:08 -0000 1.96
@@ -917,6 +917,17 @@
</pre>
<p>With AntContrib (external task library) you can
do <code>
<propertycopy name="prop" from="${anotherprop}"/></code>.</p>
+ <p>With Ant 1.6 you can simulate the AntContribs
<propertycopy>
+ and avoid the need of an external library:</p>
+ <pre class="code">
+<macrodef name="propertycopy">
+ <attribute name="name"/>
+ <attribute name="from"/>
+ <sequential>
+ <property name="@{name}" value="[EMAIL
PROTECTED]"/>
+ </sequential>
+</macrodef>
+</pre>
<p class="faq">
<a name="always-recompiles"></a>
Why does Ant always recompile all my Java files?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]