Introduction

This is a library of supplementary handlers for Ant properties resolution.

Requirements

The current version of this antlib is built against the Ant 1.8.0.

Where is it?

The source code for the library lives in the antlibs subspace of Ant's SVN - http://svn.apache.org/viewvc/ant/antlibs/props/trunk/.

Installation

If you are building this from sources, run the antlib target and you'll get a file ant-props.jar.

There are several ways to use the tasks:

Tasks and Types

The types provided are instances of org.apache.tools.ant.PropertyHelper.Delegate and can be invoked using the <propertyhelper> task provided by Ant:

Delegate Delegate Type Description
nested PropertyExpander Implements nested property expansion; e.g. ${${double-expand-me}}.
stringops PropertyEvaluator Implements *nix shell-inspired string operations.
types PropertyEvaluator Given type(arg), attempts to invoke type constructor (Project, arg), then (arg).
conditions PropertyEvaluator Given condition([arg1=value1,arg2=value2,...]), attempts to invoke an Ant condition of the given name setting the given attibute values and evaluates to either Boolean.TRUE or Boolean.FALSE. Usage looks like ${os(family=unix)} / ${!os(family=unix)}. Additionally, logical operations are supported. In order of precedence, these are !, &, ^, and |, with + being a secondary alias for & since & is a special character to the XML format. When you want to combine logical operations with typed Ant conditions, the typed conditions should be specified as nested properties and the nested evaluator should be included with your active PropertyHelper delegates. This is probably most useful together with the if/unless attributes of tasks or targets.
encodeURL PropertyEvaluator Given encodeURL:arg, attempts to encode arg as a URL per the suggested approach in the javadoc API of java.net.URL.