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

Revision 1943 (checked in by douglm, 5 years ago)

move scripts

  • 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=%HOME%\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% does not exist or is not a bedework configuration.
77   ECHO *******************************************************
78   GOTO:EOF
79 :foundBuildProperties
80
81   IF NOT "%JAVA_HOME%empty"=="empty" GOTO javaOk
82   ECHO *******************************************************
83   ECHO Error: JAVA_HOME is not defined correctly for bedework.
84   ECHO *******************************************************
85   GOTO:EOF
86 :javaOk
87
88 :runBedework
89   :: Make available for ant
90   SET BWCONFIG=-Dorg.bedework.user.build.properties=%BEDEWORK_CONFIG%\build.properties
91
92   ECHO.
93   ECHO     BWCONFIGS = %BWCONFIGS%
94   ECHO     BWCONFIG = %BWCONFIG%
95   ECHO.
96
97   SET ANT_HOME=%QUICKSTART_HOME%\apache-ant-1.7.0
98
99   SET CLASSPATH="%ANT_HOME%\lib\ant-launcher.jar"
100
101   "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% %offline% -Dant.home=%ANT_HOME% org.apache.tools.ant.launch.Launcher %BWCONFIG% %1
102
103   GOTO:EOF
104
105
106 :: Iterate over the command line arguments;
107 :: DOS Batch labels can't contain hyphens, so convert them
108 :: (otherwise, we could just "GOTO %1")
109 :branch
110 IF "%1" == "-quickstart" GOTO quickstart
111 IF "%1" == "-bwchome" GOTO bwchome
112 IF "%1" == "-bwc" GOTO bwc
113 IF "%1" == "-offline" GOTO offline
114 GOTO doneWithArgs
115
116 :usage
117   ECHO    Usage:
118   ECHO.
119   ECHO    %0 [ -quickstart OR -bwchome path ] [ -bwc configname ] [ -offline ] [ target ]
120   ECHO.
121   ECHO      -quickstart  Use the current quickstart configurations.
122   ECHO      -bwchome     Specify path to configurations
123   ECHO      -bwc         Specify configuration name
124   ECHO      -offline     Build without atempting to retrieve library jars
125   ECHO      target       Ant target to execute
126   ECHO.
127   ECHO    Invokes ant to build or deploy the bedework system. Uses a configuration
128   ECHO    directory which contains one directory per configuration.
129   ECHO.
130   ECHO    Within each configuration directory we expect a file called
131   ECHO    build.properties which should point to the property and options file
132   ECHO    needed for the deploy process.
133   ECHO.
134   ECHO    In general these files will be in the same directory as build.properties.
135   ECHO    The environment variable BEDEWORK_CONFIG contains the path to the current
136   ECHO    configuration directory and can be used to build a path to the other files.
137   ECHO.
138   ECHO.
Note: See TracBrowser for help on using the browser.