| <!-- |
| 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 an experimental version of Ant |
| that allows a custom PropertyEvaluator to return an Object from an attribute |
| containing a single resolvable property. Patches can be found at |
| <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=42736"> http://issues.apache.org/bugzilla/show_bug.cgi?id=42736</a>. |
| </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> |
| <typedef resource="org/apache/ant/props/antlib.xml" |
| classpath="YOUR-PATH-TO/ant-props.jar"/> |
| </pre> |
| |
| Using this approach the provided extensions will live in the default namespace.</p> |
| </li> |
| |
| <li><p>Similar, but assigning a namespace URI |
| <pre> |
| <typedef uri="antlib:org.apache.ant.props" |
| resource="org/apache/ant/props/antlib.xml" |
| classpath="YOUR-PATH-TO/ant-props.jar"/> |
| </pre> |
| |
| Placing the properties extensions into their own namespace, usable e.g.: |
| |
| <pre> |
| <project xmlns:props="antlib:org.apache.ant.props"> |
| ... |
| <propertyhelper> |
| <props:nested /> |
| </propertyhelper> |
| </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> |
| <project xmlns:props="antlib:org.apache.ant.props"> |
| </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 (so far) instances of |
| <code>org.apache.tools.ant.PropertyHelper.Delegate</code> and can be invoked |
| using the <code><propertyhelper></code> task provided at the referenced Bugzilla entry: </p> |
| |
| <ul> |
| <li>nested - Implements nested property expansion; e.g. <code>${${double-expand-me}}</code>. |
| </li> |
| <li><a href="stringops.html">stringops</a> - Implements *nix shell-inspired string operations. |
| </li> |
| <li>refs - Given <code>ref:<em>refid</em></code>, resolves reference |
| <code><em>refid</em></code>. |
| </li> |
| <li>types - 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>. |
| </li> |
| </ul> |
| |
| <hr/> |
| </body> |
| </html> |