From 7e88a303109af4216682bc6a097a348561f40e3a Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 30 Nov 2016 12:00:43 -0500 Subject: [PATCH] LP#1646166 Linux/Mac builder fetches JSON libs Signed-off-by: Bill Erickson --- INSTALL.adoc | 19 +++++++++++-------- hatch.sh | 9 +++++++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/INSTALL.adoc b/INSTALL.adoc index d971cc0..4b190d4 100644 --- a/INSTALL.adoc +++ b/INSTALL.adoc @@ -26,14 +26,17 @@ for prime time as of writing. ==== Download org.json Java JSON Library ==== -[source,sh] -------------------------------------------------------------------------- -$ mkdir -p lib -$ cd lib -$ wget -O json-20160810.jar \ - 'https://search.maven.org/remotecontent?filepath=org/json/json/20160810/json-20160810.jar' -$ cd ../ -------------------------------------------------------------------------- +===== Linux ===== + +The org.json jar file is retrieved automatically when running +'hatch.sh compile' (below). + +===== Windows ===== + +1. Create a directory called "lib" inside the Hatch directory. +2. Download the JSON jar file and put it into the "lib" directory: + +https://search.maven.org/remotecontent?filepath=org/json/json/20160810/json-20160810.jar ==== Compile Hatch Java ==== diff --git a/hatch.sh b/hatch.sh index 20627e8..251ac57 100755 --- a/hatch.sh +++ b/hatch.sh @@ -6,11 +6,20 @@ JAVA_HOME=jdk1.8 JAVA=$JAVA_HOME/bin/java JAVAC=$JAVA_HOME/bin/javac LOGS=-Djava.util.logging.config.file=logging.properties +JSON_BUILD="20160810" +JSON_JAR="json-$JSON_BUILD.jar" +JSON_URL="https://search.maven.org/remotecontent?filepath=org/json/json/$JSON_BUILD/$JSON_JAR" COMMAND="$1" if [ "$COMMAND" == "compile" ]; then + mkdir -p lib + if [ ! -f lib/$JSON_JAR ]; then + echo "Fetching JSON libs..." + wget -O lib/$JSON_JAR $JSON_URL + fi; + $JAVAC -Xdiags:verbose -Xlint:unchecked \ -cp lib:lib/\* -d lib src/org/evergreen_ils/hatch/*.java -- 2.11.0