summaryrefslogtreecommitdiff
path: root/main/client
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-05-19 23:30:22 -0700
committerLi Haoyi <haoyi.sg@gmail.com>2018-05-19 23:33:52 -0700
commited48bcdd96c3e465d76bac93591b53a54a3d9eb3 (patch)
treebcf2e54d999c6b4d25c1ccc4f937cdead5b50cbe /main/client
parent40838f958810a4c8158239eef8e96394fea23c89 (diff)
downloadmill-ed48bcdd96c3e465d76bac93591b53a54a3d9eb3.tar.gz
mill-ed48bcdd96c3e465d76bac93591b53a54a3d9eb3.tar.bz2
mill-ed48bcdd96c3e465d76bac93591b53a54a3d9eb3.zip
Preserve caches between interactive and client/server mode (#342)
We were incorrectly duplicating the JDK classpath as part of the application classpath when we spawned the Mill server from the Mill client. This makes the transmission of application classpath to the Mill server explicit via an environment variable, so we don't end up including random things from the client classloader hierarchy that we didn't expect
Diffstat (limited to 'main/client')
-rw-r--r--main/client/src/mill/main/client/MillClientMain.java16
1 files changed, 2 insertions, 14 deletions
diff --git a/main/client/src/mill/main/client/MillClientMain.java b/main/client/src/mill/main/client/MillClientMain.java
index 17a043f6..e3d3ec6e 100644
--- a/main/client/src/mill/main/client/MillClientMain.java
+++ b/main/client/src/mill/main/client/MillClientMain.java
@@ -11,20 +11,8 @@ import java.util.*;
public class MillClientMain {
static void initServer(String lockBase, boolean setJnaNoSys) throws IOException,URISyntaxException{
- ArrayList<String> selfJars = new ArrayList<String>();
- ClassLoader current = MillClientMain.class.getClassLoader();
- while(current != null){
- if (current instanceof java.net.URLClassLoader) {
- URL[] urls = ((java.net.URLClassLoader) current).getURLs();
- for (URL url: urls) {
- selfJars.add(new File(url.toURI()).getCanonicalPath());
- }
- }
- current = current.getParent();
- }
- if (Util.isJava9OrAbove) {
- selfJars.addAll(Arrays.asList(System.getProperty("java.class.path").split(File.pathSeparator)));
- }
+ String[] selfJars = System.getProperty("MILL_CLASSPATH").split(File.pathSeparator);
+
ArrayList<String> l = new java.util.ArrayList<String>();
l.add("java");
Properties props = System.getProperties();