ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel L. Rall" <...@finemaltcoding.com>
Subject PATCH: buildAnt
Date Fri, 21 Jul 2000 00:58:04 GMT
Added some precondition checks for environment variables.


Index: buildAnt
===================================================================
RCS file: /home/cvspublic/jakarta-ant/buildAnt,v
retrieving revision 1.1
diff -u -u -r1.1 buildAnt
--- buildAnt	2000/04/27 20:26:10	1.1
+++ buildAnt	2000/07/21 00:54:57
@@ -25,9 +25,33 @@
 # - To execute the "install" target, you must be running on the Jakarta
 #   server, as part of group "jakarta".
 #
-# Author:	Craig R. McClanahan
-# Version:	$Revision: 1.1 $ $Date: 2000/04/27 20:26:10 $
+# Authors:	Craig R. McClanahan
+#         	Daniel Rall <dlr@finemaltcoding.com>
+# Version:	$Id: $
 #
-----------------------------------------------------------------------------
 
-. ~/.antrc
-ant -buildfile buildAnt.xml -Djaxp.home=$JAXP_HOME "$@"
+# Get any user-specific Ant configuration.
+ANT_RC=~/.antrc
+if [ -r ${ANT_RC} ]; then . ${ANT_RC}; fi
+
+# Checks for the existance of the specified environment variables.  If
one of 
+# the listed variables is not found, exits with error message and
status.
+function check_env_vars()
+{
+    failed=''
+    for var in ${@}; do
+        var="\$${var}"
+        if [ -z "`eval echo -n ${var}`" ]; then
+            echo "$0: set your ${var} environment variable"
+            failed='t'
+        fi
+    done
+    if [ ${failed} ]; then exit 1; fi
+}
+
+# Assure that the environment is setup properly.
+check_env_vars JAXP_HOME ANT_HOME
+
+# Update and build Ant.
+ant -buildfile buildAnt.xml -Djaxp.home=${JAXP_HOME} "$@"
+exit 0

-- 

Daniel Rall <dlr@finemaltcoding.com>

Mime
View raw message