<terp.property> - an enhanced <property> task

Using the <terp.property> task requires that the ant-terp.jar file be available to ant and that the task be registered via a <taskdef> statement:

<taskdef name="terp.property" classname="com.codemesh.terp.ant.TerpProperty"/>

Please note that you could use any value for the name attribute that you wish; you are not limited to terp.property. All our examples and documentation use the terp.property name and use a name prefix of terp. to signal that they originate with and rely on the terp framework.

The <terp.property> task is an extension of the ANT <property> task. In addition to the ANT <property> task's attributes, it has the following attributes:

terp.property attributes
Name Type Description
expression String The whole point of using the <terp.property> task. Allows you to specify any terp expression, for example 3+4 or {0,1,2}[join(',')], whose evaluated value becomes the property value. Please note that the actual object value and not its string representation becomes the property value. This allows you to use the property in subsequent evaluations.
if String Optional attribute specifying a boolean terp expression. The expression represents a condition that must be satisfied for the task to be executed.
unless String Optional attribute specifying a boolean terp expression. The expression represents a condition that must not be satisfied for the task to be executed.

Take the following example of a property declared to hold a collection of processor architectures followed by a property that references the first of the held objects:

<terp.property name="pas" expression="{^procarch('x86'), ^procarch('amd64'), ^procarch('sparc')}" />
<terp.property name="pa.first" expression="pas[ 0 ]" />
            

Before using the <terp.property> task, you might want to familiarize yourself with terp expressions.


Copyright 2006-2013 by Codemesh, Inc., ALL RIGHTS RESERVED

:
<terp.property>
codemesh.com home expressions templates ant about us contact us download   

Commandline