diff options
author | Robby <robby@santoslab.org> | 2018-03-16 11:04:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-16 11:04:33 -0500 |
commit | 43d23037c7f0d659ff6ad5e78dc71cfd3ed083ec (patch) | |
tree | 3233c8e6270ed7552e35599e1e354887a0e41b45 /clientserver | |
parent | 712f331d24d0934cd9c653a12be7e47e1fff1f5d (diff) | |
download | mill-43d23037c7f0d659ff6ad5e78dc71cfd3ed083ec.tar.gz mill-43d23037c7f0d659ff6ad5e78dc71cfd3ed083ec.tar.bz2 mill-43d23037c7f0d659ff6ad5e78dc71cfd3ed083ec.zip |
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).
Diffstat (limited to 'clientserver')
-rw-r--r-- | clientserver/src/mill/clientserver/Client.java | 12 |
1 files changed, 9 insertions, 3 deletions
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<String> selfJars = new ArrayList<String>(); 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); } |