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 /build.sc | |
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 'build.sc')
-rwxr-xr-x | build.sc | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -316,7 +316,10 @@ object dev extends MillModule{ val classpath = runClasspath().map(_.path.toString) val args = forkArgs().distinct val (shellArgs, cmdArgs) = - if (!scala.util.Properties.isWin) (args, args) + if (!scala.util.Properties.isWin) ( + Seq("-DMILL_CLASSPATH=" + classpath.mkString(":")) ++ args, + Seq("-DMILL_CLASSPATH=" + classpath.mkString(";")) ++ args + ) else ( Seq("""-XX:VMOptionsFile="$( dirname "$0" )"/mill.vmoptions"""), Seq("""-XX:VMOptionsFile=%~dp0\mill.vmoptions""") @@ -345,6 +348,7 @@ def release = T{ val dest = T.ctx().dest val filename = if (scala.util.Properties.isWin) "mill.bat" else "mill" val args = Seq( + "-DMILL_CLASSPATH=$0", "-DMILL_VERSION=" + publishVersion()._2, // Workaround for Zinc/JNA bug // https://github.com/sbt/sbt/blame/6718803ee6023ab041b045a6988fafcfae9d15b5/main/src/main/scala/sbt/Main.scala#L130 |