ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Donie <>
Subject RE: fail if a condition is not met?
Date Thu, 04 Jan 2001 23:43:58 GMT
Thanks - but I have several conditions I want to check at the start of a
build, and I would like to report all of the errors instead of forcing the
"fix one error, run it, find the next error, fix that..." cycle. Here's what
I have right now, which is ugly also:

                  Checks the environment for existing resources
  <target name="check-environment"
  <target name="fail-environment"

  <target name="checkrmic">
    <available property="RMICManifest.present" file="RMICManifest.txt" />
  <target name="failrmic" unless="RMICManifest.present">
    <fail message = "RMICManifest.txt is not present" />
  <target name="checkclient">
    <available property="ClientManifest.present" file="ClientManifest.txt"

  <target name="failclient" unless="ClientManifest.present">
    <fail message = "ClientManifest.txt is not present" />

  <target name="checkserver">
    <available property="ServerManifest.present" file="ServerManifest.txt"
  <target name="failserver" unless="ServerManifest.present">
    <fail message = "ServerManifest.txt is not present" />
                         Prepares the build directory
  <target name="prepare" depends="fail-environment">
    <!-- Create the time stamp -->
    <echo message="Building ${} starting at ${TSTAMP} on
${TODAY}" />
    <!-- Create the directory structure used by compile -->
    <mkdir dir="${classes}" />
    <!-- cvs command="update" -->

-----Original Message-----
From: Conor MacNeill []
Sent: Thursday, January 04, 2001 5:30 PM
Subject: RE: fail if a condition is not met?

  <target name="checkTag" unless="tagname">
    <fail message="Please set tagname"/>

Then make all your targets depend on checkTag.

Conor MacNeill
Cortex eBusiness
-----Original Message-----
From: Steve Donie []
Sent: Friday, 5 January 2001 10:24
To: Ant-User (E-mail)
Subject: fail if a condition is not met?

This seems like such a simple thing - I want my build to with an appropriate
error if certain properties aren't set. How can I do this?

View raw message