From b8ea19941f1eb037ad30f14bc1dea1c0a5ec5d3e Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 12 Aug 2024 17:05:22 -0700 Subject: [PATCH 01/10] . --- main/client/src/mill/main/client/MillLauncher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/client/src/mill/main/client/MillLauncher.java b/main/client/src/mill/main/client/MillLauncher.java index 0364f1c9720..be0e80189d8 100644 --- a/main/client/src/mill/main/client/MillLauncher.java +++ b/main/client/src/mill/main/client/MillLauncher.java @@ -45,7 +45,7 @@ static Process configureRunMillProcess(ProcessBuilder builder, builder.environment().put("MILL_WORKSPACE_ROOT", new File("").getCanonicalPath()); File sandbox = new java.io.File(lockBase + "/" + ServerFiles.sandbox); sandbox.mkdirs(); - // builder.directory(sandbox); + builder.directory(sandbox); return builder.start(); } From 6fcb6a56a5e64467245b5bac461ececd325e8b30 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 14 Aug 2024 10:50:31 -0700 Subject: [PATCH 02/10] . --- contrib/bloop/src/mill/contrib/bloop/Bloop.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bloop/src/mill/contrib/bloop/Bloop.scala b/contrib/bloop/src/mill/contrib/bloop/Bloop.scala index 99de7d536ec..d8aa5a7d218 100644 --- a/contrib/bloop/src/mill/contrib/bloop/Bloop.scala +++ b/contrib/bloop/src/mill/contrib/bloop/Bloop.scala @@ -5,4 +5,4 @@ import mill.eval.Evaluator /** * Usage : `mill mill.contrib.bloop.Bloop/install` */ -object Bloop extends BloopImpl(() => Evaluator.allBootstrapEvaluators.value.value, os.pwd) +object Bloop extends BloopImpl(() => Evaluator.allBootstrapEvaluators.value.value, WorkspaceRoot.workspaceRoot) From 8212b4876af15662ab220f80bbdf6662199fe1d2 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 14 Aug 2024 10:54:50 -0700 Subject: [PATCH 03/10] . --- contrib/bloop/src/mill/contrib/bloop/Bloop.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/bloop/src/mill/contrib/bloop/Bloop.scala b/contrib/bloop/src/mill/contrib/bloop/Bloop.scala index d8aa5a7d218..2966e0d3672 100644 --- a/contrib/bloop/src/mill/contrib/bloop/Bloop.scala +++ b/contrib/bloop/src/mill/contrib/bloop/Bloop.scala @@ -1,6 +1,7 @@ package mill.contrib.bloop import mill.eval.Evaluator +import mill.api.WorkspaceRoot /** * Usage : `mill mill.contrib.bloop.Bloop/install` From d3402f49d2377e6e75613c42215fc2ba2d7ea86a Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 16 Aug 2024 10:21:53 +0800 Subject: [PATCH 04/10] . --- main/client/src/mill/main/client/MillLauncher.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main/client/src/mill/main/client/MillLauncher.java b/main/client/src/mill/main/client/MillLauncher.java index be0e80189d8..9887a9aacd8 100644 --- a/main/client/src/mill/main/client/MillLauncher.java +++ b/main/client/src/mill/main/client/MillLauncher.java @@ -85,7 +85,7 @@ static String javaExe() { return "java"; } - static String[] millClasspath() { + static String[] millClasspath() throws Exception { String selfJars = ""; List vmOptions = new LinkedList<>(); String millOptionsPath = System.getProperty("MILL_OPTIONS_PATH"); @@ -118,10 +118,14 @@ static String[] millClasspath() { if (selfJars == null || selfJars.trim().isEmpty()) { throw new RuntimeException("MILL_CLASSPATH is empty!"); } - return selfJars.split("[,]"); + String[] selfJarsArray = selfJars.split("[,]"); + for(int i = 0; i < selfJarsArray.length; i++){ + selfJarsArray[i] = new java.io.File(selfJarsArray[i]).getCanonicalPath(); + } + return selfJarsArray; } - static List millLaunchJvmCommand(boolean setJnaNoSys) { + static List millLaunchJvmCommand(boolean setJnaNoSys) throws Exception { final List vmOptions = new ArrayList<>(); // Java executable From 4e8fb3952597ef42e208adb661df46821a66f5c7 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 16 Aug 2024 10:29:42 +0800 Subject: [PATCH 05/10] . --- integration/invalidation/watch-source-input/repo/build.sc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/invalidation/watch-source-input/repo/build.sc b/integration/invalidation/watch-source-input/repo/build.sc index 70bf339d6c2..2c6d3ebc8fb 100644 --- a/integration/invalidation/watch-source-input/repo/build.sc +++ b/integration/invalidation/watch-source-input/repo/build.sc @@ -34,7 +34,7 @@ def lol = T{ def writeCompletionMarker(name: String) = { Range(0, 10) - .map(i => os.pwd / "out" / s"$name$i") + .map(i => mill.api.WorkspaceRoot.workspaceRoot / "out" / s"$name$i") .find(!os.exists(_)) .foreach(os.write(_, "")) } From 10f137bbe32c9ba28cbe7f664f443c581961f6e8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 16 Aug 2024 10:35:59 +0800 Subject: [PATCH 06/10] . --- contrib/bloop/src/mill/contrib/bloop/Bloop.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/bloop/src/mill/contrib/bloop/Bloop.scala b/contrib/bloop/src/mill/contrib/bloop/Bloop.scala index 2966e0d3672..c45e5b336e0 100644 --- a/contrib/bloop/src/mill/contrib/bloop/Bloop.scala +++ b/contrib/bloop/src/mill/contrib/bloop/Bloop.scala @@ -6,4 +6,7 @@ import mill.api.WorkspaceRoot /** * Usage : `mill mill.contrib.bloop.Bloop/install` */ -object Bloop extends BloopImpl(() => Evaluator.allBootstrapEvaluators.value.value, WorkspaceRoot.workspaceRoot) +object Bloop extends BloopImpl( + () => Evaluator.allBootstrapEvaluators.value.value, + WorkspaceRoot.workspaceRoot + ) From 1c15d0e69b0b88c75097dbb3b7aee2b4c0e1fe21 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 16 Aug 2024 11:54:13 +0800 Subject: [PATCH 07/10] . --- example/thirdparty/acyclic/build.sc | 4 ++++ example/thirdparty/netty/build.sc | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/example/thirdparty/acyclic/build.sc b/example/thirdparty/acyclic/build.sc index f8be2a5a021..430b8cee572 100644 --- a/example/thirdparty/acyclic/build.sc +++ b/example/thirdparty/acyclic/build.sc @@ -31,6 +31,10 @@ trait AcyclicModule extends CrossScalaModule with PublishModule { def compileIvyDeps = Agg(Deps.scalaCompiler(crossScalaVersion)) object test extends ScalaTests with TestModule.Utest { + def resources = T{ + os.copy.over(T.workspace / "acyclic", os.pwd / "acyclic", createFolders = true) + super.resources() ++ Seq(PathRef(os.pwd)) + } def sources = T.sources(millSourcePath / "src", millSourcePath / "resources") def ivyDeps = Agg(Deps.utest, Deps.scalaCompiler(crossScalaVersion)) } diff --git a/example/thirdparty/netty/build.sc b/example/thirdparty/netty/build.sc index cd001231ebf..4a7a3181c92 100644 --- a/example/thirdparty/netty/build.sc +++ b/example/thirdparty/netty/build.sc @@ -252,8 +252,8 @@ object common extends NettyModule{ val shell = new groovy.lang.GroovyShell() val context = new java.util.HashMap[String, Object] - context.put("collection.template.dir", "common/src/main/templates") - context.put("collection.template.test.dir", "common/src/test/templates") + context.put("collection.template.dir", T.workspace + "/common/src/main/templates") + context.put("collection.template.test.dir", T.workspace + "/common/src/test/templates") context.put("collection.src.dir", (T.dest / "src").toString) context.put("collection.testsrc.dir", (T.dest / "testsrc").toString) shell.setProperty("properties", context) From 17933e7911c32405897cf7989764c5c6c1085ac9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 16 Aug 2024 12:05:23 +0800 Subject: [PATCH 08/10] . --- example/thirdparty/acyclic/build.sc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/example/thirdparty/acyclic/build.sc b/example/thirdparty/acyclic/build.sc index 430b8cee572..132874677c5 100644 --- a/example/thirdparty/acyclic/build.sc +++ b/example/thirdparty/acyclic/build.sc @@ -32,6 +32,9 @@ trait AcyclicModule extends CrossScalaModule with PublishModule { object test extends ScalaTests with TestModule.Utest { def resources = T{ + // acyclic test suite assumes files are on disk at specific paths relative to `os.pwd`. + // To avoid changing the test code, we instead copy the necessary files into the `os.pwd` + // when preparing the resources for test suite execution os.copy.over(T.workspace / "acyclic", os.pwd / "acyclic", createFolders = true) super.resources() ++ Seq(PathRef(os.pwd)) } From a9824b7d32ba31a59f589a127a202d5630d7f19f Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 16 Aug 2024 19:53:21 +0800 Subject: [PATCH 09/10] . --- example/thirdparty/acyclic/build.sc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/example/thirdparty/acyclic/build.sc b/example/thirdparty/acyclic/build.sc index 132874677c5..e855e905b2c 100644 --- a/example/thirdparty/acyclic/build.sc +++ b/example/thirdparty/acyclic/build.sc @@ -1,5 +1,14 @@ import mill._, scalalib._, publish._ +// acyclic test suite assumes files are on disk at specific paths relative to `os.pwd`. +// To avoid changing the test code, we instead copy the necessary files into the `os.pwd` +// when preparing the resources for test suite execution +os.copy.over( + interp.watch(mill.api.WorkspaceRoot.workspaceRoot / "acyclic"), + os.pwd / "acyclic", + createFolders = true +) + object Deps { def acyclic = ivy"com.lihaoyi:::acyclic:0.3.6" def scalaCompiler(scalaVersion: String) = ivy"org.scala-lang:scala-compiler:$scalaVersion" @@ -31,13 +40,6 @@ trait AcyclicModule extends CrossScalaModule with PublishModule { def compileIvyDeps = Agg(Deps.scalaCompiler(crossScalaVersion)) object test extends ScalaTests with TestModule.Utest { - def resources = T{ - // acyclic test suite assumes files are on disk at specific paths relative to `os.pwd`. - // To avoid changing the test code, we instead copy the necessary files into the `os.pwd` - // when preparing the resources for test suite execution - os.copy.over(T.workspace / "acyclic", os.pwd / "acyclic", createFolders = true) - super.resources() ++ Seq(PathRef(os.pwd)) - } def sources = T.sources(millSourcePath / "src", millSourcePath / "resources") def ivyDeps = Agg(Deps.utest, Deps.scalaCompiler(crossScalaVersion)) } From 45414cbe2dedaedfb5da0dc09c0ea3aa6ec8c90b Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 16 Aug 2024 21:16:16 +0800 Subject: [PATCH 10/10] . --- integration/src/mill/integration/IntegrationTestSuite.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/src/mill/integration/IntegrationTestSuite.scala b/integration/src/mill/integration/IntegrationTestSuite.scala index 67b08610ebc..b90621eb0b1 100644 --- a/integration/src/mill/integration/IntegrationTestSuite.scala +++ b/integration/src/mill/integration/IntegrationTestSuite.scala @@ -140,7 +140,7 @@ abstract class IntegrationTestSuite extends TestSuite { override def utestAfterEach(path: Seq[String]): Unit = { runnerState = RunnerState.empty - if (integrationTestMode == "server") { + if (integrationTestMode == "server" || integrationTestMode == "local") { // try to stop the server try { os.proc(millReleaseFileOpt.get, "shutdown").call(