root/releases/bedework-3.5/build/quickstart/windows/bw.bat

Revision 2389 (checked in by johnsa, 4 years ago)

correct bw.bat user home variable

  • 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 :: Default some parameters
19 SET BWCONFIGS=
20 SET bwc=default
21 SET BWCONFIG=
22 SET offline=
23 SET quickstart=
24
25 :: check for command-line arguments and branch on them
26 IF "%1noargs" == "noargs" GOTO usage
27 GOTO branch
28
29 :quickstart
30   ECHO     Preparing quickstart build ...
31   SET quickstart="yes"
32   SHIFT
33   GOTO branch
34
35 :bwchome
36   :: Define location of configs
37   SHIFT
38   SET BWCONFIGS=%1
39   SHIFT
40   GOTO branch
41
42 :bwc
43   SHIFT
44   SET bwc=%1
45   SHIFT
46   GOTO branch
47
48 :offline
49   ECHO     Setting to offline mode; libraries will not be downloaded ...
50   SET offline="-Dorg.bedework.offline.build=yes"
51   SHIFT
52   GOTO branch
53
54 :doneWithArgs
55
56 IF NOT "%quickstart%empty" == "empty" GOTO checkBwConfig
57 IF NOT "%BWCONFIGS%empty" == "empty" GOTO DoneQB
58 SET BWCONFIGS=%HOMEPATH%\bwbuild
59 GOTO doneQB
60
61 :checkBwConfig
62 REM  IF "%BWCONFIGS%empty" == "empty" GOTO doneQB
63 REM    ECHO *******************************************************
64 REM    ECHO Error: Cannot specIFy both -quickstart and -bwchome
65 REM    ECHO *******************************************************
66 REM    GOTO:EOF
67
68   SET BWCONFIGS=%QUICKSTART_HOME%\bedework\config\bwbuild
69
70 :doneQB
71   SET BEDEWORK_CONFIGS_HOME=%BWCONFIGS%
72   SET BEDEWORK_CONFIG=%BWCONFIGS%\%bwc%
73
74   IF EXIST "%BEDEWORK_CONFIG%\build.properties" GOTO foundBuildProperties
75   ECHO *******************************************************
76   ECHO Error: Configuration %BEDEWORK_CONFIG%
77   ECHO does not exist or is not a Bedework configuration.
78   ECHO *******************************************************
79   GOTO:EOF
80 :foundBuildProperties
81
82   IF NOT "%JAVA_HOME%empty"=="empty" GOTO javaOk
83   ECHO *******************************************************
84   ECHO Error: JAVA_HOME is not defined correctly for Bedework.
85   ECHO *******************************************************
86   GOTO:EOF
87 :javaOk
88
89 :runBedework
90   :: Make available for ant
91   SET BWCONFIG=-Dorg.bedework.user.build.properties=%BEDEWORK_CONFIG%\build.properties
92
93   ECHO.
94   ECHO     BWCONFIGS = %BWCONFIGS%
95   ECHO     BWCONFIG = %BWCONFIG%
96   ECHO.
97
98   SET ANT_HOME=%QUICKSTART_HOME%\apache-ant-1.7.0
99
100   SET CLASSPATH="%ANT_HOME%\lib\ant-launcher.jar"
101
102   "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% %offline% -Dant.home="%ANT_HOME%" org.apache.tools.ant.launch.Launcher "%BWCONFIG%" %1
103
104   GOTO:EOF
105
106
107 :: Iterate over the command line arguments;
108 :: DOS Batch labels can't contain hyphens, so convert them
109 :: (otherwise, we could just "GOTO %1")
110 :branch
111 IF "%1" == "-quickstart" GOTO quickstart
112 IF "%1" == "-bwchome" GOTO bwchome
113 IF "%1" == "-bwc" GOTO bwc
114 IF "%1" == "-offline" GOTO offline
115 GOTO doneWithArgs
116
117 :usage
118   ECHO    Usage:
119   ECHO.
120   ECHO    %0 [ -quickstart OR -bwchome path ] [ -bwc configname ] [ -offline ] [ target ]
121   ECHO.
122   ECHO      -quickstart  Use the current quickstart configurations.
123   ECHO      -bwchome     Specify path to configurations
124   ECHO      -bwc         Specify configuration name
125   ECHO      -offline     Build without atempting to retrieve library jars
126   ECHO      target       Ant target to execute
127   ECHO.
128   ECHO    Invokes ant to build or deploy the Bedework system. Uses a configuration
129   ECHO    directory which contains one directory per configuration.
130   ECHO.
131   ECHO    Within each configuration directory we expect a file called
132   ECHO    build.properties which should point to the property and options file
133   ECHO    needed for the deploy process.
134   ECHO.
135   ECHO    In general these files will be in the same directory as build.properties.
136   ECHO    The environment variable BEDEWORK_CONFIG contains the path to the current
137   ECHO    configuration directory and can be used to build a path to the other files.
138   ECHO.
139   ECHO.
Note: See TracBrowser for help on using the browser.