Changeset 26522 for gs3-extensions

Show
Ignore:
Timestamp:
27.11.2012 04:15:12 (7 years ago)
Author:
davidb
Message:

Script restructured to avoid explicit 'exit' if setup-android.bash not found (because this script is sourced the 'exit' annoying used to cause the terminal window to exit, not just stop the script)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs3-extensions/i-jetty/trunk/src/setup.bash

    r25623 r26522  
    1  
    2  
    31 
    42if [ "x$ANDROID_SDK_HOME" = "x" ] ; then 
    53  if [ ! -e setup-android.bash ] ; then 
     4    echo "" 
    65    echo "Unable to find 'setup-android.bash'.  You either need to:" 1>&2 
    76    echo "  1) copy setup-android.bash.in to setup-android.bash and" 1>&2 
     
    109    echo "  2) Explicitly set the environment variable ANDROID_SDK_HOME" 1>&2 
    1110    echo "     and make sure 'dx' is on your PATH" 1>&2 
    12     exit 
    1311  else  
    1412    source setup-android.bash 
     13 
     14    export IJETTY_HOME=`pwd` 
     15    export IJOS=`uname | sed 's/^cygwin.*$/cygwin/i' | sed 's/^mingw.*$/mingw/i'` 
     16     
     17    if [ "x$GSDL3HOME" = "x" ] ; then 
     18    echo "  Setting GSDL3HOME to '../../web'" 
     19    export GSDL3HOME=../../web 
     20    else  
     21    echo "Using existing value of GSDL3HOME: '$GSDL3HOME'" 
     22    fi 
     23     
     24    export PREPARE_SDCARD_GSDL3HOME=$IJETTY_HOME/webapps/greenstone3/ 
     25     
     26    export WITHIN_SDCARD_WEBAPPS=/sdcard/jetty/webapps 
     27    export WITHIN_SDCARD_GSDL3HOME=$WITHIN_SDCARD_WEBAPPS/greenstone3 
     28     
     29    echo "" 
     30    echo "  Using:" 
     31    echo "" 
     32    echo "     $PREPARE_SDCARD_GSDL3HOME" 
     33    echo "" 
     34    echo "  as the webapps *preparation* area for the Greenstone servlet" 
     35    echo "" 
     36    echo "  Using:" 
     37    echo "" 
     38    echo "     $WITHIN_SDCARD_GSDL3HOME" 
     39    echo "" 
     40    echo "  as the *installation* point for the Greenstone servlet on the sd-card" 
     41    echo "" 
     42 
     43 
     44    if [ "x$IJETTY_PORT" = "x" ] ; then 
     45    export IJETTY_PORT=8080 
     46    echo "" 
     47    echo "  Setting IJETTY_PORT to 8080" 
     48    echo "  Explicityly set this environment variable to override this default" 
     49    echo "" 
     50    else 
     51    echo "" 
     52    echo "  Using IJETTY PORT = $IJETTY_PORT" 
     53    echo "" 
     54    fi 
     55 
     56    echo "+ Your environment has now been set up with iJetty extension for Greenstone" 
     57 
     58    echo "" 
     59    echo "======" 
     60    echo "If this is the first time you have installed Greenstone on the Android device, " 
     61    echo " run:" 
     62    echo "" 
     63    echo "   adb install i-jetty-3.1-signed-aligned.apk" 
     64    echo "" 
     65    echo "to install jetty on your device, followed by" 
     66    echo "" 
     67    echo "  ./PREPARE-WEBAPPS-GREENSTONE-ROOT-FOR-IJETTY.sh" 
     68    echo "" 
     69    echo "to set up Greenstone3's 'web' directory for the i-jetty webapps area." 
     70    echo "" 
     71    echo "Then:" 
     72    echo "" 
     73    echo "  ./JAVA-TO-DEX.sh" 
     74    echo "" 
     75    echo "to cross-compile Greenstone java code to the Android DEX format and add it to the webapps area." 
     76    echo "" 
     77    echo "Finally run:" 
     78    echo "" 
     79    echo "  ./IJETTY-PUSH.sh webapps/greenstone3" 
     80    echo "" 
     81    echo "to install the Greenstone3's webapps folder (including cross-compiled DEX files) on the Android device" 
     82    echo "======" 
     83    echo "" 
     84 
    1585  fi 
    1686fi 
    17  
    18 export IJETTY_HOME=`pwd` 
    19 export IJOS=`uname | sed 's/^cygwin.*$/cygwin/i' | sed 's/^mingw.*$/mingw/i'` 
    20  
    21 if [ "x$GSDL3HOME" = "x" ] ; then 
    22   echo "  Setting GSDL3HOME to '../../web'" 
    23   export GSDL3HOME=../../web 
    24 else  
    25   echo "Using existing value of GSDL3HOME: '$GSDL3HOME'" 
    26 fi 
    27  
    28 export PREPARE_SDCARD_GSDL3HOME=$IJETTY_HOME/webapps/greenstone3/ 
    29  
    30 export WITHIN_SDCARD_WEBAPPS=/sdcard/jetty/webapps 
    31 export WITHIN_SDCARD_GSDL3HOME=$WITHIN_SDCARD_WEBAPPS/greenstone3 
    32  
    33 echo "" 
    34 echo "  Using:" 
    35 echo "" 
    36 echo "     $PREPARE_SDCARD_GSDL3HOME" 
    37 echo "" 
    38 echo "  as the webapps *preparation* area for the Greenstone servlet" 
    39 echo "" 
    40 echo "  Using:" 
    41 echo "" 
    42 echo "     $WITHIN_SDCARD_GSDL3HOME" 
    43 echo "" 
    44 echo "  as the *installation* point for the Greenstone servlet on the sd-card" 
    45 echo "" 
    46  
    47  
    48 if [ "x$IJETTY_PORT" = "x" ] ; then 
    49   export IJETTY_PORT=8080 
    50   echo "" 
    51   echo "  Setting IJETTY_PORT to 8080" 
    52   echo "  Explicityly set this environment variable to override this default" 
    53   echo "" 
    54 else 
    55   echo "" 
    56   echo "  Using IJETTY PORT = $IJETTY_PORT" 
    57   echo "" 
    58 fi 
    59  
    60 echo "+ Your environment has now been set up with iJetty extension for Greenstone" 
    61  
    62 echo "" 
    63 echo "======" 
    64 echo "If this is the first time you have installed Greenstone on the Android device, " 
    65 echo " run:" 
    66 echo "" 
    67 echo "   adb install i-jetty-2.2-signed.apk" 
    68 echo "" 
    69 echo "to install jetty on your device, followed by" 
    70 echo "" 
    71 echo "  ./PREPARE-WEBAPPS-GREENSTONE-ROOT-FOR-IJETTY.sh" 
    72 echo "" 
    73 echo "to set up Greenstone3's 'web' directory for the i-jetty webapps area." 
    74 echo "" 
    75 echo "Then:" 
    76 echo "" 
    77 echo "  ./JAVA-TO-DEX.sh" 
    78 echo "" 
    79 echo "to cross-compile Greenstone java code to the Android DEX format and add it to the webapps area." 
    80 echo "" 
    81 echo "Finally run:" 
    82 echo "" 
    83 echo "  ./IJETTY-PUSH.sh webapps/greenstone3" 
    84 echo "" 
    85 echo "to install the Greenstone3's webapps folder (including cross-compiled DEX files) on the Android device" 
    86 echo "======" 
    87 echo "" 
    8887 
    8988 
     
    9190 
    9291 
    93