source: release-kits/shared/linux/rk@ 19037

Last change on this file since 19037 was 19037, checked in by oranfry, 15 years ago

-properties option to release kits, which runs the properties ant target intended to show the user a list of properties the release kit supports

  • Property svn:executable set to *
File size: 2.9 KB
Line 
1#!/bin/bash
2function show_title() {
3 echo "O---------------------------------------------O"
4 echo
5 echo " $rk_name ";
6 echo " $rk_fullname ";
7 echo
8 echo "O---------------------------------------------O"
9
10 #for a in `seq 0 $(( 40 - ${#rk_name} ))`; do echo -n " "; done; echo "|"
11 #for a in `seq 0 $(( 40 - ${#rk_fullname} ))`; do echo -n " "; done; echo "|"
12
13}
14
15#pre checks
16if [ "$rk_name" == "" ]; then
17 echo "rk_name not set";
18 exit;
19elif [ "$RK_HOME" == "" ]; then
20 echo "RK_HOME not set";
21 exit
22fi
23
24function show_help {
25
26 echo "$rk_name - $rk_fullname"
27 echo "Helps you to create releases from the Repository"
28 echo
29 echo "usage: $rk_name [-sim] [-from <target>] [other-args]"
30 echo " -sim"
31 echo " simulation only, don't actually do anything"
32 echo
33 echo " -help"
34 echo " show this help screen"
35 echo
36 echo " -from <target>"
37 echo " start execution from the target with the given target address"
38 echo
39 echo " -to <target>"
40 echo " stop execution just before the target with the given target address"
41 echo
42 echo " -descend <target>"
43 echo " execute only the target with the given address, including subtargets"
44 echo
45 echo " -cp"
46 echo " show the classpath being used by $rk_name"
47 echo
48 echo " -cmd"
49 echo " show the ant command being used by $rk_name"
50 echo
51 echo " -properties"
52 echo " show the properties required/allowed in $rk_name-build.properties"
53
54}
55
56#cd up a level or two if needed
57if [ ! -e "$rk_name-build.properties" ]; then
58 if [ -e "../$rk_name-build.properties" ]; then
59 RKOLDPWD=`pwd`
60 cd ..
61 elif [ -e "../../$rk_name-build.properties" ]; then
62 RKOLDPWD=`pwd`
63 cd ../..
64 fi
65fi
66
67#work out the classpath
68CLASSPATH=$JAVA_HOME/lib/tools.jar
69for file in $RK_HOME/core/lib/*.jar; do
70 CLASSPATH=$CLASSPATH:$file
71done
72for file in $RK_HOME/core/ant/lib/*.jar; do
73 CLASSPATH=$CLASSPATH:$file
74done
75for file in $RK_HOME/core/ant-installer/lib/*.jar; do
76 CLASSPATH=$CLASSPATH:$file
77done
78CLASSPATH=$CLASSPATH:$RK_HOME/core/ant-installer/classes
79
80export CLASSPATH
81
82#set ANT_HOME
83export ANT_HOME=$RK_HOME/core/ant
84export ANT_OPTS=-Xmx800M
85
86#create the command
87toexec="$ANT_HOME/bin/ant -addressing -lib `pwd`/installer/classes -f $RK_HOME/ant-scripts/build.xml -Dbasedir=`pwd` -D$rk_name.home=$RK_HOME"
88
89#pass on the arguments
90while [ "$1" != "" ]; do
91
92 if [ "$1" == "-help" ]; then
93 show_help
94 exit
95 elif [ "$1" == "-cp" ]; then
96 echo $CLASSPATH
97 exit
98 elif [ "$1" == "-cmd" ]; then
99 show_cmd=true
100 elif [ "$1" == "-properties" ]; then
101 target="properties"
102 elif [ "$1" == "-sim" ]; then
103 toexec="$toexec $1"
104 sim_mode=on
105 else
106 toexec="$toexec $1"
107 fi
108 shift
109
110done
111
112if [ "$target" != "" ]; then
113 toexec="$toexec $target"
114fi
115
116#execute (or show the command to be executed)
117if [ "$show_cmd" == "true" ]; then
118 echo $toexec
119elif [ "$sim_mode" == "on" ]; then
120 show_title
121 $toexec
122elif [ "$target" == "properties" ]; then
123 show_title
124 $toexec
125else
126 show_title | tee ${rk_name}.out
127 $toexec 2>&1 | tee -a ${rk_name}.out
128fi
129
130if [ "$RKOLDPWD" != "" ]; then
131 cd $RKOLDPWD
132fi
133
Note: See TracBrowser for help on using the repository browser.