From 31436827de1a489660b273fb3ec34b00368b79e3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Reimar=20D=C3=B6ffinger?= Date: Wed, 6 Jan 2016 17:10:12 +0100 Subject: [PATCH] More robust compilation script. --- compile.sh | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/compile.sh b/compile.sh index a25e09b..9fe8e8d 100755 --- a/compile.sh +++ b/compile.sh @@ -1 +1,29 @@ -javac -g ../Util/src/com/hughes/util/*.java ../Util/src/com/hughes/util/raf/*.java ../Dictionary/src/com/hughes/android/dictionary/DictionaryInfo.java ../Dictionary/src/com/hughes/android/dictionary/engine/*.java ../Dictionary/src/com/hughes/android/dictionary/C.java src/com/hughes/android/dictionary/*.java src/com/hughes/android/dictionary/*/*.java src/com/hughes/android/dictionary/*/*/*.java -classpath /usr/share/java/icu4j-49.1.jar:/usr/share/java/junit.jar:/usr/share/java/xercesImpl.jar:/usr/share/java/commons-lang3.jar +ICU4J=/usr/share/java/icu4j-49.1.jar +test -r "$ICU4J" || ICU4J=/usr/share/icu4j-55/lib/icu4j.jar +JUNIT=/usr/share/java/junit.jar +test -r "$JUNIT" || JUNIT=/usr/share/junit/lib/junit.jar +XERCES=/usr/share/java/xercesImpl.jar +test -r "$XERCES" || XERCES=/usr/share/xerces-2/lib/xercesImpl.jar +COMMONS=/usr/share/java/commons-lang3.jar +test -r "$COMMONS" || COMMONS=/usr/share/commons-lang-3.3/lib/commons-lang.jar +if [ ! -x ../Util -o ! -x ../Dictionary ] ; then + echo "You need to clone Util and Dictionary repositories into .." + exit 1 +fi +if [ ! -r "$ICU4J" ] ; then + echo "ICU4J needs to be installed" + exit 1; +fi +if [ ! -r "$JUNIT" ] ; then + echo "Junit needs to be installed" + exit 1; +fi +if [ ! -r "$XERCES" ] ; then + echo "Xerces needs to be installed" + exit 1; +fi +if [ ! -r "$COMMONS" ] ; then + echo "commons-lang needs to be installed" + exit 1; +fi +javac -g ../Util/src/com/hughes/util/*.java ../Util/src/com/hughes/util/raf/*.java ../Dictionary/src/com/hughes/android/dictionary/DictionaryInfo.java ../Dictionary/src/com/hughes/android/dictionary/engine/*.java ../Dictionary/src/com/hughes/android/dictionary/C.java src/com/hughes/android/dictionary/*.java src/com/hughes/android/dictionary/*/*.java src/com/hughes/android/dictionary/*/*/*.java -classpath "$ICU4J:$JUNIT:$XERCES:$COMMONS" -- 2.43.0