From 5ea90651ba6be7c3ea86f1d3123fa6af5b2f9ca8 Mon Sep 17 00:00:00 2001 From: Alexandra Dima Date: Tue, 23 Jul 2019 10:39:26 +0200 Subject: Updated the clean cache method of the mill build server to use system properties in order to assemble the correct, OS-independent, mill clean command. --- contrib/bsp/src/mill/contrib/bsp/MillBuildServer.scala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/contrib/bsp/src/mill/contrib/bsp/MillBuildServer.scala b/contrib/bsp/src/mill/contrib/bsp/MillBuildServer.scala index 9c74f2f0..e5319b77 100644 --- a/contrib/bsp/src/mill/contrib/bsp/MillBuildServer.scala +++ b/contrib/bsp/src/mill/contrib/bsp/MillBuildServer.scala @@ -405,7 +405,14 @@ class MillBuildServer(evaluator: Evaluator, var cleaned = true for (targetId <- cleanCacheParams.getTargets.asScala) { val module = targetIdToModule(targetId) - val process = Runtime.getRuntime.exec(s"mill clean ${module.millModuleSegments.render}.compile") + val cleanCommand = List("java", + s"-DMILL_CLASSPATH=${System.getProperty("MILL_CLASSPATH")}", + s"-DMILL_VERSION=${System.getProperty("MILL_VERSION")}", + "-Djna.nosys=true", "-cp", + System.getProperty("MILL_CLASSPATH"), + "mill.MillMain", "clean", + s"${module.millModuleSegments.render}.compile") + val process = Runtime.getRuntime.exec(cleanCommand.mkString(" ")) val processIn = process.getInputStream val processErr = process.getErrorStream -- cgit v1.2.3