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