Browse Source

Update example in documentation

Submitted by:	David Walend <dwalend@eecs.tufts.edu>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267845 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 25 years ago
parent
commit
98977466d8
1 changed files with 38 additions and 30 deletions
  1. +38
    -30
      docs/index.html

+ 38
- 30
docs/index.html View File

@@ -21,9 +21,10 @@
<li>Conor MacNeill (<a href="mailto:conor@cortexebusiness.com.au">conor@cortexebusiness.com.au</a>)</li>
<li>Stefano Mazzocchi (<a href="mailto:stefano@apache.org">stefano@apache.org</a>)</li>
<li>Sam Ruby (<a href="mailto:rubys@us.ibm.com">rubys@us.ibm.com</a>)</li>
<li>Dave Walend (<a href="mailto:dwalend@cs.tufts.edu">dwalend@cs.tufts.edu</a>)</li>
</ul>

<p>Version 1.2 - 2000/07/26</p>
<p>Version 1.2 - 2000/07/27</p>

<hr>
<h2>Table of Contents</h2>
@@ -350,53 +351,60 @@ task attributes. This is done by placing the property name between
<p>If there is a property called &quot;builddir&quot; with the value
&quot;build&quot;, then this could be used in an attribute like this: &quot;${builddir}/classes&quot;.
This is resolved as &quot;build/classes&quot;.</p>
<h3>Token Filters</h3>
<p>A project can have a set of tokens that might be automatically expanded if
found when a file is copied, when the filtering-copy behavior is selected in the
tasks that support this. These might be set in the buildfile
by the <a href="#filter">filter task</a>.&nbsp;</p>
<p>Since this can be a very harmful behavior, the tokens in the files <b>must</b>
be of the form<i> @token@</i> where <i>token</i> is the token name that is set
in the filter task. This token syntax matches the syntax of other build systems
that perform such filtering and remains sufficiently orthogonal to most
programming and scripting languages, as well with documentation systems.</p>
<p>Note: in case a token with the format @token@ if found in a file but no
filter is associated with that token, no changes take place. So, no escaping
method is present, but as long as you choose appropriate names for your tokens,
this should not cause problems.</p>
<h3>Examples</h3>
<h3>Example</h3>
<blockquote>
<pre>&lt;project name=&quot;foo&quot; default=&quot;dist&quot; basedir=&quot;.&quot;&gt;
&lt;target name=&quot;init&quot;&gt;
&lt;tstamp/&gt;
&lt;property name=&quot;build&quot; value=&quot;build&quot; /&gt;
&lt;property name=&quot;dist&quot; value=&quot;dist&quot; /&gt;
&lt;filter token=&quot;version&quot; value=&quot;1.0.3&quot; /&gt;
&lt;filter token=&quot;year&quot; value=&quot;2000&quot; /&gt;
&lt;/target&gt;
<pre>
&lt;project name=&quot;MyProject&quot; default=&quot;dist&quot; basedir=&quot;.&quot;&gt;

&lt;target name=&quot;prepare&quot; depends=&quot;init&quot;&gt;
&lt;!-- set global properties for this build --&gt;
&lt;property name=&quot;src&quot; value=&quot;.&quot; /&gt;
&lt;property name=&quot;build&quot; value=&quot;build&quot; /&gt;
&lt;property name=&quot;dist&quot; value=&quot;dist&quot; /&gt;

&lt;target name=&quot;prepare&quot;&gt;
&lt;!-- Create the time stamp --&gt;
&lt;tstamp/&gt;
&lt;!-- Create the build directory structure used by compile --&gt;
&lt;mkdir dir=&quot;${build}&quot; /&gt;
&lt;/target&gt;

&lt;target name=&quot;compile&quot; depends=&quot;prepare&quot;&gt;
&lt;javac srcdir=&quot;${src}&quot; destdir=&quot;${build}&quot; filtering=&quot;on&quot;/&gt;
&lt;!-- Compile the java code from ${src} into ${build} --&gt;
&lt;javac srcdir=&quot;${src}&quot; destdir=&quot;${build}&quot; /&gt;
&lt;/target&gt;

&lt;target name=&quot;dist&quot; depends=&quot;compile&quot;&gt;
&lt;!-- Create the ${dist}/lib directory --&gt;
&lt;mkdir dir=&quot;${dist}/lib&quot; /&gt;
&lt;jar jarfile=&quot;${dist}/lib/foo${DSTAMP}.jar&quot;
basedir=&quot;${build}&quot; items=&quot;com&quot;/&gt;

&lt;!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --&gt;
&lt;jar jarfile=&quot;${dist}/lib/MyProject-${DSTAMP}.jar&quot; basedir=&quot;${build}&quot; /&gt;
&lt;/target&gt;

&lt;target name=&quot;clean&quot; depends=&quot;init&quot;&gt;
&lt;target name=&quot;clean&quot;&gt;
&lt;!-- Delete the ${build} and ${dist} directory trees --&gt;
&lt;deltree dir=&quot;${build}&quot; /&gt;
&lt;deltree dir=&quot;${dist}&quot; /&gt;
&lt;/target&gt;
&lt;/project&gt;
</pre>
</pre>
</blockquote>

<h3>Token Filters</h3>
<p>A project can have a set of tokens that might be automatically expanded if
found when a file is copied, when the filtering-copy behavior is selected in the
tasks that support this. These might be set in the buildfile
by the <a href="#filter">filter task</a>.&nbsp;</p>
<p>Since this can be a very harmful behavior, the tokens in the files <b>must</b>
be of the form<i> @token@</i> where <i>token</i> is the token name that is set
in the filter task. This token syntax matches the syntax of other build systems
that perform such filtering and remains sufficiently orthogonal to most
programming and scripting languages, as well with documentation systems.</p>
<p>Note: in case a token with the format @token@ if found in a file but no
filter is associated with that token, no changes take place. So, no escaping
method is present, but as long as you choose appropriate names for your tokens,
this should not cause problems.</p>

<h3><a name="path">PATH like structures</a></h3>
<p>You can specify PATH and CLASSPATH variables using both
&quot;:&quot; and &quot;;&quot; as separator characters, Ant will


Loading…
Cancel
Save