Browse Source

Add macrodef-solution to 'propertycopy'. Thanks Stefan

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276305 13f79535-47bb-0310-9956-ffa450edef68
master
Jan Materne 21 years ago
parent
commit
6f099c2277
2 changed files with 23 additions and 1 deletions
  1. +11
    -0
      docs/faq.html
  2. +12
    -1
      xdocs/faq.xml

+ 11
- 0
docs/faq.html View File

@@ -917,6 +917,17 @@ shell-prompt> m4 foo.m4 > foo
</pre>
<p>With AntContrib (external task library) you can do <code>
&lt;propertycopy name="prop" from="${anotherprop}"/&gt;</code>.</p>
<p>With Ant 1.6 you can simulate the AntContribs &lt;propertycopy&gt;
and avoid the need of an external library:</p>
<pre class="code">
&lt;macrodef name=&quot;propertycopy&quot;&gt;
&lt;attribute name=&quot;name&quot;/&gt;
&lt;attribute name=&quot;from&quot;/&gt;
&lt;sequential&gt;
&lt;property name=&quot;@{name}&quot; value=&quot;${@{from}}&quot;/&gt;
&lt;/sequential&gt;
&lt;/macrodef&gt;
</pre>
<p class="faq">
<a name="always-recompiles"></a>
Why does Ant always recompile all my Java files?


+ 12
- 1
xdocs/faq.xml View File

@@ -581,6 +581,17 @@ shell-prompt> m4 foo.m4 > foo
]]></source>
<p>With AntContrib (external task library) you can do <code>
&lt;propertycopy name="prop" from="${anotherprop}"/&gt;</code>.</p>
<p>With Ant 1.6 you can simulate the AntContribs &lt;propertycopy&gt;
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="${@{from}}"/>
</sequential>
</macrodef>
]]></source>
</answer>
</faq>
</faqsection>
@@ -1426,4 +1437,4 @@ mv /tmp/foo $ANT_HOME/bin/antRun
</faq>
</faqsection>

</document>
</document>

Loading…
Cancel
Save