From 43d23037c7f0d659ff6ad5e78dc71cfd3ed083ec Mon Sep 17 00:00:00 2001 From: Robby Date: Fri, 16 Mar 2018 11:04:33 -0500 Subject: Test mill (client/server) non-interactive on Windows and set jna.nosys=true as default (#229) * If unspecified, set the jna.nosys property to true on non-interactive (client/server) mode. * Run publishLocal and release (interactive) on AppVeyor and use the resulting mill to test mill (non-interactive). --- clientserver/src/mill/clientserver/Client.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'clientserver/src') diff --git a/clientserver/src/mill/clientserver/Client.java b/clientserver/src/mill/clientserver/Client.java index 248d3de1..eab8c5b5 100644 --- a/clientserver/src/mill/clientserver/Client.java +++ b/clientserver/src/mill/clientserver/Client.java @@ -15,8 +15,7 @@ import java.util.Iterator; import java.util.Properties; public class Client { - - static void initServer(String lockBase) throws IOException,URISyntaxException{ + static void initServer(String lockBase, boolean setJnaNoSys) throws IOException,URISyntaxException{ ArrayList selfJars = new ArrayList(); ClassLoader current = Client.class.getClassLoader(); while(current != null){ @@ -44,6 +43,9 @@ public class Client { String k = keys.next(); if (k.startsWith("MILL_")) l.add("-D" + k + "=" + props.getProperty(k)); } + if (setJnaNoSys) { + l.add("-Djna.nosys=true"); + } l.add("-cp"); l.add(String.join(File.pathSeparator, selfJars)); l.add("mill.ServerMain"); @@ -55,6 +57,10 @@ public class Client { .start(); } public static void main(String[] args) throws Exception{ + boolean setJnaNoSys = System.getProperty("jna.nosys") == null; + if (setJnaNoSys) { + System.setProperty("jna.nosys", "true"); + } int index = 0; while (index < 5) { index += 1; @@ -73,7 +79,7 @@ public class Client { @Override public void run() { try{ - initServer(lockBase); + initServer(lockBase, setJnaNoSys); }catch(Exception e){ throw new RuntimeException(e); } -- cgit v1.2.3