1 | #!/bin/bash
|
---|
2 |
|
---|
3 | #determine requested release kit
|
---|
4 | echo $0
|
---|
5 | exit
|
---|
6 |
|
---|
7 |
|
---|
8 |
|
---|
9 | function show_title() {
|
---|
10 | echo "O---------------------------------------------O"
|
---|
11 | echo
|
---|
12 | echo " $rk_name ";
|
---|
13 | echo " $rk_fullname ";
|
---|
14 | echo
|
---|
15 | echo "O---------------------------------------------O"
|
---|
16 |
|
---|
17 | }
|
---|
18 |
|
---|
19 | #pre checks
|
---|
20 | if [ "$rk_name" == "" ]; then
|
---|
21 | echo "rk_name not set";
|
---|
22 | exit;
|
---|
23 | elif [ "$RK_HOME" == "" ]; then
|
---|
24 | echo "RK_HOME not set";
|
---|
25 | exit
|
---|
26 | fi
|
---|
27 |
|
---|
28 | function show_help {
|
---|
29 |
|
---|
30 | echo "$rk_name - $rk_fullname"
|
---|
31 | echo "Helps you to create releases from the Repository"
|
---|
32 | echo
|
---|
33 | echo "usage: $rk_name [-sim] [-from <target>] [other-args]"
|
---|
34 | echo " -sim"
|
---|
35 | echo " simulation only, don't actually do anything"
|
---|
36 | echo
|
---|
37 | echo " -help"
|
---|
38 | echo " show this help screen"
|
---|
39 | echo
|
---|
40 | echo " -from <target>"
|
---|
41 | echo " start execution from the target with the given target address"
|
---|
42 | echo
|
---|
43 | echo " -to <target>"
|
---|
44 | echo " stop execution just before the target with the given target address"
|
---|
45 | echo
|
---|
46 | echo " -descend <target>"
|
---|
47 | echo " execute only the target with the given address, including subtargets"
|
---|
48 | echo
|
---|
49 | echo
|
---|
50 | echo " -cmd"
|
---|
51 | echo " show the ant command being used by $rk_name"
|
---|
52 | echo
|
---|
53 | echo " -properties"
|
---|
54 | echo " show the properties required/allowed in $rk_name-build.properties"
|
---|
55 |
|
---|
56 | }
|
---|
57 |
|
---|
58 | #cd up a level or two if needed
|
---|
59 | if [ ! -e "$rk_name-build.properties" ]; then
|
---|
60 | if [ -e "../$rk_name-build.properties" ]; then
|
---|
61 | RKOLDPWD=`pwd`
|
---|
62 | cd ..
|
---|
63 | elif [ -e "../../$rk_name-build.properties" ]; then
|
---|
64 | RKOLDPWD=`pwd`
|
---|
65 | cd ../..
|
---|
66 | fi
|
---|
67 | fi
|
---|
68 |
|
---|
69 | #set ANT_HOME
|
---|
70 | export ANT_HOME=$RK_HOME/core/ant
|
---|
71 | export ANT_OPTS=-Xmx800M
|
---|
72 |
|
---|
73 | #create the command
|
---|
74 | toexec="ant -lib `pwd`/installer/classes -f $RK_HOME/ant-scripts/build.xml -Dbasedir=`pwd` -D$rk_name.home=$RK_HOME"
|
---|
75 |
|
---|
76 | #pass on the arguments
|
---|
77 | while [ "$1" != "" ]; do
|
---|
78 |
|
---|
79 | if [ "$1" == "-help" ]; then
|
---|
80 | show_help
|
---|
81 | exit
|
---|
82 | elif [ "$1" == "-cmd" ]; then
|
---|
83 | show_cmd=true
|
---|
84 | else
|
---|
85 | toexec="$toexec $1"
|
---|
86 | fi
|
---|
87 | shift
|
---|
88 |
|
---|
89 | done
|
---|
90 |
|
---|
91 | if [ "$target" != "" ]; then
|
---|
92 | toexec="$toexec $target"
|
---|
93 | fi
|
---|
94 |
|
---|
95 | #execute (or show the command to be executed)
|
---|
96 | if [ "$show_cmd" == "true" ]; then
|
---|
97 | echo $toexec
|
---|
98 | else
|
---|
99 | show_title | tee ${rk_name}.out
|
---|
100 | $toexec 2>&1 | tee -a ${rk_name}.out
|
---|
101 | fi
|
---|
102 |
|
---|
103 | if [ "$RKOLDPWD" != "" ]; then
|
---|
104 | cd $RKOLDPWD
|
---|
105 | fi
|
---|
106 |
|
---|