Changeset 1908

Show
Ignore:
Timestamp:
07/19/08 22:53:03
Author:
johnsa
Message:

updates to build scripts

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/bw

    r1899 r1908  
    22 
    33# 
    4 # This file is included by the quickstart script file bw so that it can live 
     4# This file is included by the quickstart script file "bw" so that it can live 
    55# within the svn repository. 
    66# 
     7 
     8echo "" 
     9echo "" 
     10echo "  Bedework Calendar System" 
     11ECHO "  ------------------------" 
     12ECHO "" 
     13 
    714PRG="$0" 
    815 
    916usage() { 
    10   echo "$PRG [-bwchome path | -quickstart ] [ -bwc configname ] [ -offline } [ target ] " 
     17  echo "  $PRG [ -quickstart | -bwchome path ] [ -bwc configname ] [ -offline } [ target ] " 
    1118  echo "" 
    12   echo " -bwchome specify path to configurations
    13   echo " -quickstart  Use the current quickstart configurations
    14   echo " - bwc specify configuration name" 
    15   echo " -offline  build without atempting to retrieve library jars" 
    16   echo " target  ant target to execute" 
     19  echo "     -quickstart  Use the current quickstart configurations
     20  echo "     -bwchome     Specify path to configurations
     21  echo "     -bwc         Specify configuration name" 
     22  echo "     -offline     Build without atempting to retrieve library jars" 
     23  echo "     target       Ant target to execute" 
    1724  echo "" 
    18   echo "Invokes ant to build or deploy the bedework system. Uses a configuration" 
    19   echo "directory which contains one directory per configuration." 
     25  echo "   Invokes ant to build or deploy the bedework system. Uses a configuration" 
     26  echo "   directory which contains one directory per configuration." 
    2027  echo "" 
    21   echo "Within each configuration directory we expect a file called build.properties" 
    22   echo "which should point to the proerty and options file needed for th edeploy process" 
     28  echo "   Within each configuration directory we expect a file called build.properties" 
     29  echo "   which should point to the property and options file needed for the deploy process" 
    2330  echo "" 
    24   echo "In general these files will be in the same directory as build.properties." 
    25   echo "The environment variable BEDEWORK_CONFIG contains the path to the current" 
    26   echo "configuration directory and can be used to build a path to the other files." 
     31  echo "   In general these files will be in the same directory as build.properties." 
     32  echo "   The environment variable BEDEWORK_CONFIG contains the path to the current" 
     33  echo "   configuration directory and can be used to build a path to the other files." 
    2734  echo "" 
    2835} 
  • trunk/build/bw.bat

    r1907 r1908  
    1 :: 
    2 :: This file is included by the quickstart script file bw.bat so that it can live 
    3 :: within the svn repository. 
    4 :: 
    5 set PRG=%0 
     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. 
    63 
    7 saveddir=`pwd` 
     4@ECHO off 
     5SETLOCAL 
    86 
    9 export QUICKSTART_HOME=$saveddir 
     7ECHO. 
     8ECHO. 
     9ECHO   Bedework Calendar System 
     10ECHO   ------------------------ 
     11ECHO. 
     12 
     13 
     14SET PRG=%0 
     15SET saveddir=%CD% 
     16SET QUICKSTART_HOME=%saveddir% 
    1017 
    1118:: Default some parameters 
     19SET BWCONFIGS= 
     20SET bwc=default 
     21SET BWCONFIG= 
     22SET offline= 
     23SET quickstart= 
    1224 
    13 set BWCONFIGS= 
    14 set bwc=default 
    15 set BWCONFIG= 
    16 set offline= 
    17 set quickstart= 
     25:: check for command-line arguments and branch on them 
     26IF "%1noargs" == "noargs" GOTO usage 
     27GOTO branch 
    1828 
    19 while [ "$1" != "" ] 
    20 do 
    21   # Process the next arg 
    22   case $1       # Look at $1 
    23   in 
    24     -bwchome)         # Define location of configs 
    25       shift 
    26       set BWCONFIGS="$1" 
    27       shift 
    28       ;; 
    29     -quickstart) 
    30       set quickstart="yes" 
    31       shift 
    32       ;; 
    33     -usage | -help | -? | ?) 
    34       goto usage 
    35       ;; 
    36     -bwc) 
    37       set shift 
    38       set bwc="$1" 
    39       shift 
    40       ;; 
    41     -offline) 
    42       set offline="-Dorg.bedework.offline.build=yes" 
    43       shift 
    44       ;; 
    45     -*) 
    46       goto usage 
    47       ;; 
    48     *) 
    49 ::    Assume we've reached the target(s) 
    50       break 
    51       ;; 
    52   esac 
    53 done 
     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 
    5443 
    55 if "%quickstart%" != "" GOTO :checkBwConfig 
    56   if "%BWCONFIGS%" != "" GOTO doneQB 
    57     set BWCONFIGS=%HOME%\bwbuild 
    58 GOTO :doneQB 
     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   
     60IF NOT "%quickstart%empty" == "empty" GOTO checkBwConfig 
     61IF NOT "%BWCONFIGS%empty" == "empty" GOTO DoneQB 
     62SET BWCONFIGS=%HOME%\bwbuild 
     63GOTO doneQB 
    5964 
    6065:checkBwConfig 
    61   if "%BWCONFIGS" == "" GOTO QB 
    62     echo ******************************************************* 
    63     echo Error: Cannot specify both -quickstart and -bwchome 
    64     echo ******************************************************* 
    65     GOTO :EOF 
     66REM  IF "%BWCONFIGS%empty" == "empty" GOTO doneQB 
     67REM    ECHO ******************************************************* 
     68REM    ECHO Error: Cannot specIFy both -quickstart and -bwchome 
     69REM    ECHO ******************************************************* 
     70REM    GOTO:EOF 
    6671 
    67   set BWCONFIGS=%QUICKSTART_HOME%\bedework\config\bwbuild 
     72  SET BWCONFIGS=%QUICKSTART_HOME%\bedework\config\bwbuild 
    6873 
    6974:doneQB 
     75  SET BEDEWORK_CONFIGS_HOME=%BWCONFIGS% 
     76  SET BEDEWORK_CONFIG=%BWCONFIGS%\%bwc% 
    7077 
    71 export BEDEWORK_CONFIGS_HOME=%BWCONFIGS% 
    72 export 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 
     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 
    7983:foundBuildProperties 
    8084 
    81 if not "%JAVA_HOME%"=="" goto javaOk 
    82   echo ******************************************************* 
    83   echo Error: JAVA_HOME is not defined correctly for bedework. 
    84   echo ******************************************************* 
    85   GOTO :EOF 
     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 
    8690:javaOk 
    8791 
    88 :: Make available for ant 
    89 set BWCONFIG=-Dorg.bedework.user.build.properties=%BEDEWORK_CONFIG%/build.properties" 
     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 
    90108 
    91 echo BWCONFIGS=%BWCONFIGS% 
    92 echo BWCONFIG=%BWCONFIG% 
    93  
    94 set ANT_HOME=`dirname "$PRG"`/apache-ant-1.7.0 
    95 set ANT_HOME=`cd "$ANT_HOME" && pwd` 
    96  
    97 set CLASSPATH=%ANT_HOME%/lib/ant-launcher.jar 
    98  
    99 %JAVA_HOME%\bin\java.exe -classpath %CLASSPATH% %offline% -Dant.home=%ANT% org.apache.tools.ant.launch.Launcher %BWCONFIG% %*% 
    100  
    101 GOTO :EOF 
    102  
     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 
     114IF "%1" == "-quickstart" GOTO quickstart 
     115IF "%1" == "-bwchome" GOTO bwchome 
     116IF "%1" == "-bwc" GOTO bwc 
     117IF "%1" == "-offline" GOTO offline 
     118   
    103119:usage 
    104   echo %PRG [-bwchome path | -quickstart ] [ -bwc configname ] [ -offline } [ target ] 
    105   echo 
    106   echo  -bwchome specify path to configurations 
    107   echo  -quickstart  Use the current quickstart configurations 
    108   echo  - bwc specify configuration name 
    109   echo  -offline  build without atempting to retrieve library jars 
    110   echo  target  ant target to execute 
    111   echo 
    112   echo Invokes ant to build or deploy the bedework system. Uses a configuration 
    113   echo directory which contains one directory per configuration. 
    114   echo 
    115   echo Within each configuration directory we expect a file called build.properties 
    116   echo which should point to the proerty and options file needed for the deploy process 
    117   echo 
    118   echo In general these files will be in the same directory as build.properties. 
    119   echo The environment variable BEDEWORK_CONFIG contains the path to the current 
    120   echo configuration directory and can be used to build a path to the other files. 
    121   echo 
    122  
     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.