#! /bin/sh # # This file is included by the quickstart script file "bw" so that it can live # within the svn repository. # ANT_HOME=`dirname "$PRG"`/apache-ant-1.7.0 ANT_HOME=`cd "$ANT_HOME" && pwd` #ant_listener="-listener org.apache.tools.ant.listener.Log4jListener" #ant_xmllogfile="-DXmlLogger.file=log.xml" #ant_logger="-logger org.apache.tools.ant.XmlLogger" ant_listener= ant_xmllogfile= ant_logger= echo "" echo " Bedework Calendar System" echo " ------------------------" echo "" PRG="$0" usage() { echo " $PRG [ -quickstart | -bwchome path ] [ -bwc configname ] [ -offline } [ target ] " echo "" echo " -quickstart Use the current quickstart configurations " echo " -bwchome Specify path to configurations" echo " -bwc Specify configuration name" echo " -offline Build without attempting to retrieve library jars" echo " -carddav Target is for the CardDAV build, otherwise it's a calendar build" echo " target Ant target to execute" echo "" echo " Invokes ant to build or deploy the Bedework system. Uses a configuration" echo " directory which contains one directory per configuration." echo "" echo " Within each configuration directory we expect a file called build.properties" echo " which should point to the property and options file needed for the deploy process" echo "" echo " In general these files will be in the same directory as build.properties." echo " The environment variable BEDEWORK_CONFIG contains the path to the current" echo " configuration directory and can be used to build a path to the other files." echo "" } errorUsage() { echo "*******************************************************" echo "Error: $1" echo "*******************************************************" usage exit 1 } if [ -z "$JAVA_HOME" -o ! -d "$JAVA_HOME" ] ; then errorUsage "JAVA_HOME is not defined correctly for bedework." fi saveddir=`pwd` trap 'cd $saveddir' 0 trap "exit 2" 1 2 3 15 export QUICKSTART_HOME=$saveddir # Default some parameters BWCONFIGS= bwc=default BWCONFIG= offline= quickstart= carddav= if [ "$1" = "" ] ; then usage exit 1 fi while [ "$1" != "" ] do # Process the next arg case $1 # Look at $1 in -bwchome) # Define location of configs shift BWCONFIGS="$1" shift ;; -quickstart) quickstart="yes" shift ;; -carddav) carddav="yes" shift ;; -usage | -help | -? | ?) usage exit shift ;; -bwc) shift bwc="$1" shift ;; -offline) offline="-Dorg.bedework.offline.build=yes" shift ;; -*) usage exit 1 ;; *) # Assume we've reached the target(s) break ;; esac done if [ "$quickstart" != "" ] ; then if [ "$BWCONFIGS" != "" ] ; then errorUsage "Cannot specify both -quickstart and -bwchome" fi BWCONFIGS=$QUICKSTART_HOME/bedework/config/bwbuild elif [ "$BWCONFIGS" = "" ] ; then BWCONFIGS=$HOME/bwbuild fi export BEDEWORK_CONFIGS_HOME=$BWCONFIGS export BEDEWORK_CONFIG=$BWCONFIGS/$bwc if [ ! -f "$BEDEWORK_CONFIG/build.properties" ] ; then errorUsage "Configuration $BEDEWORK_CONFIG does not exist or is not a bedework configuration." fi # Make available for ant export BWCONFIG="-Dorg.bedework.user.build.properties=$BEDEWORK_CONFIG/build.properties" echo "BWCONFIGS=$BWCONFIGS" echo "BWCONFIG=$BWCONFIG" CLASSPATH=$ANT_HOME/lib/ant-launcher.jar CLASSPATH=$CLASSPATH:$QUICKSTART_HOME/bedework/build/quickstart/antlib CLASSPATH=$CLASSPATH:$QUICKSTART_HOME/bedework/applib/log4j-1.2.8.jar if [ "$carddav" != "" ] ; then cd $QUICKSTART_HOME/bedework-carddav fi $JAVA_HOME/bin/java -classpath $CLASSPATH $ant_xmllogfile $offline -Dant.home=$ANT org.apache.tools.ant.launch.Launcher $BWCONFIG $ant_listener $ant_logger $*