ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lucas Albers" <>
Subject RE: If else
Date Tue, 14 Oct 2008 22:11:04 GMT
I really like the ant-contrib tasks for this:

<project name="a">
<taskdef resource="net/sf/antcontrib/"/>

<osfamily property=""/>
<echo message="${}"></echo>
<property file="${}.properties"></property>

  <echo> os:${} </echo>
    <echo> os.arch:${os.arch} </echo>
    <echo> os.version:${os.version} </echo>

<property name="linux_compile_dir" value="/nfs/Branch/"/>

<pathconvert property="windows_compile_dir" dirsep="\">
      <map from="/nfs" to='s:'/>
      <path location="${linux_compile_dir}"/>


<if> <equals arg1="${}" arg2="unix" />
        <echo> "checking for existence of

        <available file="${linux_compile_dir}" type="dir"
                <if> <equals arg1="${linux.dir.present}" arg2="true" />
                <echo>"linux dir exists: ${linux_compile_dir}:

-----Original Message-----
From: Mohit Anchlia [] 
Sent: Tuesday, October 14, 2008 2:33 PM
To: Ant Users List
Subject: If else

I am struggling with a very simple question. How do I test if a
variable is defined or not?

I tried:

          <matches string="${jboss.wily.jvmargs}" pattern="^[ \t]+" />


          <matches string="${jboss.wily.jvmargs}" pattern="" />


          <length string="${jboss.wily.jvmargs}" trim="true"
when="greater" length="0" />

Nothing seem to work. jboss.wily.jvmargs may or may not be there in
property file

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

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

View raw message