source: gs3-extensions/i-jetty/trunk/src/JAVA-TO-DEX.sh@ 23888

Last change on this file since 23888 was 23888, checked in by davidb, 13 years ago

Minor tidy-up tweaks to install scripts

File size: 2.5 KB
Line 
1#!/bin/bash
2
3
4
5JARS="LuceneWrapper.jar axis.jar commons-lang3-3.0-beta.jar cp.jar \
6 gsdl3.jar gutil.jar \
7 jdbm.jar js.jar serializer.jar \
8 xercesImpl.jar xml-apis.jar"
9
10
11#---
12# Copy GS3 classes files to I-Jetty classes
13#---
14
15if [ -d classes ] ; then
16 echo "#---"
17 echo "# Regenerating directory: classes"
18 echo "#---"
19 /bin/rm -rf classes
20fi
21
22echo "#---"
23echo "# Copying Greenstone-3 classes to the I-Jetty extension"
24/bin/cp -rf "$GSDL3HOME/WEB-INF/classes" classes
25
26echo "# Setting GSDL3HOME to match SD-Card on Android device"
27echo "#---"
28
29if [ "x$IJOS" = "xcygwin" ] ; then
30 SDCARD_GSDL3HOME_ONDEVICE=`echo $SDCARD_GSDL3HOME | sed 's@^/cygdrive/./@/sdcard/@'`
31else
32 echo "Need to change mapped location of Android device on host machine"
33 echo "But no support currently implemented for: $IJOS"
34 SDCARD_GSDL3HOME_ONDEVICE=$SDCARD_GSDL3HOME
35fi
36
37cat classes/global.properties \
38 | sed "s@^gsdl3\.home=.*@gsdl3.home=$SDCARD_GSDL3HOME_ONDEVICE@" \
39 | sed "s@^tomcat\.port=.*@tomcat.port=$IJETTY_PORT@" \
40 > classes/global.properties.android
41
42/bin/mv classes/global.properties.android classes/global.properties
43
44cat classes/log4j.properties \
45 | sed "s@^gsdl3\.home=.*@gsdl3.home=$SDCARD_GSDL3HOME_ONDEVICE@" \
46 > classes/log4j.properties.android
47
48/bin/mv classes/log4j.properties.android classes/log4j.properties
49
50
51#---
52# Copy selected GS3 Jar files to I-Jetty jars
53#---
54
55echo "#---"
56if [ -d jars ] ; then
57 echo "# Regenerating jars"
58 /bin/rm -rf jars
59else
60 echo "# Generating jars"
61fi
62echo "#---"
63mkdir jars
64
65for f in $JARS ; do
66 echo " Copying from Greenstone-3 to I-Jetty: $f"
67 /bin/cp "$GSDL3HOME/WEB-INF/lib/$f" jars/.
68done
69
70echo "Topping up 'jars' with Android specific jars"
71/bin/cp -r extra-jars/* jars/.
72
73
74#---
75# Generate dex file in I-Jetty 'classes' directory
76#---
77
78
79# If need more memory, add
80# -JXmx1024M
81
82OUTPUT_DEX=$IJETTY_HOME/classes/classes.dex
83INPUT_DIR=$IJETTY_HOME/jars
84
85
86
87if [ "x$IJOS" = "xcygwin" ] ; then
88 OUTPUT_DEX=`cygpath -w $OUTPUT_DEX`
89 INPUT_DIR=`cygpath -w $INPUT_DIR`
90fi
91
92# add --verbose for more information
93dx.bat --dex --core-library --positions=lines --output=$OUTPUT_DEX $INPUT_DIR
94
95#---
96# Zip up I-Jetty classes directory and put it in lib
97#---
98
99echo "#---"
100if [ -d lib ] ; then
101 echo "# Regenerating directory: lib"
102 /bin/rm -rf lib
103else
104 echo "# Generating directory: lib"
105fi
106echo "#---"
107mkdir lib
108
109echo "#---"
110echo "Zipping up I-Jetty 'classes' and storing in 'lib'"
111echo "#---"
112(cd classes && zip -r ../lib/classes.zip . && cd ..)
113
114
115echo ""
116echo "Run ./DEX-TO-SDCARD.sh to install the latest DEX files on the device"
117echo ""
Note: See TracBrowser for help on using the repository browser.