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

Revision 16541, 2.5 KB (checked in by oranfry, 12 years ago)

a little bug fix

  • 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 "      (shortcut for -Dexecute=false)"
19    echo "      simulation only, don't actually do anything"
20    echo
21    echo "  -from <target>"
22    echo "      (shortcut for -Dresume.from=<target>)"
23    echo "      start execution from the target with the given target address"
24    echo "      first level targets can be referred to by name. E.g., -from compile is the same as -from 1"
25    echo
26    echo "  -descend <target>"
27    echo "      (shortcut for -Dresume.descend=<target>)"
28    echo "      execute only the descendents of the target specified with -from"
29    echo "      for example, with -descend 3, targets 3.1, 3.2, 3.3 etc. would be executed, but execution
30    echo "      would stop before target 4
31    echo
32    echo "  -cp"
33    echo "      show the classpath being used by $rk_name"
34
35}
36
37#work out the classpath
38CLASSPATH=$JAVA_HOME/lib/tools.jar
39for file in $RK_HOME/lib/*.jar; do
40    CLASSPATH=$CLASSPATH:$file
41done
42for file in $RK_HOME/packages/ant/lib/*.jar; do
43    CLASSPATH=$CLASSPATH:$file
44done
45for file in $RK_HOME/packages/ant-installer/lib/*.jar; do
46    CLASSPATH=$CLASSPATH:$file
47done
48CLASSPATH=$CLASSPATH:$RK_HOME/packages/ant-installer/classes
49
50#create the command
51toexec="$RK_HOME/packages/ant/bin/ant -lib `pwd`/installer/classes -f $RK_HOME/ant-scripts/build.xml -Dbasedir=`pwd` -D$rk_name.home=$RK_HOME"
52
53#pass on the arguments
54while [ "$1" != "" ]; do
55
56    if [ "$1" == "-help" ]; then
57        show_help
58        exit
59
60    elif [ "$1" == "-cp" ]; then
61        echo $CLASSPATH
62        exit
63
64    elif [ "$1" == "-sim" ]; then
65        toexec="$toexec -Dexecute=false"
66        shift
67
68    elif [ "$1" == "-descend" ]; then
69        toexec="$toexec -Dresume.descend="
70        descend=`echo $2 | sed 's/compile/1/g' | sed 's/create-distributions/2/g' | sed 's/create-installer/3/g' | sed 's/wrap/4/g'`
71        toexec=$toexec$descend
72        shift 2
73
74    elif [ "$1" == "-from" ]; then
75
76        toexec="$toexec -Dresume.from="
77        from=`echo $2 | sed 's/compile/1/g' | sed 's/create-distributions/2/g' | sed 's/create-installer/3/g' | sed 's/wrap/4/g'`
78        toexec=$toexec$from
79        shift 2
80
81    elif [ "$1" == "-to" ]; then
82
83        toexec="$toexec -Dresume.to="
84        to=`echo $2 | sed 's/compile/1/g' | sed 's/create-distributions/2/g' | sed 's/create-installer/3/g' | sed 's/wrap/4/g'`
85        toexec=$toexec$to
86        shift 2
87
88
89    else
90        toexec="$toexec $1"
91        shift
92    fi
93
94done
Note: See TracBrowser for help on using the browser.