function show_help { echo "LiRK3 - the LInux Release Kit for greenstone3" echo "Helps you to create releases of Greenstone3 from the Repository" echo echo "usage: lirk3 [-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.mode=descend)" echo " execute only the descendents of the target specified with -from" echo " for example, with -from 3 -descend, 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 LiRK3" echo " (like `ant --diagnostics`)" } #work out the classpath CLASSPATH=$JAVA_HOME/lib/tools.jar for file in $LIRK3_HOME/lib/*.jar; do CLASSPATH=$CLASSPATH:$file done for file in $LIRK3_HOME/bin/apache-ant-1.6.5/lib/*.jar; do CLASSPATH=$CLASSPATH:$file done for file in $LIRK3_HOME/bin/ant-installer/lib/*.jar; do CLASSPATH=$CLASSPATH:$file done CLASSPATH=$CLASSPATH:$LIRK3_HOME/bin/ant-installer/classes #create the command toexec="$LIRK3_HOME/bin/apache-ant-1.6.5/bin/ant -f $LIRK3_HOME/ant-scripts/build.xml -Dbasedir=`pwd` -Dlirk3.home=$LIRK3_HOME" #pass on the arguments while [ "$1" != "" ]; do if [ "$1" == "-help" ]; then show_help exit elif [ "$1" == "-cp" ]; then echo $LIRK3_CLASSPATH exit elif [ "$1" == "-sim" ]; then toexec="$toexec -Dexecute=false" shift elif [ "$1" == "-descend" ]; then toexec="$toexec -Dresume.mode=descend" shift 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 #echo $toexec echo "LiRK3" echo " Ant Script: $LIRK3_HOME/ant-scripts/build.xml" echo " Basedir: `pwd`" $toexec