1 | #pre checks
|
---|
2 |
|
---|
3 | if [ "$rk_name" == "" ]; then
|
---|
4 | echo "rk_name not set";
|
---|
5 | exit;
|
---|
6 | elif [ "$RK_HOME" == "" ]; then
|
---|
7 | echo "RK_HOME not set";
|
---|
8 | exit
|
---|
9 | fi
|
---|
10 |
|
---|
11 | function 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 | #work out the classpath
|
---|
38 | CLASSPATH=$JAVA_HOME/lib/tools.jar
|
---|
39 | for file in $RK_HOME/lib/*.jar; do
|
---|
40 | CLASSPATH=$CLASSPATH:$file
|
---|
41 | done
|
---|
42 | for file in $RK_HOME/packages/ant/lib/*.jar; do
|
---|
43 | CLASSPATH=$CLASSPATH:$file
|
---|
44 | done
|
---|
45 | for file in $RK_HOME/packages/ant-installer/lib/*.jar; do
|
---|
46 | CLASSPATH=$CLASSPATH:$file
|
---|
47 | done
|
---|
48 | CLASSPATH=$CLASSPATH:$RK_HOME/packages/ant-installer/classes
|
---|
49 |
|
---|
50 | export CLASSPATH
|
---|
51 |
|
---|
52 | #set ANT_HOME
|
---|
53 | export ANT_HOME=$RK_HOME/packages/ant
|
---|
54 | export ANT_OPTS=-Xmx800M
|
---|
55 |
|
---|
56 | #create the command
|
---|
57 | toexec="$ANT_HOME/bin/ant -addressing -lib `pwd`/installer/classes -f $RK_HOME/ant-scripts/build.xml -Dbasedir=`pwd` -D$rk_name.home=$RK_HOME"
|
---|
58 |
|
---|
59 | #pass on the arguments
|
---|
60 | while [ "$1" != "" ]; do
|
---|
61 |
|
---|
62 | if [ "$1" == "-help" ]; then
|
---|
63 | show_help
|
---|
64 | exit
|
---|
65 | elif [ "$1" == "-cp" ]; then
|
---|
66 | echo $CLASSPATH
|
---|
67 | exit
|
---|
68 | elif [ "$1" == "-sim" ]; then
|
---|
69 | toexec="$toexec $1"
|
---|
70 | sim_mode=on
|
---|
71 | else
|
---|
72 | toexec="$toexec $1"
|
---|
73 | fi
|
---|
74 | shift
|
---|
75 |
|
---|
76 | done
|
---|
77 |
|
---|
78 | #create directories
|
---|
79 | if [ "$sim_mode" != "on" ]; then
|
---|
80 | if [ ! -d "installer/classes" ]; then mkdir -p installer/classes; fi
|
---|
81 | fi
|
---|