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