diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-05-19 23:30:22 -0700 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-05-19 23:33:52 -0700 |
commit | ed48bcdd96c3e465d76bac93591b53a54a3d9eb3 (patch) | |
tree | bcf2e54d999c6b4d25c1ccc4f937cdead5b50cbe /main | |
parent | 40838f958810a4c8158239eef8e96394fea23c89 (diff) | |
download | mill-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')
-rw-r--r-- | main/client/src/mill/main/client/MillClientMain.java | 16 | ||||
-rw-r--r-- | main/src/mill/main/RunScript.scala | 1 |
2 files changed, 3 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(); diff --git a/main/src/mill/main/RunScript.scala b/main/src/mill/main/RunScript.scala index 50cbb213..5f10db44 100644 --- a/main/src/mill/main/RunScript.scala +++ b/main/src/mill/main/RunScript.scala @@ -76,6 +76,7 @@ object RunScript{ log: Logger ): Res[mill.define.BaseModule] = { + log.info("RunScript.evaluateRootModule") val (pkg, wrapper) = Util.pathToPackageWrapper(Seq(), path relativeTo wd) for { |