Changeset 1899

Show
Ignore:
Timestamp:
07/02/08 13:32:51
Author:
douglm
Message:

Further changes to external subscriptions support.

Change bw script to add further options and better options processing.
Make copy of config into config/bwbuild/default.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/bw

    r1893 r1899  
    55# within the svn repository. 
    66# 
     7PRG="$0" 
     8 
     9usage() { 
     10  echo "$PRG [-bwchome path | -quickstart ] [ -bwc configname ] [ -offline } [ target ] " 
     11  echo "" 
     12  echo " -bwchome specify path to configurations" 
     13  echo " -quickstart  Use the current quickstart configurations " 
     14  echo " - bwc specify configuration name" 
     15  echo " -offline  build without atempting to retrieve library jars" 
     16  echo " target  ant target to execute" 
     17  echo "" 
     18  echo "Invokes ant to build or deploy the bedework system. Uses a configuration" 
     19  echo "directory which contains one directory per configuration." 
     20  echo "" 
     21  echo "Within each configuration directory we expect a file called build.properties" 
     22  echo "which should point to the proerty and options file needed for th edeploy process" 
     23  echo "" 
     24  echo "In general these files will be in the same directory as build.properties." 
     25  echo "The environment variable BEDEWORK_CONFIG contains the path to the current" 
     26  echo "configuration directory and can be used to build a path to the other files." 
     27  echo "" 
     28} 
     29 
     30saveddir=`pwd` 
     31 
     32export QUICKSTART_HOME=$saveddir 
     33 
     34# Default some parameters 
     35 
     36BWCONFIGS= 
     37bwc=default 
     38BWCONFIG= 
     39offline= 
     40quickstart= 
     41 
     42while [ "$1" != "" ] 
     43do 
     44  # Process the next arg 
     45  case $1       # Look at $1 
     46  in 
     47    -bwchome)         # Define location of configs 
     48      shift 
     49      BWCONFIGS="$1" 
     50      shift 
     51      ;; 
     52    -quickstart) 
     53      quickstart="yes" 
     54      shift 
     55      ;; 
     56    -usage | -help | -? | ?) 
     57      usage 
     58      exit 
     59      shift 
     60      ;; 
     61    -bwc) 
     62      shift 
     63      bwc="$1" 
     64      shift 
     65      ;; 
     66    -offline) 
     67      offline="-Dorg.bedework.offline.build=yes" 
     68      shift 
     69      ;; 
     70    -*) 
     71      usage 
     72      exit 1 
     73      ;; 
     74    *) 
     75      # Assume we've reached the target(s) 
     76      break 
     77      ;; 
     78  esac 
     79done 
     80 
     81if [ "$quickstart" != "" ] ; then 
     82  if [ "$BWCONFIGS" != "" ] ; then 
     83    echo "*******************************************************" 
     84    echo "Error: Cannot specify both -quickstart and -bwchome" 
     85    echo "*******************************************************" 
     86    exit 1 
     87  fi 
     88 
     89  BWCONFIGS=$QUICKSTART_HOME/bedework/config/bwbuild 
     90elif [ "$BWCONFIGS" = "" ] ; then 
     91  BWCONFIGS=$HOME/bwbuild 
     92fi 
     93 
     94export BEDEWORK_CONFIGS_HOME=$BWCONFIGS 
     95export BEDEWORK_CONFIG=$BWCONFIGS/$bwc 
     96 
     97if [ ! -f "$BEDEWORK_CONFIG/build.properties" ] ; then 
     98  echo "*******************************************************" 
     99  echo "Error: Configuration $BEDEWORK_CONFIG does not exist or is not a bedework configuration." 
     100  echo "*******************************************************" 
     101  exit 1 
     102fi 
    7103 
    8104if [ -z "$JAVA_HOME" -o ! -d "$JAVA_HOME" ] ; then 
     
    13109fi 
    14110 
    15 PRG="$0" 
    16 saveddir=`pwd` 
    17  
    18 export BEDEWORK_HOME=$saveddir 
    19  
    20 BWCONFIGS= 
    21  
    22 if [ "$1" = "-bwchome" ] ; then 
    23   shift 
    24   BWCONFIGS="$1" 
    25   shift 
    26 else 
    27   BWCONFIGS=$HOME/bwbuild 
    28 fi 
    29  
    30111# Make available for ant 
    31 export BEDEWORK_CONFIGS_HOME=$BWCONFIGS 
    32  
    33 BWCONFIG= 
    34  
    35 if [ "$1" = "-bwc" ] ; then 
    36   shift 
    37  
    38   # Make available for ant 
    39   export BEDEWORK_CONFIG=$BWCONFIGS/$1 
    40  
    41   BWCONFIG="-Dorg.bedework.user.build.properties=$BWCONFIGS/$1/build.properties" 
    42   shift 
    43 fi 
     112export BWCONFIG="-Dorg.bedework.user.build.properties=$BEDEWORK_CONFIG/build.properties" 
    44113 
    45114echo "BWCONFIGS=$BWCONFIGS" 
     
    51120CLASSPATH=$ANT_HOME/lib/ant-launcher.jar 
    52121 
    53 $JAVA_HOME/bin/java -classpath $CLASSPATH -Dant.home=$ANT org.apache.tools.ant.launch.Launcher $BWCONFIG $* 
    54  
     122$JAVA_HOME/bin/java -classpath $CLASSPATH $offline -Dant.home=$ANT org.apache.tools.ant.launch.Launcher $BWCONFIG $*