#pre checks if [ "$rk_name" == "" ]; then echo "rk_name not set"; exit; elif [ "$RK_HOME" == "" ]; then echo "RK_HOME not set"; exit fi function show_help { echo "$rk_name - $rk_fullname" echo "Helps you to create releases from the Repository" echo echo "usage: $rk_name [-sim] [-from ] [other-args]" echo " -sim" echo " (shortcut for -Dexecute=false)" echo " simulation only, don't actually do anything" echo echo " -from " echo " (shortcut for -Dresume.from=)" echo " start execution from the target with the given target address" echo " first level targets can be referred to by name. E.g., -from compile is the same as -from 1" echo echo " -descend " echo " (shortcut for -Dresume.descend=)" echo " execute only the descendents of the target specified with -from" echo " for example, with -descend 3, targets 3.1, 3.2, 3.3 etc. would be executed, but execution echo " would stop before target 4 echo echo " -cp" echo " show the classpath being used by $rk_name" } #work out the classpath CLASSPATH=$JAVA_HOME/lib/tools.jar for file in $RK_HOME/lib/*.jar; do CLASSPATH=$CLASSPATH:$file done for file in $RK_HOME/packages/ant/lib/*.jar; do CLASSPATH=$CLASSPATH:$file done for file in $RK_HOME/packages/ant-installer/lib/*.jar; do CLASSPATH=$CLASSPATH:$file done CLASSPATH=$CLASSPATH:$RK_HOME/packages/ant-installer/classes #create the command toexec="$RK_HOME/packages/ant/bin/ant -lib `pwd`/installer/classes -f $RK_HOME/ant-scripts/build.xml -Dbasedir=`pwd` -D$rk_name.home=$RK_HOME" #pass on the arguments while [ "$1" != "" ]; do if [ "$1" == "-help" ]; then show_help exit elif [ "$1" == "-cp" ]; then echo $CLASSPATH exit elif [ "$1" == "-sim" ]; then toexec="$toexec -Dexecute=false" shift elif [ "$1" == "-descend" ]; then toexec="$toexec -Dresume.descend=" descend=`echo $2 | sed 's/compile/1/g' | sed 's/create-distributions/2/g' | sed 's/create-installer/3/g' | sed 's/wrap/4/g'` toexec=$toexec$descend shift 2 elif [ "$1" == "-from" ]; then toexec="$toexec -Dresume.from=" from=`echo $2 | sed 's/compile/1/g' | sed 's/create-distributions/2/g' | sed 's/create-installer/3/g' | sed 's/wrap/4/g'` toexec=$toexec$from shift 2 elif [ "$1" == "-to" ]; then toexec="$toexec -Dresume.to=" to=`echo $2 | sed 's/compile/1/g' | sed 's/create-distributions/2/g' | sed 's/create-installer/3/g' | sed 's/wrap/4/g'` toexec=$toexec$to shift 2 else toexec="$toexec $1" shift fi done