source: release-kits/lirk3/bin/lirk3@ 15093

Last change on this file since 15093 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 2.4 KB
RevLine 
[14982]1function show_help {
2 echo "LiRK3 - the LInux Release Kit for greenstone3"
3 echo "Helps you to create releases of Greenstone3 from the Repository"
4 echo
5 echo "usage: lirk3 [-sim] [-from <target>] [other-args]"
6 echo " -sim"
7 echo " (shortcut for -Dexecute=false)"
8 echo " simulation only, don't actually do anything"
9 echo
10 echo " -from <target>"
11 echo " (shortcut for -Dresume.from=<target>)"
12 echo " start execution from the target with the given target address"
13 echo " first level targets can be referred to by name. E.g., -from compile is the same as -from 1"
14 echo
15 echo " -descend"
16 echo " (shortcut for -Dresume.mode=descend)"
17 echo " execute only the descendents of the target specified with -from"
18 echo " for example, with -from 3 -descend, targets 3.1, 3.2, 3.3 etc. would be executed, but execution
19 echo " would stop before target 4
20 echo
21 echo " -cp"
22 echo " show the classpath being used by LiRK3"
23 echo " (like `ant --diagnostics`)"
24
25}
26
27#work out the classpath
28CLASSPATH=$JAVA_HOME/lib/tools.jar
29for file in $LIRK3_HOME/lib/*.jar; do
30 CLASSPATH=$CLASSPATH:$file
31done
32for file in $LIRK3_HOME/bin/apache-ant-1.6.5/lib/*.jar; do
33 CLASSPATH=$CLASSPATH:$file
34done
35for file in $LIRK3_HOME/bin/ant-installer/lib/*.jar; do
36 CLASSPATH=$CLASSPATH:$file
37done
38CLASSPATH=$CLASSPATH:$LIRK3_HOME/bin/ant-installer/classes
39
40
41#create the command
42toexec="$LIRK3_HOME/bin/apache-ant-1.6.5/bin/ant -f $LIRK3_HOME/ant-scripts/build.xml -Dbasedir=`pwd` -Dlirk3.home=$LIRK3_HOME"
43
44#pass on the arguments
45while [ "$1" != "" ]; do
46
47 if [ "$1" == "-help" ]; then
48 show_help
49 exit
50
51 elif [ "$1" == "-cp" ]; then
52 echo $LIRK3_CLASSPATH
53 exit
54
55 elif [ "$1" == "-sim" ]; then
56 toexec="$toexec -Dexecute=false"
57 shift
58
59 elif [ "$1" == "-descend" ]; then
60 toexec="$toexec -Dresume.mode=descend"
61 shift
62
63 elif [ "$1" == "-from" ]; then
64
65 toexec="$toexec -Dresume.from="
66 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'`
67 toexec=$toexec$from
68 shift 2
69
70 elif [ "$1" == "-to" ]; then
71
72 toexec="$toexec -Dresume.to="
73 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'`
74 toexec=$toexec$to
75 shift 2
76
77
78 else
79 toexec="$toexec $1"
80 shift
81 fi
82
83done
84
85#echo $toexec
86echo "LiRK3"
87echo " Ant Script: $LIRK3_HOME/ant-scripts/build.xml"
88echo " Basedir: `pwd`"
89
90$toexec
Note: See TracBrowser for help on using the repository browser.