root/trunk/build/bw

Revision 1908 (checked in by johnsa, 5 years ago)

updates to build scripts

  • Property svn:executable set to *
Line 
1 #! /bin/sh
2
3 #
4 # This file is included by the quickstart script file "bw" so that it can live
5 # within the svn repository.
6 #
7
8 echo ""
9 echo ""
10 echo "  Bedework Calendar System"
11 ECHO "  ------------------------"
12 ECHO ""
13
14 PRG="$0"
15
16 usage() {
17   echo "  $PRG [ -quickstart | -bwchome path ] [ -bwc configname ] [ -offline } [ target ] "
18   echo ""
19   echo "     -quickstart  Use the current quickstart configurations "
20   echo "     -bwchome     Specify path to configurations"
21   echo "     -bwc         Specify configuration name"
22   echo "     -offline     Build without atempting to retrieve library jars"
23   echo "     target       Ant target to execute"
24   echo ""
25   echo "   Invokes ant to build or deploy the bedework system. Uses a configuration"
26   echo "   directory which contains one directory per configuration."
27   echo ""
28   echo "   Within each configuration directory we expect a file called build.properties"
29   echo "   which should point to the property and options file needed for the deploy process"
30   echo ""
31   echo "   In general these files will be in the same directory as build.properties."
32   echo "   The environment variable BEDEWORK_CONFIG contains the path to the current"
33   echo "   configuration directory and can be used to build a path to the other files."
34   echo ""
35 }
36
37 saveddir=`pwd`
38
39 export QUICKSTART_HOME=$saveddir
40
41 # Default some parameters
42
43 BWCONFIGS=
44 bwc=default
45 BWCONFIG=
46 offline=
47 quickstart=
48
49 while [ "$1" != "" ]
50 do
51   # Process the next arg
52   case $1       # Look at $1
53   in
54     -bwchome)         # Define location of configs
55       shift
56       BWCONFIGS="$1"
57       shift
58       ;;
59     -quickstart)
60       quickstart="yes"
61       shift
62       ;;
63     -usage | -help | -? | ?)
64       usage
65       exit
66       shift
67       ;;
68     -bwc)
69       shift
70       bwc="$1"
71       shift
72       ;;
73     -offline)
74       offline="-Dorg.bedework.offline.build=yes"
75       shift
76       ;;
77     -*)
78       usage
79       exit 1
80       ;;
81     *)
82       # Assume we've reached the target(s)
83       break
84       ;;
85   esac
86 done
87
88 if [ "$quickstart" != "" ] ; then
89   if [ "$BWCONFIGS" != "" ] ; then
90     echo "*******************************************************"
91     echo "Error: Cannot specify both -quickstart and -bwchome"
92     echo "*******************************************************"
93     exit 1
94   fi
95
96   BWCONFIGS=$QUICKSTART_HOME/bedework/config/bwbuild
97 elif [ "$BWCONFIGS" = "" ] ; then
98   BWCONFIGS=$HOME/bwbuild
99 fi
100
101 export BEDEWORK_CONFIGS_HOME=$BWCONFIGS
102 export BEDEWORK_CONFIG=$BWCONFIGS/$bwc
103
104 if [ ! -f "$BEDEWORK_CONFIG/build.properties" ] ; then
105   echo "*******************************************************"
106   echo "Error: Configuration $BEDEWORK_CONFIG does not exist or is not a bedework configuration."
107   echo "*******************************************************"
108   exit 1
109 fi
110
111 if [ -z "$JAVA_HOME" -o ! -d "$JAVA_HOME" ] ; then
112   echo "*******************************************************"
113   echo "Error: JAVA_HOME is not defined correctly for bedework."
114   echo "*******************************************************"
115   exit 1
116 fi
117
118 # Make available for ant
119 export BWCONFIG="-Dorg.bedework.user.build.properties=$BEDEWORK_CONFIG/build.properties"
120
121 echo "BWCONFIGS=$BWCONFIGS"
122 echo "BWCONFIG=$BWCONFIG"
123
124 ANT_HOME=`dirname "$PRG"`/apache-ant-1.7.0
125 ANT_HOME=`cd "$ANT_HOME" && pwd`
126
127 CLASSPATH=$ANT_HOME/lib/ant-launcher.jar
128
129 $JAVA_HOME/bin/java -classpath $CLASSPATH $offline -Dant.home=$ANT org.apache.tools.ant.launch.Launcher $BWCONFIG $*
Note: See TracBrowser for help on using the browser.