From 5766840e1978b5db7612020c64d2dd33967175d2 Mon Sep 17 00:00:00 2001 From: "Joseph K. Strauss" Date: Wed, 30 May 2018 21:20:12 -0400 Subject: Fix MILL_CLASSPATH for Windows (#354) * Use comma as separator in MILL_CLASSPATH There is no need to use environment-specific separator, especially since - other variables are using commas anyway, and - it is not sent to any system-level command * Fix whitespace * Use MILL_CLASSPATH for Windows * Use vm options file for client on windows * Remove overzealous distinct * Clean up unnecessary ceremony --- build.sc | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'build.sc') diff --git a/build.sc b/build.sc index ef7fdf9d..f018b8a1 100755 --- a/build.sc +++ b/build.sc @@ -294,12 +294,18 @@ def launcherScript(shellJvmArgs: Seq[String], object dev extends MillModule{ def moduleDeps = Seq(scalalib, scalajslib) def forkArgs = - (scalalib.testArgs() ++ - scalajslib.testArgs() ++ - scalalib.worker.testArgs() ++ - // Workaround for Zinc/JNA bug - // https://github.com/sbt/sbt/blame/6718803ee6023ab041b045a6988fafcfae9d15b5/main/src/main/scala/sbt/Main.scala#L130 - Seq("-Djna.nosys=true", "-DMILL_VERSION=" + build.publishVersion()._2)).distinct + ( + scalalib.testArgs() ++ + scalajslib.testArgs() ++ + scalalib.worker.testArgs() ++ + // Workaround for Zinc/JNA bug + // https://github.com/sbt/sbt/blame/6718803ee6023ab041b045a6988fafcfae9d15b5/main/src/main/scala/sbt/Main.scala#L130 + Seq( + "-Djna.nosys=true", + "-DMILL_VERSION=" + build.publishVersion()._2, + "-DMILL_CLASSPATH=" + runClasspath().map(_.path.toString).mkString(",") + ) + ).distinct // Pass dev.assembly VM options via file in Window due to small max args limit def windowsVmOptions(taskName: String, batch: Path, args: Seq[String])(implicit ctx: mill.util.Ctx) = { @@ -339,11 +345,11 @@ object dev extends MillModule{ def prependShellScript = T{ val classpath = runClasspath().map(_.path.toString) - val args = forkArgs().distinct + val args = forkArgs() val (shellArgs, cmdArgs) = if (!scala.util.Properties.isWin) ( - Seq("-DMILL_CLASSPATH=" + classpath.mkString(":")) ++ args, - Seq("-DMILL_CLASSPATH=" + classpath.mkString(";")) ++ args + args, + args ) else ( Seq("""-XX:VMOptionsFile="$( dirname "$0" )"/mill.vmoptions"""), -- cgit v1.2.3