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

Revision 3252 (checked in by douglm, 2 years ago)

Change usage text in bw scripts to clarify what's required.

Remove reindex option. Now done via JMX console

  • 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
23 :: Default some parameters
24 SET BWCONFIGS=
25 SET bwc=default
26 SET BWCONFIG=
27 SET offline=
28 SET quickstart=
29
30 SET ant_listener=
31 SET ant_xmllogfile=
32 SET ant_logger=
33
34 SET ant_loglevel="-quiet"
35 SET bw_loglevel=""
36
37 :: Projects we need to update
38 SET updateProjects="bwxml bedework bedework-carddav bwtzsvr cachedfeeder"
39
40 :: Projects we will build
41 SET pkgdefault=yes
42 SET bedework=
43 SET bwxml=
44 SET carddav=
45 SET caldav=
46 SET client=
47 SET monitor=
48 SET naming=
49 SET tzsvr=
50 SET webdav=
51
52 SET action=
53
54 :: check for command-line arguments and branch on them
55 IF "%1noargs" == "noargs" GOTO usage
56 GOTO branch
57
58 :quickstart
59   ECHO     Preparing quickstart build ...
60   SET quickstart="yes"
61   SHIFT
62   GOTO branch
63
64 :bwchome
65   :: Define location of configs
66   SHIFT
67   SET BWCONFIGS=%1
68   SHIFT
69   GOTO branch
70
71 :bwc
72   SHIFT
73   SET bwc=%1
74   SHIFT
75   GOTO branch
76
77 :offline
78   ECHO     Setting to offline mode; libraries will not be downloaded ...
79   SET offline="-Dorg.bedework.offline.build=yes"
80   SHIFT
81   GOTO branch
82  
83
84 :: ----------------------- Log level       
85
86 :log-silent
87   SET ant_loglevel="-quiet"
88   SET bw_loglevel="-Dorg.bedework.build.silent=true"
89   SHIFT
90   GOTO branch
91
92 :log-quiet
93   SET ant_loglevel="-quiet"
94   SET bw_loglevel=""
95   SHIFT
96   GOTO branch
97
98 :log-inform
99   SET ant_loglevel=""
100   SET bw_loglevel="-Dorg.bedework.build.inform=true"
101   SHIFT
102   GOTO branch
103
104 :log-verbose
105   SET ant_loglevel="-verbose"
106   SET bw_loglevel="-Dorg.bedework.build.inform=true -Dorg.bedework.build.noisy=true"
107   SHIFT
108   GOTO branch
109
110 :ant-debug
111   SET ant_loglevel="-debug"
112   SHIFT
113   GOTO branch
114
115 :build-debug
116   SET bw_loglevel="-Dorg.bedework.build.inform=true -Dorg.bedework.build.noisy=true -Dorg.bedework.build.debug=true "
117   SHIFT
118   GOTO branch
119      
120 :: ----------------------- PROJECTS
121
122 :bwxml
123   SET bwxml="yes"
124   SET pkgdefault=
125   SHIFT
126   GOTO branch
127  
128 :carddav
129   SET carddav="yes"
130   SET pkgdefault=
131   SHIFT
132   GOTO branch
133  
134 :caldav
135   SET caldav="yes"
136   SET pkgdefault=
137   SHIFT
138   GOTO branch
139  
140 :client
141   SET client="yes"
142   SET pkgdefault=
143   SHIFT
144   GOTO branch
145  
146 :webdav
147   SET webdav="yes"
148   SET pkgdefault=
149   SHIFT
150   GOTO branch
151  
152 :monitor
153   SET monitor="yes"
154   SET pkgdefault=
155   SHIFT
156   GOTO branch
157
158 :naming
159   SET naming="yes"
160   SET pkgdefault=
161   SHIFT
162   GOTO branch
163  
164 :tzsvr
165   SET tzsvr="yes"
166   SET pkgdefault=
167   SHIFT
168   GOTO branch
169
170 :updateall
171   for %%p in ("%updateProjects%") do (
172     ECHO *************************************************************
173     ECHO Updating project %%p
174     ECHO *************************************************************
175    
176     svn update %%p
177   )
178
179   GOTO:EOF
180  
181 :zoneinfo
182    ECHO    zoneinfo target is not supported on Windows
183    GOTO:EOF
184    
185 :buildwebcache
186    cd %QUICKSTART_HOME%\cachedfeeder
187    buildWebCache.bat
188    GOTO:EOF
189
190 :deploywebcache
191   cd %QUICKSTART_HOME%\cachedfeeder
192   "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% -Dant.home="%ANT_HOME%" org.apache.tools.ant.launch.Launcher "%BWCONFIG%" deploy-webcache
193    GOTO:EOF
194    
195 :deployurlbuilder
196   cd %QUICKSTART_HOME%\cachedfeeder
197   "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% -Dant.home="%ANT_HOME%" org.apache.tools.ant.launch.Launcher "%BWCONFIG%" deploy-urlbuilder
198    GOTO:EOF
199    
200 :jbossNotice
201   ECHO *************************************************************
202   ECHO The jboss configuration has been removed from the quickstart.
203   ECHO It is now the default.  Remove the '-bwc jboss' option.
204   ECHO *************************************************************
205   GOTO:EOF
206
207 :doneWithArgs
208
209 IF "%bwc%" == "jboss" GOTO jbossNotice
210
211 IF NOT "%quickstart%empty" == "empty" GOTO checkBwConfig
212 IF NOT "%BWCONFIGS%empty" == "empty" GOTO DoneQB
213 SET BWCONFIGS=%HOMEPATH%\bwbuild
214 GOTO doneQB
215
216 :checkBwConfig
217
218   SET BWCONFIGS=%QUICKSTART_HOME%\bedework\config\bwbuild
219
220 :doneQB
221   SET BEDEWORK_CONFIGS_HOME=%BWCONFIGS%
222   SET BEDEWORK_CONFIG=%BWCONFIGS%\%bwc%
223
224   IF EXIST "%BEDEWORK_CONFIGS_HOME%\.platform" GOTO foundDotPlatform
225   ECHO *******************************************************
226   ECHO Error: Configurations directory %BEDEWORK_CONFIGS_HOME%
227   ECHO is missing directory '.platform'.
228   ECHO *******************************************************
229   GOTO:EOF
230 :foundDotPlatform
231
232   IF EXIST "%BEDEWORK_CONFIG%\build.properties" GOTO foundBuildProperties
233   ECHO *******************************************************
234   ECHO Error: Configuration %BEDEWORK_CONFIG%
235   ECHO does not exist or is not a Bedework configuration.
236   ECHO *******************************************************
237   GOTO:EOF
238 :foundBuildProperties
239
240   IF NOT "%JAVA_HOME%empty"=="empty" GOTO javaOk
241   ECHO *******************************************************
242   ECHO Error: JAVA_HOME is not defined correctly for Bedework.
243   ECHO *******************************************************
244   GOTO:EOF
245 :javaOk
246
247 :runBedework
248   :: Make available for ant
249   SET BWCONFIG=-Dorg.bedework.user.build.properties=%BEDEWORK_CONFIG%\build.properties
250
251   ECHO.
252   ECHO     BWCONFIGS = %BWCONFIGS%
253   ECHO     BWCONFIG = %BWCONFIG%
254
255   IF NOT "%bwxml%empty" == "empty"  cd %QUICKSTART_HOME%\bwxml
256   IF NOT "%caldav%empty" == "empty"  cd %QUICKSTART_HOME%\bedework\projects\caldav
257   IF NOT "%carddav%empty" == "empty" cd %QUICKSTART_HOME%\bedework-carddav
258   IF NOT "%client%empty" == "empty"  cd %QUICKSTART_HOME%\bwclient
259   IF NOT "%monitor%empty" == "empty" cd %QUICKSTART_HOME%\MonitorApp
260   IF NOT "%naming%empty" == "empty"  cd %QUICKSTART_HOME%\bwnaming
261   IF NOT "%tzsvr%empty" == "empty"   cd %QUICKSTART_HOME%\bwtzsvr
262   IF NOT "%webdav%empty" == "empty"  cd %QUICKSTART_HOME%\bedework\projects\webdav
263
264   ECHO     WORKING DIRECTORY = %cd%
265   ECHO     COMMAND =  "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% %offline% -Dant.home="%ANT_HOME%" org.apache.tools.ant.launch.Launcher "%BWCONFIG%" %ant_listener% %ant_logger% %ant_loglevel% %bw_loglevel% %1
266   ECHO.
267   ECHO.
268   "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% %offline% -Dant.home="%ANT_HOME%" org.apache.tools.ant.launch.Launcher "%BWCONFIG%" %ant_listener% %ant_logger% %ant_loglevel% %bw_loglevel% %1
269
270   GOTO:EOF
271
272
273 :: Iterate over the command line arguments;
274 :: DOS Batch labels can't contain hyphens, so convert them
275 :: (otherwise, we could just "GOTO %1")
276 :branch
277 IF "%1" == "-quickstart" GOTO quickstart
278 IF "%1" == "-bwchome" GOTO bwchome
279 IF "%1" == "-bwc" GOTO bwc
280 IF "%1" == "-offline" GOTO offline
281 IF "%1" == "-updateall" GOTO updateall
282 IF "%1" == "-zoneinfo" GOTO zoneinfo
283 IF "%1" == "-buildwebcache" GOTO buildwebcache
284 IF "%1" == "-deploywebcache" GOTO deploywebcache
285 IF "%1" == "-deployurlbuilder" GOTO deployurlbuilder
286
287 IF "%1" == "-log-silent" GOTO log-silent
288 IF "%1" == "-log-quiet" GOTO log-quiet
289 IF "%1" == "-log-inform" GOTO log-inform
290 IF "%1" == "-log-verbose" GOTO log-verbose
291 IF "%1" == "-ant-debug" GOTO ant-debug
292 IF "%1" == "-build-debug" GOTO build-debug
293
294 IF "%1" == "-bwxml" GOTO bwxml
295 IF "%1" == "-carddav" GOTO carddav
296 IF "%1" == "-caldav" GOTO caldav
297 IF "%1" == "-client" GOTO client
298 IF "%1" == "-webdav" GOTO webdav
299 IF "%1" == "-monitor" GOTO monitor
300 IF "%1" == "-naming" GOTO naming
301 IF "%1" == "-tzsvr" GOTO tzsvr
302 GOTO doneWithArgs
303
304 :usage
305   ECHO    Usage:
306   ECHO.
307   ECHO    bw ACTION
308   ECHO    bw [CONFIG-SOURCE] [CONFIG] [PROJECT] [ -offline ] [ target ]
309   ECHO.
310   ECHO    Where:
311   ECHO.
312   ECHO   ACTION defines an action to take usually in the context of the quickstart.
313   ECHO    In a deployed system many of these actions are handled directly by a
314   ECHO    deployed application. ACTION may be one of
315   ECHO      -updateall  Does an svn update of all projects"
316 REM   Don't support zoneinfo command on Windows for now
317 REM   ECHO      -zoneinfo - builds zoneinfo data for the timezones server
318 REM   ECHO                  requires -version and -tzdata parameters
319   ECHO      -buildwebcache    builds webcache
320   ECHO      -deploywebcache   deploys webcache
321   ECHO      -deployurlbuilder deploys url/widget builder
322   ECHO.
323   ECHO    CONFIG-SOURCE optionally defines the location of configurations and is one or none of
324   ECHO     -quickstart      to use the configurations within the quickstart
325   ECHO                      e.g. "bw -quickstart start"
326   ECHO     -bwchome path    to specify the location of the bwbuild directory
327   ECHO.
328   ECHO     The default is to look in the user home for the "bwbuild" directory.
329   ECHO.
330   ECHO    CONFIG optionally defines the configuration to build
331   ECHO      -bwc configname      e.g. "-bwc mysql"
332   ECHO.
333   ECHO    -offline     Build without attempting to retrieve library jars
334   ECHO    target       Ant target to execute (e.g. "start")
335   ECHO.
336   ECHO    PROJECT optionally defines the package to build and is one of
337   ECHO            the core, ancillary or experimental targets below:
338   ECHO.
339   ECHO   Core projects: required for a functioning system
340   ECHO      -bwxml       Target is for the Bedework XML schemas build
341   ECHO                       (usually built automatically be dependent projects
342   ECHO      -carddav     Target is for the CardDAV build
343   ECHO      -carddav deploy-addrbook    To deploy the Javascript Addressbook client.
344   ECHO      -tzsvr       Target is for the timezones server build
345   ECHO   Ancillary projects: not required
346   ECHO      -monitor     Target is for the bedework monitor application
347   ECHO   Experimental projects: no guarantees
348   ECHO      -client      Target is for the bedework client application build
349   ECHO      -exsynch     Target is for the Exchange synch build
350   ECHO      -naming      Target is for the abstract naming api
351   ECHO     The default is a calendar build
352   ECHO.
353   ECHO    Invokes ant to build or deploy the Bedework system. Uses a configuration
354   ECHO    directory which contains one directory per configuration.
355   ECHO.
356   ECHO    Within each configuration directory we expect a file called
357   ECHO    build.properties which should point to the property and options file
358   ECHO    needed for the deploy process.
359   ECHO.
360   ECHO    In general these files will be in the same directory as build.properties.
361   ECHO    The environment variable BEDEWORK_CONFIG contains the path to the current
362   ECHO    configuration directory and can be used to build a path to the other files.
363   ECHO.
364   ECHO.
365   ECHO.
Note: See TracBrowser for help on using the browser.