From efef4169ac764fb6bb614c1f4e0818bd9b14b925 Mon Sep 17 00:00:00 2001
From: Donnie Pinkston <donnie@cms.caltech.edu>
Date: Thu, 17 Jan 2019 16:21:06 -0800
Subject: [PATCH] Improve support for NanoDB on Windows

Updated the nanodb script to properly handle being run under Git Bash.
Needed to wrap the Java program with "winpty" when starting it from Git
Bash.

Also updated the Surefire configuration to not require all tests to pass
before building a JAR file.  There are a few tests that aren't working
on Windows due to file-locking differences from *NIX.
---
 nanodb  | 23 +++++++++++++++--------
 pom.xml |  2 ++
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/nanodb b/nanodb
index 954a538..ee19f56 100755
--- a/nanodb
+++ b/nanodb
@@ -19,14 +19,21 @@ JAVA_OPTS="-Dlog4j.configurationFile=log4j2.properties"
 # uncomment this line:
 # JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5009"
 
-
-# See if we have the rlwrap utility; if so, it makes using NanoDB
-# from the command-line sooo much nicer...
-testrl=$(which rlwrap)
-if [ -z "$testrl" ]
-then
-    java $JAVA_OPTS "$@" -jar $NANODB_SERVER_JAR
+PLATFORM=`uname`
+if [[ $PLATFORM == *"MINGW"* ]]; then
+	# Windows, probably git bash
+	WRAPPER=winpty
 else
-    rlwrap java $JAVA_OPTS "$@" -jar $NANODB_SERVER_JAR
+	# See if we have the rlwrap utility; if so, it makes using NanoDB
+	# from the command-line sooo much nicer...
+	testrl=$(which rlwrap)
+	if [ -z "$testrl" ]; then
+		# No wrapper
+		WRAPPER=
+	else
+		WRAPPER=rlwrap
+	fi
 fi
 
+$WRAPPER java $JAVA_OPTS "$@" -jar $NANODB_SERVER_JAR
+
diff --git a/pom.xml b/pom.xml
index df782a2..2ea0a77 100644
--- a/pom.xml
+++ b/pom.xml
@@ -133,6 +133,8 @@
                     <forkCount>1</forkCount>
                     <reuseForks>true</reuseForks>
 
+                    <testFailureIgnore>true</testFailureIgnore>
+
                     <systemPropertyVariables>
                         <log4j.configurationFile>log4j2.properties</log4j.configurationFile>
                     </systemPropertyVariables>
-- 
GitLab