JWare Logo  “Strategies in (*)ability” [iDareMedia] [JWare] [PET] [CI-Dashboard]
<JWare/AntXtras Foundation>

 [home]    [overview] [download] [learning] [problems] [ourplans]    [contacts] [legalese

[guide] $truefalse:UG

home » learning » guides » valueuris » $truefalse: 

The $truefalse: value uri lets you normalize any Ant-compatible boolean string into either the string “true” or the string “false”. This uri is useful when you need to pass boolean values outside of the Ant environment (where synonyms like “yes“ may not work). You must explicitly install this value uri’s handler; read the Examples section to see how this is done.

Parameters

The general form of the uri is: $truefalse:booleanstring[?TRUEstring[,,FALSEstring]] where booleanstring is the Ant compatible boolean setting and TRUEstring and FALSEstring are optional true and false string values. Note that the arguments are separated by a double comma (,,). You can use use the option strings to specify other pairs of normalized values like “PASS” and “FAIL”, or “t” and “nil”.

Examples

1) The following snippet declares the default scheme name for the truefalse uri handler: $truefalse:. This is usually done by an “init” target or at the project’s top level.

    <manageuris action="install">
        <parameter name="truefalse"
            value="com.idaremedia.antx.valueuri.TFValueNormalizer"/>
    </manageuris>

2) The following snippet normalizes an Ant script boolean string @{flag} before it is passed out to another process.

    <exec executable=...>
       <arg line="-Dflag=${$truefalse:@{flag}}"/>
       ...

3) The following snippet sets the value of a status file to either “PASS” or “FAIL” based on whether some Ant boolean strings are set.

    <checkpoint tofile="${dashboard}/tests.status" includesource="no"
        message="${$isset:tests.unclean|$truefalse:?FAIL,,PASS}"/>

Related Topics

SourceForge.net Logo
Copyright ©2005-2006 iDare Media, Inc. All rights reserved.
 
JWare/AntXtras uses software developed by and on behalf of the Apache Software Foundation, http://www.apache.org/.
All other product names mentioned on this website are trademarks of their respective owners; refer to full legalese statement.