ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Culhane" <>
Subject Verifying if a property is present in a property file
Date Thu, 26 Apr 2007 08:28:26 GMT

I am writing a target which merges property values from the property file
into another file which is then used when building my application.  The
target should only get executed if the specific property is present in the
property file.

The target which does the merging is dependant on another target, named
merge-check, which should verify that the required property is present in
the property file.  Merge-check  should set an internal property, named
something like merge-check-ok, if the property is present.
In the target doing the merge, we can then check the property merge-check-ok
using the if clause.

However, I don't know how to check the  property file for a  specific
property.  I've  tried using a condition,  and using the loadproperties and
filterchain  as in the bwlow example:

	<target name="config-address-check" depends="config-merge-check"
		<condition property="ok-address-config">
	      <loadproperties srcfile="">
	            <contains value="bind.ip.address"/>

But  the condition task does not support loadproperties.

Can anybody tell me how I can verify if a property exists, and hence let the
script know  of this?



Tim Culhane,
Critical Path Ireland,
42-47 Lower Mount Street,
Dublin 2.
Direct line: 353-1-2415107
phone: 353-1-2415000

Critical Path
a global leader in digital communications

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

View raw message