diff options
author | Sakib Hadžiavdić <sake92@users.noreply.github.com> | 2018-09-17 03:20:28 +0200 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-09-17 09:20:28 +0800 |
commit | 7f54d7f64d20784945557433d182b831ce7ce00f (patch) | |
tree | 6ceda9486fd975fbd844f3c600cf0d61d531d456 /build.sc | |
parent | be441e786ead9cc251418856189751b3e51d325e (diff) | |
download | mill-7f54d7f64d20784945557433d182b831ce7ce00f.tar.gz mill-7f54d7f64d20784945557433d182b831ce7ce00f.tar.bz2 mill-7f54d7f64d20784945557433d182b831ce7ce00f.zip |
fix MILL_CLASSPATH for windows script (#434)
Diffstat (limited to 'build.sc')
-rwxr-xr-x | build.sc | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -379,7 +379,7 @@ object dev extends MillModule{ ).distinct - // Pass dev.assembly VM options via file in Window due to small max args limit + // Pass dev.assembly VM options via file in Windows due to small max args limit def windowsVmOptions(taskName: String, batch: Path, args: Seq[String])(implicit ctx: mill.util.Ctx) = { if (System.getProperty("java.specification.version").startsWith("1.")) { throw new Error(s"$taskName in Windows is only supported using Java 9 or above") @@ -450,19 +450,20 @@ object dev extends MillModule{ 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", + val commonArgs = Seq( "-DMILL_VERSION=" + publishVersion()._2, // Workaround for Zinc/JNA bug // https://github.com/sbt/sbt/blame/6718803ee6023ab041b045a6988fafcfae9d15b5/main/src/main/scala/sbt/Main.scala#L130 "-Djna.nosys=true" ) + val shellArgs = Seq("-DMILL_CLASSPATH=$0") ++ commonArgs + val cmdArgs = Seq("-DMILL_CLASSPATH=%0") ++ commonArgs mv( createAssembly( dev.runClasspath().map(_.path), prependShellScript = launcherScript( - args, - args, + shellArgs, + cmdArgs, Agg("$0"), Agg("%~dpnx0") ) |