enhance release script to check for required dependencies (ant, maven, mvn...)

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7236 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Romain Pelisse 2011-09-11 19:13:10 +00:00
parent 779526036a
commit 73a989fc97

View File

@ -5,6 +5,17 @@ usage() {
echo "this scripts requires the release version number"
}
check_dependency() {
local binary="${1}"
which "${binary}" > /dev/null
local status="${?}"
if [ ${status} -ne 0 ]; then
echo "missing dependency:${binary}"
exit ${status}
fi
}
version="${1}"
if [ -z ${version} ]; then
@ -12,6 +23,10 @@ if [ -z ${version} ]; then
exit 1
fi
check_dependency ant
check_dependency maven
check_dependency mvn
echo "building release version ${version}"
pmd_top_dir="$(mktemp -d)"