ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilbert Rebhan <...@schillbaer.de>
Subject Re: AW: Checking for build.properties and properties upon initialization
Date Wed, 21 May 2008 19:17:54 GMT
Dimitris Mouchritsas schrieb:
> What I'd like to accomplish is checking if build.properties exists 
> (which loadproperties ensures) and
> then check to see if a set of properties is set. If a property is 
> missing I'd like to display a message with
> the name of the property missing.
> 
> What are your thoughts?

?!
as you've already said, <loadfile .. /> assures
that the build.properties exists, otherwise your build will
fail

the echo if ${someproperty} is missing you will get with
something like =

<target name="foobar" unless="someproperty">
   <echo>WARNING => $${someproperty} not set !!</echo>
<target>

if you need more reaction, you have to use <condition>
or <assert> from antcontrib

btw, if you need to do more complicated stuff with properties
you should have a look on AntXtras, they have assert, fixturechecks,
one example that would suit to your needs =
http://antxtras.sourceforge.net/AntXtras/docs/howto/fix_chk_properties.html

Regards, Gilbert


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


Mime
View raw message