blob: 23199368e2d483559ca83e7277618d813e903645 [file] [log] [blame]
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us"></meta>
<link rel="stylesheet" type="text/css" href="style.css">
<title>Props Ant Library</title>
</head>
<body>
<h2>Introduction</h2>
<p>This is a library of supplementary handlers for Ant properties resolution.</p>
<h2>Requirements</h2>
<p>The current version of this antlib is built against the Ant 1.8.x development version,
to be found in Ant's Subversion trunk.
</p>
<h2>Where is it?</h2>
<p>The source code for the library lives in the sandbox antlibs subspace of Ant's SVN -
<a href="http://svn.apache.org/viewvc/ant/sandbox/antlibs/props/trunk/">http://svn.apache.org/viewvc/ant/sandbox/antlibs/props/trunk/</a>.</p>
<h2>Installation</h2>
<p>If you are building this from sources, run the antlib target
and you'll get a file <code>ant-props.jar</code>.</p>
<p>There are several ways to use the tasks:</p>
<ul>
<li><p>The traditional way:
<pre>
&lt;typedef resource="org/apache/ant/props/antlib.xml"
classpath="YOUR-PATH-TO/ant-props.jar"/&gt;
</pre>
Using this approach the provided extensions will live in the default namespace.</p>
</li>
<li><p>Similar, but assigning a namespace URI
<pre>
&lt;typedef uri="antlib:org.apache.ant.props"
resource="org/apache/ant/props/antlib.xml"
classpath="YOUR-PATH-TO/ant-props.jar"/&gt;
</pre>
Placing the properties extensions into their own namespace, usable e.g.:
<pre>
&lt;project xmlns:props="antlib:org.apache.ant.props"&gt;
...
&lt;propertyhelper&gt;
&lt;props:nested /&gt;
&lt;/propertyhelper&gt;
</pre>
or a variation thereof.</p>
</li>
<li><p>Using Ant's autodiscovery. Place <code>ant-props.jar</code>
into a directory and use <code>ant -lib
DIR-CONTAINING-THE-JAR</code> or copy it into
<code>ANT_HOME/lib</code> - and then in your build file, simply
declare the namespace on the <code>project</code> tag:
<pre>
&lt;project xmlns:props="antlib:org.apache.ant.props"&gt;
</pre>
And all tasks of this library will automatically be available
in the <code>props</code> namespace without any <code>typedef</code>.</p>
</li>
</ul>
<h2>Tasks and Types</h2>
<p>The types provided are instances of
<code>org.apache.tools.ant.PropertyHelper.Delegate</code> and can be invoked
using the <code>&lt;propertyhelper&gt;</code> task provided in the SVN trunk of Ant core:
<table border="1" cellspacing="0" cellpadding="2" width="100%">
<tr>
<th>Delegate</th>
<th>Delegate Type</th>
<th>Description</th>
</tr>
<tr>
<td align="center">nested</td>
<td align="center">PropertyExpander</td>
<td>Implements nested property expansion; e.g. <code>${${double-expand-me}}</code>.</td>
</tr>
<tr>
<td align="center"><a href="stringops.html">stringops</a></td>
<td align="center">PropertyEvaluator</td>
<td>Implements *nix shell-inspired string operations.</td>
</tr>
<tr>
<td align="center">refs</td>
<td align="center">PropertyEvaluator</td>
<td>Given <code>ref:<em>refid</em></code>,
resolves reference <code><em>refid</em></code>.</td>
</tr>
<tr>
<td align="center">types</td>
<td align="center">PropertyEvaluator</td>
<td>Given <code><em>type</em>(<em>arg</em>)</code>, attempts to invoke
<code><em>type</em></code> constructor <code>(<em>project, arg</em>)</code>,
then <code>(<em>arg</em>)</code>.</td>
</tr>
</table>
<hr/>
</body>
</html>