deployToRi.sh 1.76 KB
Newer Older
Kevin Kershaw's avatar
Kevin Kershaw committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
#  File:        deployToRi.sh
#  Author:      Nick Nielsen <n.nielsen@cablelabs.com>
#  Date:        Wed Jul 29 14:24:16 2009
#  Description: deployToRi.sh
#  This is a batch script that can be used to easily install an
#  application in the OpenCable tru2way Reference Implementation (RI) stack
#  simulator's execution environment.  

APPNAME="Checkout Tool"
DIRNAME="CheckoutTool_4.30.09"
CLASSESROOT="$DIRNAME"
CLASSNAME="org.cablelabs.ocap.checkouttool.CheckOutToolXlet"
XLET="$DIRNAME/org/cablelabs/ocap/checkouttool/CheckOutToolXlet.class"
DIR="$1/ocap/bin/CableLabs/simulator/Win32/debug/env/$DIRNAME"

if [ -z "$1" ] ; then 
    echo "Usage:  ./deployToRi.sh [DIR]"
    echo "   where [DIR] is the base directory of the RI to which $APPNAME"
    echo "   should be deployed (the directory containing the runRI.bat script)."
    exit -1
fi

if [ ! -d "$1" ] ; then
    echo "ERROR: $1 is an invalid directory."
    exit -1
fi

if [ ! -f "$1/runRI.bat" ] ; then
    echo "ERROR: $1 does not contain a valid RI installation (must contain "
    echo "       the \"runRI.bat\" script."
    exit -1
fi

if [ ! -f "$XLET" ] ; then 
    echo "ERROR: You must first compile the $APPNAME Xlet before deploying."
    exit -1
fi

rm -rf "$DIR"
mkdir -p "$DIR"

cp -r $CLASSESROOT/* "$DIR"

echo "$APPNAME successfully deployed to: $DIR"
echo
echo "To execute this application in the RI, you must add an entry to the"
echo "ocap-ri\ocap\bin\CableLabs\simulator\Win32\debug\env\hostapp.properties file."
echo 
echo "Here is an example of such an entry:"
echo
echo app.0.application_name=$APPNAME
echo app.0.initial_class_name=$CLASSNAME
echo app.0.application_identifier=0x000000015206
echo app.0.application_control_code=AUTOSTART
echo app.0.visibility=VISIBLE
echo app.0.base_directory=/syscwd/$DIRNAME