3 # Linux/Mac Hatch Execution Script
7 # Use this for local extract of Java libs
10 JAVA=$JAVA_HOME/bin/java
11 JAVAC=$JAVA_HOME/bin/javac
12 JAR=$JAVA_HOME/bin/jar
13 LOGS=-Djava.util.logging.config.file=logging.properties
15 JSON_JAR="json-$JSON_BUILD.jar"
16 JSON_URL="https://search.maven.org/remotecontent?filepath=org/json/json/$JSON_BUILD/$JSON_JAR"
20 if [ "$COMMAND" == "compile" ]; then
23 if [ ! -f lib/$JSON_JAR ]; then
24 echo "Fetching JSON libs..."
25 wget -O lib/$JSON_JAR $JSON_URL
28 $JAVAC -Xdiags:verbose -Xlint:unchecked \
29 -cp lib/\* -d lib src/org/evergreen_ils/hatch/*.java
31 # Create a JAR file from the compiled class files them remove them.
32 $JAR cf lib/hatch.jar -C lib org
35 elif [ "$COMMAND" == "test" ]; then
37 # 1. Run TestHatch in (default) send mode, which emits JSON requests
38 # 2. Run Hatch and process messages emitted from #1.
39 # 3. Run TestHatch in receive mode to log the responses.
41 $JAVA "$LOGS" -cp lib/\* org.evergreen_ils.hatch.TestHatch \
42 | $JAVA "$LOGS" -cp lib/\* org.evergreen_ils.hatch.Hatch \
43 | $JAVA "$LOGS" -cp lib/\* org.evergreen_ils.hatch.TestHatch receive
48 $JAVA "$LOGS" -cp lib/\* org.evergreen_ils.hatch.Hatch