root/release-kits/shared/linux/rk @ 17633

Revision 17633, 1.9 KB (checked in by oranfry, 11 years ago)

a new rk script which doesn't create the intaller directory before starting ant, and which also checks a few levels up for a build.properties if needed

  • Property svn:executable set to *
Line 
1#pre checks
2
3if [ "$rk_name" == "" ]; then
4    echo "rk_name not set";
5    exit;
6elif [ "$RK_HOME" == "" ]; then
7    echo "RK_HOME not set";
8    exit
9fi
10
11function show_help {
12
13    echo "$rk_name - $rk_fullname"
14    echo "Helps you to create releases from the Repository"
15    echo
16    echo "usage: $rk_name [-sim] [-from <target>] [other-args]"
17    echo "  -sim"
18    echo "      simulation only, don't actually do anything"
19    echo
20    echo "  -help"
21    echo "      show this help screen"
22    echo
23    echo "  -from <target>"
24    echo "      start execution from the target with the given target address"
25    echo
26    echo "  -to <target>"
27    echo "      stop execution just before the target with the given target address"
28    echo
29    echo "  -descend <target>"
30    echo "      execute only the target with the given address, including subtargets"
31    echo
32    echo "  -cp"
33    echo "      show the classpath being used by $rk_name"
34
35}
36
37#cd up a level or two if needed
38if [ ! -e "build.properties" ]; then
39    if [ -e "../build.properties" ]; then
40        RKOLDPWD=`pwd`
41        cd ..
42    elif [ -e "../../build.properties" ]; then
43        RKOLDPWD=`pwd`
44        cd ../..
45    fi
46fi
47
48#work out the classpath
49CLASSPATH=$JAVA_HOME/lib/tools.jar
50for file in $RK_HOME/lib/*.jar; do
51    CLASSPATH=$CLASSPATH:$file
52done
53for file in $RK_HOME/packages/ant/lib/*.jar; do
54    CLASSPATH=$CLASSPATH:$file
55done
56for file in $RK_HOME/packages/ant-installer/lib/*.jar; do
57    CLASSPATH=$CLASSPATH:$file
58done
59CLASSPATH=$CLASSPATH:$RK_HOME/packages/ant-installer/classes
60
61export CLASSPATH
62
63#set ANT_HOME
64export ANT_HOME=$RK_HOME/packages/ant
65export ANT_OPTS=-Xmx800M
66
67#create the command
68toexec="$ANT_HOME/bin/ant -addressing -lib `pwd`/installer/classes -f $RK_HOME/ant-scripts/build.xml -Dbasedir=`pwd` -D$rk_name.home=$RK_HOME"
69
70#pass on the arguments
71while [ "$1" != "" ]; do
72
73    if [ "$1" == "-help" ]; then
74        show_help
75        exit
76    elif [ "$1" == "-cp" ]; then
77        echo $CLASSPATH
78        exit
79    elif [ "$1" == "-sim" ]; then
80        toexec="$toexec $1"
81        sim_mode=on
82    else
83        toexec="$toexec $1"
84    fi
85    shift
86
87done
88
89if [ "$RKOLDPWD" != "" ]; then
90    cd $RKOLDPWD
91fi
92   
Note: See TracBrowser for help on using the browser.