ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <>
Subject RE: ANT / AntXtras quick question.
Date Tue, 18 Sep 2007 13:05:22 GMT

-----Original Message-----
From: warhero [] 
Sent: Tuesday, September 18, 2007 2:53 AM
Subject: ANT / AntXtras quick question.

I'm having trouble trying to figure out how to make sure a property is

So I have a properties file like so

And if the myprop is not empty (myprop=) then execute something. Does
make sense? here's some kind of pseudocode.

<if myprop != ''>
  <exec whatever>

Just some pseudo code, but get's the point across..

If you're running the AntXtras task suite you can go with assert, i.e.

<project name="bla" default="main" basedir=".">
  <!-- // Taskdefs -->
  <!-- Import AntXtras -->
  <taskdef resource="com/idaremedia/antx/install/antlib.xml"/>
  <!-- Taskdefs // -->

  <!-- // Properties -->
  <property name="testproperty" value="foobar"/>
  <!-- Properties // -->

    <target name="depends">

<!-- make sure property is set, but will also return true if property
        is set to "" -->
 <assert isset="testproperty"/>
 <!-- make sure the property is a string of chars, will return
    false if it's set to 12345 or also if property is an empty string ""
<assert matches="\w+" property="testproperty"/>
     Yup, $${testproperty} set to ${line.separator} => ${testproperty}

    <target name="main" depends="depends"/>

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message