root/trunk/build/quickstart/linux/bw

Revision 2024 (checked in by douglm, 4 years ago)

Try different loggers and listeners for ant

Set level for echo task

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