ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry V. Streepy, Jr." <stre...@healthlanguage.com>
Subject fail with if/unless support
Date Mon, 28 May 2001 23:00:53 GMT
In case anyone wants it, here is a copy of Exit.java with support for
if/unless clauses.  This makes testing for required properties SOOOO
much easier.

Note that the attached file was modified from the ANT 1.3 release, not
the latest code from CVS, since I need my development environment to be
reasonably stable.

With the attached file, you can do things like this:


  <available property="wl.home.present" file="${wl.home}"/>
  <available property="src.dir.present" file="${src.dir}"/>
  <available property="JAVA_HOME.present" file="${env.JAVA_HOME}"/>

  <fail message="  **** Error: Environment var HOSTNAME is not present"
        unless="env.HOSTNAME"/>

  <fail message="  **** Error: Environment var OS is not present"
        unless="env.OS"/>

  <fail message="  **** Error: ${wl.home} is not present"
        unless="wl.home.present"/>

  <fail message="  **** Error: ${src.dir} is not present"
        unless="src.dir.present"/>

-- 
Larry V. Streepy, Jr.
Chief Technical Officer and VP of Engineering

Health Language, Inc.  -- "We speak the language of healthcare"
A subsidiary of CyberPlus Corp.

970/626-5028 (office)           mailto:streepy@healthlanguage.com
970/626-4425 (fax)              http://www.healthlanguage.com
Mime
View raw message