#!/bin/bash function show_title() { echo "RK_HOME: $RK_HOME" echo "O---------------------------------------------O" echo echo " $rk_name "; echo " $rk_fullname "; echo echo "O---------------------------------------------O" } function show_help { echo "usage: rke [-help|-cmd] [ANT_ARGS]" echo " -help show this help screen" echo " -cmd show the ant command being used by the release kit" echo " ANT_ARGS additional arguments to be passed to ant" } rk_name=rke rk_fullname="Release Kit for Expeditee" export RK_HOME="$(cd "$(dirname "$0")/.." && pwd)" #make sure ant has enough memory export ANT_OPTS=-Xmx1024M #create the command toexec="ant -lib `pwd`/installer/classes -f $RK_HOME/kits/$rk_name/ant-scripts/build.xml -Dbasedir=`pwd` -Drk.home=$RK_HOME -Drk.name=$rk_name" #pass on the arguments while [ "$1" != "" ]; do if [ "$1" == "-help" ]; then show_help exit elif [ "$1" == "-cmd" ]; then show_cmd=true else toexec="$toexec \"$1\"" fi shift done #show the command to be executed if [ "$show_cmd" == "true" ]; then echo $toexec #execute else show_title | tee ${rk_name}.out $toexec 2>&1 | tee -a ${rk_name}.out fi