root/trunk/build/quickstart/windows/bw.bat

Revision 3050 (checked in by johnsa, 3 years ago)

windows build includes config change message (we no longer need to supply -bwc jboss ... it is the default)

  • Property svn:mergeinfo set to
Line 
1 ::  This file is included by the quickstart script file "..\..\bw.bat" so that
2 ::  we may keep this script under version control in the svn repository.
3
4 @ECHO off
5 SETLOCAL
6
7 ECHO.
8 ECHO.
9 ECHO   Bedework Calendar System
10 ECHO   ------------------------
11 ECHO.
12
13
14 SET PRG=%0
15 SET saveddir=%CD%
16 SET QUICKSTART_HOME=%saveddir%
17
18 SET ANT_HOME=%QUICKSTART_HOME%\apache-ant-1.7.0
19
20 SET CLASSPATH="%ANT_HOME%\lib\ant-launcher.jar"
21 SET CLASSPATH=%CLASSPATH%;"%QUICKSTART_HOME%\bedework\build\quickstart\antlib"
22 :: SET CLASSPATH=%CLASSPATH%;"%QUICKSTART_HOME%\bedework\applib\log4j-1.2.8.jar"
23
24 :: Default some parameters
25 SET BWCONFIGS=
26 SET bwc=default
27 SET BWCONFIG=
28 SET offline=
29 SET quickstart=
30
31 :: Projects we will build
32 SET pkgdefault=yes
33 SET bedework=
34 SET carddav=
35 SET caldav=
36 SET client=
37 SET monitor=
38 SET naming=
39 SET tzsvr=
40 SET webdav=
41
42 SET action=
43
44 :: check for command-line arguments and branch on them
45 IF "%1noargs" == "noargs" GOTO usage
46 GOTO branch
47
48 :quickstart
49   ECHO     Preparing quickstart build ...
50   SET quickstart="yes"
51   SHIFT
52   GOTO branch
53
54 :bwchome
55   :: Define location of configs
56   SHIFT
57   SET BWCONFIGS=%1
58   SHIFT
59   GOTO branch
60
61 :bwc
62   SHIFT
63   SET bwc=%1
64   SHIFT
65   GOTO branch
66
67 :offline
68   ECHO     Setting to offline mode; libraries will not be downloaded ...
69   SET offline="-Dorg.bedework.offline.build=yes"
70   SHIFT
71   GOTO branch
72  
73
74 :: PROJECTS
75
76 :carddav
77   SET carddav="yes"
78   SET pkgdefault=
79   SHIFT
80   GOTO branch
81  
82 :caldav
83   SET caldav="yes"
84   SET pkgdefault=
85   SHIFT
86   GOTO branch
87  
88 :client
89   SET client="yes"
90   SET pkgdefault=
91   SHIFT
92   GOTO branch
93  
94 :webdav
95   SET webdav="yes"
96   SET pkgdefault=
97   SHIFT
98   GOTO branch
99  
100 :monitor
101   SET monitor="yes"
102   SET pkgdefault=
103   SHIFT
104   GOTO branch
105
106 :naming
107   SET naming="yes"
108   SET pkgdefault=
109   SHIFT
110   GOTO branch
111  
112 :tzsvr
113   SET tzsvr="yes"
114   SET pkgdefault=
115   SHIFT
116   GOTO branch
117
118 :reindex
119   ECHO     Calling the reindexer
120   SET INDEXER=%QUICKSTART_HOME%\bedework\dist\temp\shellscr\indexer
121
122   if exist %INDEXER% goto indexerok
123     ECHO The indexer directory %INDEXER% does not exist. You probably need to do a rebuild.
124     GOTO:EOF
125
126   :indexerok
127   cd %INDEXER%
128   bwrun.bat reindex-nostart -user admin -indexlocprefix ..\..\..\..\..\
129
130   GOTO:EOF
131
132 :zoneinfo
133    ECHO    zoneinfo target is not supported on Windows
134    GOTO:EOF
135    
136 :jbossNotice
137   ECHO *************************************************************
138   ECHO The jboss configuration has been removed from the quickstart.
139   ECHO It is now the default.  Remove the '-bwc jboss' option.
140   ECHO *************************************************************
141   GOTO:EOF
142
143 :doneWithArgs
144
145 IF "%bwc%" == "jboss" GOTO jbossNotice
146
147 IF NOT "%quickstart%empty" == "empty" GOTO checkBwConfig
148 IF NOT "%BWCONFIGS%empty" == "empty" GOTO DoneQB
149 SET BWCONFIGS=%HOMEPATH%\bwbuild
150 GOTO doneQB
151
152 :checkBwConfig
153
154   SET BWCONFIGS=%QUICKSTART_HOME%\bedework\config\bwbuild
155
156 :doneQB
157   SET BEDEWORK_CONFIGS_HOME=%BWCONFIGS%
158   SET BEDEWORK_CONFIG=%BWCONFIGS%\%bwc%
159
160   IF EXIST "%BEDEWORK_CONFIG%\build.properties" GOTO foundBuildProperties
161   ECHO *******************************************************
162   ECHO Error: Configuration %BEDEWORK_CONFIG%
163   ECHO does not exist or is not a Bedework configuration.
164   ECHO *******************************************************
165   GOTO:EOF
166 :foundBuildProperties
167
168   IF NOT "%JAVA_HOME%empty"=="empty" GOTO javaOk
169   ECHO *******************************************************
170   ECHO Error: JAVA_HOME is not defined correctly for Bedework.
171   ECHO *******************************************************
172   GOTO:EOF
173 :javaOk
174
175 :runBedework
176   :: Make available for ant
177   SET BWCONFIG=-Dorg.bedework.user.build.properties=%BEDEWORK_CONFIG%\build.properties
178
179   ECHO.
180   ECHO     BWCONFIGS = %BWCONFIGS%
181   ECHO     BWCONFIG = %BWCONFIG%
182   ECHO.
183
184   IF NOT "%caldav%empty" == "empty"  cd %QUICKSTART_HOME%\bedework\projects\caldav
185   IF NOT "%carddav%empty" == "empty" cd %QUICKSTART_HOME%\bedework-carddav
186   IF NOT "%client%empty" == "empty"  cd %QUICKSTART_HOME%\bwclient
187   IF NOT "%monitor%empty" == "empty" cd %QUICKSTART_HOME%\MonitorApp
188   IF NOT "%naming%empty" == "empty"  cd %QUICKSTART_HOME%\bwnaming
189   IF NOT "%tzsvr%empty" == "empty"   cd %QUICKSTART_HOME%\bwtzsvr
190   IF NOT "%webdav%empty" == "empty"  cd %QUICKSTART_HOME%\bedework\projects\webdav
191
192   "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% %offline% -Dant.home="%ANT_HOME%" org.apache.tools.ant.launch.Launcher "%BWCONFIG%" %1
193
194   GOTO:EOF
195
196
197 :: Iterate over the command line arguments;
198 :: DOS Batch labels can't contain hyphens, so convert them
199 :: (otherwise, we could just "GOTO %1")
200 :branch
201 IF "%1" == "-quickstart" GOTO quickstart
202 IF "%1" == "-bwchome" GOTO bwchome
203 IF "%1" == "-bwc" GOTO bwc
204 IF "%1" == "-offline" GOTO offline
205 IF "%1" == "-reindex" GOTO reindex
206 IF "%1" == "-zoneinfo" GOTO zoneinfo
207 IF "%1" == "-carddav" GOTO carddav
208 IF "%1" == "-caldav" GOTO caldav
209 IF "%1" == "-client" GOTO client
210 IF "%1" == "-webdav" GOTO webdav
211 IF "%1" == "-monitor" GOTO monitor
212 IF "%1" == "-naming" GOTO naming
213 IF "%1" == "-tzsvr" GOTO tzsvr
214 GOTO doneWithArgs
215
216 :usage
217   ECHO    Usage:
218   ECHO.
219   ECHO    bw [CONFIG-SOURCE] [CONFIG] [PROJECT] [ -offline ] [ target ]
220   ECHO    bw ACTION
221   ECHO.
222   ECHO    Where:
223   ECHO.
224   ECHO    CONFIG-SOURCE optionally defines the location of configurations and is one or none of
225   ECHO     -quickstart      to use the configurations within the quickstart
226   ECHO                      e.g. "bw -quickstart start"
227   ECHO     -bwchome path    to specify the location of the bwbuild directory
228   ECHO.
229   ECHO     The default is to look in the user home for the "bwbuild" directory.
230   ECHO.
231   ECHO    CONFIG optionally defines the configuration to build
232   ECHO      -bwc configname      e.g. "-bwc mysql"
233   ECHO.
234   ECHO    -offline     Build without attempting to retrieve library jars
235   ECHO    target       Ant target to execute (e.g. "start")
236   ECHO.
237   ECHO.
238   ECHO.
239   ECHO    PROJECT optionally defines the package to build and is none or more of
240   ECHO     -carddav     Target is for the CardDAV build
241   ECHO     -monitor     Target is for the bedework monitor application
242   ECHO     -naming      Target is for the abstract naming api
243   ECHO     The default is a calendar build
244   ECHO.
245   ECHO    Invokes ant to build or deploy the Bedework system. Uses a configuration
246   ECHO    directory which contains one directory per configuration.
247   ECHO.
248   ECHO    Within each configuration directory we expect a file called
249   ECHO    build.properties which should point to the property and options file
250   ECHO    needed for the deploy process.
251   ECHO.
252   ECHO    In general these files will be in the same directory as build.properties.
253   ECHO    The environment variable BEDEWORK_CONFIG contains the path to the current
254   ECHO    configuration directory and can be used to build a path to the other files.
255   ECHO.
256   ECHO   ACTION defines an action to take usually in the context of the quickstart.
257   ECHO    In a deployed system many of these actions are handled directly by a
258   ECHO    deployed application. ACTION may be one of
259   ECHO      -reindex - runs the indexer directly out of the quickstart bedework
260   ECHO                 dist directory to rebuild the lucene indexes
261 REM   Don't support zoneinfo command on Windows for now
262 REM   ECHO      -zoneinfo - builds zoneinfo data for the timezones server
263 REM   ECHO                  requires -version and -tzdata parameters
264   ECHO.
265   ECHO.
266   ECHO.
Note: See TracBrowser for help on using the browser.