Hi,
I have two files for my new build setup, one is build.xml and the other is
build.properties. The latter one is used to override default values for some
properties as well as providing values for properties which vary between
computers.
Their contents are:
$ cat build.properties
# Override properties for build.xml for which the default values does not
work
# on your machine.
deploy.dir=/home/someuser/webapps
$ cat build.xml
<?xml version="1.0"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="webcollab">
<property file="build.properties"/>
<property environment="env"/>
<!-- Sets default values to properties that are not overridden in
build.properties -->
<property name="deploy.dir" value="${CATALINA_HOME}/webapps"/>
<!-- HERE I WANT SOME VALIDATION LOGIC -->
</project>
At the comment about validation logic I would like to verify that deploy.dir
is
an existing directory. And if it is not I would like to echo "deploy.dir is
not an
existing directory" and fail.
In the case of a property pointing to a file I would like to: a) validate
that the file
exist, or b) validate that the path to the file exists (in case the property
value
is set to a file which is about to be created by my build script).
How do you validate your properties? There might become a lot of properties,
what's the cleanest way?
Best regards, Kent