Author: bodewig
Date: Wed Nov 12 04:17:59 2008
New Revision: 713354
URL: http://svn.apache.org/viewvc?rev=713354&view=rev
Log:
merge changes from import.html
Modified:
ant/core/trunk/docs/manual/CoreTasks/include.html (contents, props
changed)
Modified: ant/core/trunk/docs/manual/CoreTasks/include.html
URL:
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/include.html?rev=713354&r1=713353&r2=713354&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/include.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/include.html Wed Nov 12 04:17:59 2008
@@ -189,6 +189,9 @@
<h3>How is <a href="import.html"><import></a> different
from <include>?</h3>
+<p>The short version: Use import if you intend to override a target,
+ otherwise use include.</p>
+
<p>When using import the imported targets are available by up to two
names. Their "normal" name without any prefix and potentially with
a prefixed name (the value of the as attribute or the imported
@@ -201,16 +204,16 @@
remains unchanged, i.e. it uses "normal" names and allows you to
override targets in the dependency list.</p>
-<p>When using include, the included target's depends attribute is
- rewritten so that prefixed names are used. This allows writers of
- the included file to control which target is invoked as part of the
- dependencies.</p>
+<p>When using include, the included targets cannot be overridden and
+ their depends attributes are rewritten so that prefixed names are
+ used. This allows writers of the included file to control which
+ target is invoked as part of the dependencies.</p>
<p>It is possible to include the same file more than once by using
different prefixes, it is not possible to import the same file more
than once.</p>
-<p>Use import if you intend to override a target, otherwise use include.</p>
+<h4>Examples</h4>
<p><i>nested.xml</i> shall be:</p>
@@ -229,43 +232,53 @@
<p>When using import like in</p>
<pre>
-<project>
+<project default="test">
<target name="setUp">
<property name="prop" value="in importing"/>
</target>
<import file="nested.xml" as="nested"/>
+
+ <target name="test" depends="nested.echo"/>
</project>
</pre>
-<p>Running the target <i>nested.echo</i> will emit:
+<p>Running the build file will emit:
<pre>
setUp:
nested.echo:
[echo] prop has the value in importing
+
+test:
+
</pre>
<p>When using include like in</p>
<pre>
-<project>
+<project default="test">
<target name="setUp">
<property name="prop" value="in importing"/>
</target>
<include file="nested.xml" as="nested"/>
+
+ <target name="test" depends="nested.echo"/>
</project>
</pre>
-<p>Running the target <i>nested.echo</i> will emit:
+<p>Running the target build file will emit:
<pre>
nested.setUp:
nested.echo:
[echo] prop has the value in nested
+
+test:
+
</pre>
<p>and there won't be any target named "echo" on the including build file.</p>
Propchange: ant/core/trunk/docs/manual/CoreTasks/include.html
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Nov 12 04:17:59 2008
@@ -0,0 +1 @@
+/ant/core/trunk/docs/manual/CoreTasks/import.html:713353