ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Barker <Michael.Bar...@singlepointsolutions.co.uk>
Subject RE: Failing if properties file not found
Date Thu, 23 May 2002 14:42:47 GMT
Don't worry, fixed:

<target name="check_envfile" unless="${Eden.envfile.set}">

should be:

<target name="check_envfile" unless="Eden.envfile.set">

Knew it was simple.

-----Original Message-----
From: Michael Barker [mailto:Michael.Barker@singlepointsolutions.co.uk]
Sent: 23 May 2002 15:35
To: Ant Users List (E-mail)
Subject: Failing if properties file not found


Hi,

I am trying to build ant script that will fail in the case where a
particular properties file is not loaded, where the name of the properties
file is specified as a property on the command line.  I have tried the
following, which works fine if the file is not loaded, however it also fail
if I have a correct file specified.

Commands to run:

> ant (Fails as it should)
> ant -DEden.envfile=some_existing_file.props (Fails even though the file is
loaded, checked this through the verbose output).

	<property name="CONFIGDIR" value="${basedir}/Config"/>
  	<property name="Eden.envfile" value="[unspecified]"/>
   	<property file="${CONFIGDIR}/${Eden.envfile}"/>

   	
 	<target name="check_envfile" unless="${Eden.envfile.set}">
 		<echo message="${Eden.envfile}"/>
 		<fail message="Enviroment file not specified, please specify
-DEden.evnfile=[filename] on the command line"/>
 	</target>
 
	<target name="build">
		<available file="${CONFIGDIR}/${Eden.envfile}"
property="Eden.envfile.set"/>
		<antcall target="check_envfile"/>
	</target>


I am probably missing something obvious, as I am a bit of a newbie.

Thanks in advance,

Michael Barker
Email: michael.barker@singlepointsolutions.co.uk


The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential / privileged material. If
you are not the intended recipient you must not review, distribute, or take
any action using this information. If you received this in error, please
contact the sender and delete the material from any computer. Singlepoint
(4U) Ltd may monitor outgoing and incoming e-mails and other
telecommunications on its e-mail and telecommunications systems.


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message