From 73a989fc97eb7d3e0e2848df839f686919f3653c Mon Sep 17 00:00:00 2001 From: Romain Pelisse Date: Sun, 11 Sep 2011 19:13:10 +0000 Subject: [PATCH] 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 --- pmd/etc/generate_release.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pmd/etc/generate_release.sh b/pmd/etc/generate_release.sh index e517b5ebdc..af50222f2f 100644 --- a/pmd/etc/generate_release.sh +++ b/pmd/etc/generate_release.sh @@ -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)"