diff --git a/.config/mill-version b/.config/mill-version index 02840ebc763..2f2204c2bcb 100644 --- a/.config/mill-version +++ b/.config/mill-version @@ -1 +1 @@ -0.12.0-RC2-38-029986 \ No newline at end of file +0.12.0-RC2-65-26cbc8 diff --git a/.github/workflows/run-mill-action.yml b/.github/workflows/run-mill-action.yml index 0cfc4435929..cbf949255a6 100644 --- a/.github/workflows/run-mill-action.yml +++ b/.github/workflows/run-mill-action.yml @@ -87,4 +87,4 @@ jobs: path: . name: ${{ inputs.os }}-artifact include-hidden-files: true - if: ${{ inputs.populate_cache }} \ No newline at end of file + if: ${{ inputs.populate_cache }} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 70eeb6f0031..7ca644d904b 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -11,8 +11,6 @@ name: Run Tests on: push: - branches: - - main pull_request: workflow_dispatch: diff --git a/contrib/buildinfo/test/src/mill/contrib/buildinfo/BuildInfoTests.scala b/contrib/buildinfo/test/src/mill/contrib/buildinfo/BuildInfoTests.scala index d82dfb3903c..4af8f1b5189 100644 --- a/contrib/buildinfo/test/src/mill/contrib/buildinfo/BuildInfoTests.scala +++ b/contrib/buildinfo/test/src/mill/contrib/buildinfo/BuildInfoTests.scala @@ -86,7 +86,7 @@ object BuildInfoTests extends TestSuite { ) } - val testModuleSourcesPath: Path = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "buildinfo" + val testModuleSourcesPath: Path = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "buildinfo" def buildInfoSourcePath(eval: UnitTester) = eval.outPath / "buildInfoSources.dest/foo/BuildInfo.scala" diff --git a/contrib/checkstyle/test/src/mill/contrib/checkstyle/CheckstyleModuleTest.scala b/contrib/checkstyle/test/src/mill/contrib/checkstyle/CheckstyleModuleTest.scala index d93c7e17c52..dd6d6978fe7 100644 --- a/contrib/checkstyle/test/src/mill/contrib/checkstyle/CheckstyleModuleTest.scala +++ b/contrib/checkstyle/test/src/mill/contrib/checkstyle/CheckstyleModuleTest.scala @@ -10,7 +10,7 @@ object CheckstyleModuleTest extends TestSuite { def tests: Tests = Tests { - val resources: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) + val resources: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) // violations (for version 10.18.1) in "non-compatible" module val violations: Seq[String] = diff --git a/contrib/checkstyle/test/src/mill/contrib/checkstyle/CheckstyleXsltModuleTest.scala b/contrib/checkstyle/test/src/mill/contrib/checkstyle/CheckstyleXsltModuleTest.scala index f1a7e88d2b7..9be0a628ef9 100644 --- a/contrib/checkstyle/test/src/mill/contrib/checkstyle/CheckstyleXsltModuleTest.scala +++ b/contrib/checkstyle/test/src/mill/contrib/checkstyle/CheckstyleXsltModuleTest.scala @@ -10,7 +10,7 @@ object CheckstyleXsltModuleTest extends TestSuite { def tests: Tests = Tests { - val resources: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) + val resources: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) test("checkstyle generates XSLT output reports") { diff --git a/contrib/docker/test/src/mill/contrib/docker/DockerModuleTest.scala b/contrib/docker/test/src/mill/contrib/docker/DockerModuleTest.scala index 443c0b625f1..b74b545f628 100644 --- a/contrib/docker/test/src/mill/contrib/docker/DockerModuleTest.scala +++ b/contrib/docker/test/src/mill/contrib/docker/DockerModuleTest.scala @@ -45,7 +45,7 @@ object DockerModuleTest extends TestSuite { val testArtifactName = "mill-docker-contrib-test" - val testModuleSourcesPath: Path = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "docker" + val testModuleSourcesPath: Path = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "docker" val multineRegex = "\\R+".r diff --git a/contrib/errorprone/test/src/mill/contrib/errorprone/ErrorProneTests.scala b/contrib/errorprone/test/src/mill/contrib/errorprone/ErrorProneTests.scala index e40b745ea6f..c0b6bcd4bcd 100644 --- a/contrib/errorprone/test/src/mill/contrib/errorprone/ErrorProneTests.scala +++ b/contrib/errorprone/test/src/mill/contrib/errorprone/ErrorProneTests.scala @@ -16,7 +16,7 @@ object ErrorProneTests extends TestSuite { )) } - val testModuleSourcesPath: Path = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "simple" + val testModuleSourcesPath: Path = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "simple" def tests = Tests { test("reference") { diff --git a/contrib/flyway/test/src/mill/contrib/flyway/BuildTest.scala b/contrib/flyway/test/src/mill/contrib/flyway/BuildTest.scala index 1aecaa53ca9..247fe934437 100644 --- a/contrib/flyway/test/src/mill/contrib/flyway/BuildTest.scala +++ b/contrib/flyway/test/src/mill/contrib/flyway/BuildTest.scala @@ -10,7 +10,7 @@ object BuildTest extends TestSuite { object Build extends TestBaseModule { object build extends FlywayModule { - val resourceFolder = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) + val resourceFolder = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) override def resources = Task.Sources(resourceFolder) def h2 = ivy"com.h2database:h2:2.1.214" diff --git a/contrib/jmh/test/src/mill/contrib/jmh/JmhModuleTest.scala b/contrib/jmh/test/src/mill/contrib/jmh/JmhModuleTest.scala index 64520975b98..b5f526d9e8a 100644 --- a/contrib/jmh/test/src/mill/contrib/jmh/JmhModuleTest.scala +++ b/contrib/jmh/test/src/mill/contrib/jmh/JmhModuleTest.scala @@ -16,7 +16,7 @@ object JmhModuleTest extends TestSuite { override def scalaVersion = sys.props.getOrElse("TEST_SCALA_2_13_VERSION", ???) override def jmhCoreVersion = "1.35" } - val testModuleSourcesPath: Path = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "jmh" + val testModuleSourcesPath: Path = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "jmh" def tests = Tests { test("jmh") { diff --git a/contrib/playlib/test/src/mill/playlib/PlayModuleTests.scala b/contrib/playlib/test/src/mill/playlib/PlayModuleTests.scala index 6dfb9c79c30..afd219fcd7c 100644 --- a/contrib/playlib/test/src/mill/playlib/PlayModuleTests.scala +++ b/contrib/playlib/test/src/mill/playlib/PlayModuleTests.scala @@ -16,7 +16,7 @@ object PlayModuleTests extends TestSuite with PlayTestSuite { override def ivyDeps = Task { super.ivyDeps() ++ Agg(ws()) } } } - val resourcePath: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "playmulti" + val resourcePath: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "playmulti" def tests: Tests = Tests { test("layout") { diff --git a/contrib/playlib/test/src/mill/playlib/PlaySingleApiModuleTests.scala b/contrib/playlib/test/src/mill/playlib/PlaySingleApiModuleTests.scala index f6b0f67dd79..dd90a34bcd1 100644 --- a/contrib/playlib/test/src/mill/playlib/PlaySingleApiModuleTests.scala +++ b/contrib/playlib/test/src/mill/playlib/PlaySingleApiModuleTests.scala @@ -13,7 +13,7 @@ object PlaySingleApiModuleTests extends TestSuite with PlayTestSuite { object test extends PlayTests } - val resourcePath: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "playsingleapi" + val resourcePath: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "playsingleapi" def tests: Tests = Tests { test("playVersion") { diff --git a/contrib/playlib/test/src/mill/playlib/PlaySingleModuleTests.scala b/contrib/playlib/test/src/mill/playlib/PlaySingleModuleTests.scala index 17de9b80481..698fc0c98d3 100644 --- a/contrib/playlib/test/src/mill/playlib/PlaySingleModuleTests.scala +++ b/contrib/playlib/test/src/mill/playlib/PlaySingleModuleTests.scala @@ -13,7 +13,7 @@ object PlaySingleModuleTests extends TestSuite with PlayTestSuite { object test extends PlayTests } - val resourcePath: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "playsingle" + val resourcePath: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "playsingle" def tests: Tests = Tests { test("layout") { diff --git a/contrib/playlib/test/src/mill/playlib/RouterModuleTests.scala b/contrib/playlib/test/src/mill/playlib/RouterModuleTests.scala index 9431fd47312..718ddf27670 100644 --- a/contrib/playlib/test/src/mill/playlib/RouterModuleTests.scala +++ b/contrib/playlib/test/src/mill/playlib/RouterModuleTests.scala @@ -22,7 +22,7 @@ object RouterModuleTests extends TestSuite with PlayTestSuite { } - val resourceFolder = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) + val resourceFolder = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) val resourcePath: os.Path = resourceFolder / "hello-world" val invalidResourcePath: os.Path = resourceFolder / "invalid" val invalidSubResourcePath: os.Path = resourceFolder / "invalidsub" diff --git a/contrib/proguard/test/src/mill/contrib/proguard/ProguardTests.scala b/contrib/proguard/test/src/mill/contrib/proguard/ProguardTests.scala index 601a48fff56..d563315bc1d 100644 --- a/contrib/proguard/test/src/mill/contrib/proguard/ProguardTests.scala +++ b/contrib/proguard/test/src/mill/contrib/proguard/ProguardTests.scala @@ -24,7 +24,7 @@ object ProguardTests extends TestSuite { } - val testModuleSourcesPath: Path = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "proguard" + val testModuleSourcesPath: Path = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "proguard" def tests: Tests = Tests { test("Proguard module") { diff --git a/contrib/scalapblib/test/src/mill/contrib/scalapblib/TutorialTests.scala b/contrib/scalapblib/test/src/mill/contrib/scalapblib/TutorialTests.scala index 24c06386b70..32455fdd5fd 100644 --- a/contrib/scalapblib/test/src/mill/contrib/scalapblib/TutorialTests.scala +++ b/contrib/scalapblib/test/src/mill/contrib/scalapblib/TutorialTests.scala @@ -55,7 +55,7 @@ object TutorialTests extends TestSuite { } } - val resourcePath: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) + val resourcePath: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) def protobufOutPath(eval: UnitTester): os.Path = eval.outPath / "core/compileScalaPB.dest/com/example/tutorial" diff --git a/contrib/scoverage/test/src/mill/contrib/scoverage/HelloWorldTests.scala b/contrib/scoverage/test/src/mill/contrib/scoverage/HelloWorldTests.scala index f880e60b5cd..f2bd5744263 100644 --- a/contrib/scoverage/test/src/mill/contrib/scoverage/HelloWorldTests.scala +++ b/contrib/scoverage/test/src/mill/contrib/scoverage/HelloWorldTests.scala @@ -21,7 +21,7 @@ trait HelloWorldTests extends utest.TestSuite { def isScala3: Boolean = testScalaVersion.startsWith("3.") def isScov3: Boolean = testScoverageVersion.startsWith("2.") - val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world" + val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world" val sbtResourcePath = resourcePath / os.up / "hello-world-sbt" val unmanagedFile = resourcePath / "unmanaged.xml" diff --git a/contrib/testng/test/src/mill/testng/TestNGTests.scala b/contrib/testng/test/src/mill/testng/TestNGTests.scala index 3ba48a07da8..a512a10da67 100644 --- a/contrib/testng/test/src/mill/testng/TestNGTests.scala +++ b/contrib/testng/test/src/mill/testng/TestNGTests.scala @@ -37,7 +37,7 @@ object TestNGTests extends TestSuite { } - val resourcePath: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "demo" + val resourcePath: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "demo" def tests: Tests = Tests { test("TestNG") { diff --git a/contrib/twirllib/test/src/mill/twirllib/HelloWorldTests.scala b/contrib/twirllib/test/src/mill/twirllib/HelloWorldTests.scala index ef01ce49f2d..a8094cc725b 100644 --- a/contrib/twirllib/test/src/mill/twirllib/HelloWorldTests.scala +++ b/contrib/twirllib/test/src/mill/twirllib/HelloWorldTests.scala @@ -31,7 +31,7 @@ trait HelloWorldTests extends TestSuite { } - def resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) + def resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) def compileClassfiles: Seq[os.RelPath] = Seq[os.RelPath]( os.rel / "html/hello.template.scala", os.rel / "html/wrapper.template.scala", diff --git a/example/extending/plugins/7-writing-mill-plugins/myplugin/test/src/mill/testkit/ExampleTests.scala b/example/extending/plugins/7-writing-mill-plugins/myplugin/test/src/mill/testkit/ExampleTests.scala index c5e7ed8dec9..e878abdc9e8 100644 --- a/example/extending/plugins/7-writing-mill-plugins/myplugin/test/src/mill/testkit/ExampleTests.scala +++ b/example/extending/plugins/7-writing-mill-plugins/myplugin/test/src/mill/testkit/ExampleTests.scala @@ -6,7 +6,7 @@ object ExampleTests extends TestSuite { def tests: Tests = Tests { test("example") { - val resourceFolder = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) + val resourceFolder = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) ExampleTester.run( clientServerMode = true, workspaceSourcePath = resourceFolder / "example-test-project", diff --git a/example/extending/plugins/7-writing-mill-plugins/myplugin/test/src/mill/testkit/IntegrationTests.scala b/example/extending/plugins/7-writing-mill-plugins/myplugin/test/src/mill/testkit/IntegrationTests.scala index 66c6444ab47..d957f1a1e87 100644 --- a/example/extending/plugins/7-writing-mill-plugins/myplugin/test/src/mill/testkit/IntegrationTests.scala +++ b/example/extending/plugins/7-writing-mill-plugins/myplugin/test/src/mill/testkit/IntegrationTests.scala @@ -10,7 +10,7 @@ object IntegrationTests extends TestSuite { test("integration") { pprint.log(sys.env("MILL_EXECUTABLE_PATH")) - val resourceFolder = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) + val resourceFolder = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) val tester = new IntegrationTester( clientServerMode = true, workspaceSourcePath = resourceFolder / "integration-test-project", diff --git a/example/extending/plugins/7-writing-mill-plugins/myplugin/test/src/mill/testkit/UnitTests.scala b/example/extending/plugins/7-writing-mill-plugins/myplugin/test/src/mill/testkit/UnitTests.scala index 8c122f9802b..44e5ab6045e 100644 --- a/example/extending/plugins/7-writing-mill-plugins/myplugin/test/src/mill/testkit/UnitTests.scala +++ b/example/extending/plugins/7-writing-mill-plugins/myplugin/test/src/mill/testkit/UnitTests.scala @@ -10,7 +10,7 @@ object UnitTests extends TestSuite { def lineCountResourceFileName = "line-count.txt" } - val resourceFolder = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) + val resourceFolder = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) UnitTester(build, resourceFolder / "unit-test-project").scoped { eval => // Evaluating tasks by direct reference diff --git a/example/javalib/module/7-resources/build.mill b/example/javalib/module/7-resources/build.mill index f72a8cd072d..fc3870c5c9c 100644 --- a/example/javalib/module/7-resources/build.mill +++ b/example/javalib/module/7-resources/build.mill @@ -7,7 +7,7 @@ object foo extends JavaModule { def otherFiles = Task.Source(millSourcePath / "other-files") def forkEnv = super.forkEnv() ++ Map( - "OTHER_FILES_FOLDER" -> otherFiles().path.toString + "OTHER_FILES_DIR" -> otherFiles().path.toString ) } } diff --git a/example/javalib/module/7-resources/foo/test/src/FooTests.java b/example/javalib/module/7-resources/foo/test/src/FooTests.java index c1330965dd3..fcf3f5773eb 100644 --- a/example/javalib/module/7-resources/foo/test/src/FooTests.java +++ b/example/javalib/module/7-resources/foo/test/src/FooTests.java @@ -26,14 +26,14 @@ public void simple() throws IOException { } assertEquals("Test Hello World Resource File A", testClasspathResourceText); - // Use `MILL_TEST_RESOURCE_FOLDER` to read `test-file-b.txt` from filesystem - Path testFileResourceDir = Paths.get(System.getenv("MILL_TEST_RESOURCE_FOLDER")); + // Use `MILL_TEST_RESOURCE_DIR` to read `test-file-b.txt` from filesystem + Path testFileResourceDir = Paths.get(System.getenv("MILL_TEST_RESOURCE_DIR")); String testFileResourceText = Files.readString( testFileResourceDir.resolve("test-file-b.txt") ); assertEquals("Test Hello World Resource File B", testFileResourceText); - // Use `MILL_TEST_RESOURCE_FOLDER` to list files available in resource folder + // Use `MILL_TEST_RESOURCE_DIR` to list files available in resource folder List actualFiles = new ArrayList<>(Files.list(testFileResourceDir).toList()); actualFiles.sort(Path::compareTo); List expectedFiles = List.of( @@ -42,10 +42,10 @@ public void simple() throws IOException { ); assertEquals(expectedFiles, actualFiles); - // Use the `OTHER_FILES_FOLDER` configured in your build to access the + // Use the `OTHER_FILES_DIR` configured in your build to access the // files in `foo/test/other-files/`. String otherFileText = Files.readString( - Paths.get(System.getenv("OTHER_FILES_FOLDER"), "other-file.txt") + Paths.get(System.getenv("OTHER_FILES_DIR"), "other-file.txt") ); assertEquals("Other Hello World File", otherFileText); } diff --git a/example/kotlinlib/module/7-resources/build.mill b/example/kotlinlib/module/7-resources/build.mill index 59761027800..2dc39b21a1a 100644 --- a/example/kotlinlib/module/7-resources/build.mill +++ b/example/kotlinlib/module/7-resources/build.mill @@ -10,7 +10,7 @@ object foo extends KotlinModule { def otherFiles = T.source(millSourcePath / "other-files") def forkEnv = super.forkEnv() ++ Map( - "OTHER_FILES_FOLDER" -> otherFiles().path.toString + "OTHER_FILES_DIR" -> otherFiles().path.toString ) def ivyDeps = super.ivyDeps() ++ Agg( diff --git a/example/kotlinlib/module/7-resources/foo/test/src/FooTests.kt b/example/kotlinlib/module/7-resources/foo/test/src/FooTests.kt index e6b5edab372..1b0297a7b65 100644 --- a/example/kotlinlib/module/7-resources/foo/test/src/FooTests.kt +++ b/example/kotlinlib/module/7-resources/foo/test/src/FooTests.kt @@ -24,14 +24,14 @@ class FooTests : FunSpec({ } testClasspathResourceText shouldBe "Test Hello World Resource File A" - // Use `MILL_TEST_RESOURCE_FOLDER` to read `test-file-b.txt` from filesystem - val testFileResourceDir = Paths.get(System.getenv("MILL_TEST_RESOURCE_FOLDER")) + // Use `MILL_TEST_RESOURCE_DIR` to read `test-file-b.txt` from filesystem + val testFileResourceDir = Paths.get(System.getenv("MILL_TEST_RESOURCE_DIR")) val testFileResourceText = Files.readString( testFileResourceDir.resolve("test-file-b.txt") ) testFileResourceText shouldBe "Test Hello World Resource File B" - // Use `MILL_TEST_RESOURCE_FOLDER` to list files available in resource folder + // Use `MILL_TEST_RESOURCE_DIR` to list files available in resource folder val actualFiles = Files.list(testFileResourceDir).toList().sorted() val expectedFiles = listOf( testFileResourceDir.resolve("test-file-a.txt"), @@ -39,10 +39,10 @@ class FooTests : FunSpec({ ) actualFiles shouldBe expectedFiles - // Use the `OTHER_FILES_FOLDER` configured in your build to access the + // Use the `OTHER_FILES_DIR` configured in your build to access the // files in `foo/test/other-files/`. val otherFileText = Files.readString( - Paths.get(System.getenv("OTHER_FILES_FOLDER"), "other-file.txt") + Paths.get(System.getenv("OTHER_FILES_DIR"), "other-file.txt") ) otherFileText shouldBe "Other Hello World File" } diff --git a/example/scalalib/module/7-resources/build.mill b/example/scalalib/module/7-resources/build.mill index b7facb8ca98..147ca6c0d91 100644 --- a/example/scalalib/module/7-resources/build.mill +++ b/example/scalalib/module/7-resources/build.mill @@ -15,7 +15,7 @@ object foo extends ScalaModule { def otherFiles = Task.Source(millSourcePath / "other-files") def forkEnv = super.forkEnv() ++ Map( - "OTHER_FILES_FOLDER" -> otherFiles().path.toString + "OTHER_FILES_DIR" -> otherFiles().path.toString ) } } @@ -33,17 +33,17 @@ object foo extends ScalaModule { // This section discusses how tests can depend on resources locally on disk. // Mill provides two ways to do this: via the JVM classpath resources, and via // the resource folder which is made available as the environment variable -// `MILL_TEST_RESOURCE_FOLDER`; +// `MILL_TEST_RESOURCE_DIR`; // // * The *classpath resources* are useful when you want to fetch individual files, // and are bundled with the application by the `.assembly` step when constructing // an assembly jar for deployment. But they do not allow you to list folders // or perform other filesystem operations. // -// * The *resource folder*, available via `MILL_TEST_RESOURCE_FOLDER`, gives you +// * The *resource folder*, available via `MILL_TEST_RESOURCE_DIR`, gives you // access to the folder path of the resources on disk. This is useful in allowing // you to list and otherwise manipulate the filesystem, which you cannot do with -// *classpath resources*. However, the `MILL_TEST_RESOURCE_FOLDER` only exists +// *classpath resources*. However, the `MILL_TEST_RESOURCE_DIR` only exists // when running tests using Mill, and is not available when executing applications // packaged for deployment via `.assembly` // diff --git a/example/scalalib/module/7-resources/foo/test/src/FooTests.scala b/example/scalalib/module/7-resources/foo/test/src/FooTests.scala index 81fcf07b561..ab39b603263 100644 --- a/example/scalalib/module/7-resources/foo/test/src/FooTests.scala +++ b/example/scalalib/module/7-resources/foo/test/src/FooTests.scala @@ -11,20 +11,20 @@ object FooTests extends TestSuite { val testClasspathResourceText = os.read(os.resource / "test-file-a.txt") assert(testClasspathResourceText == "Test Hello World Resource File A") - // Use `MILL_TEST_RESOURCE_FOLDER` to read `test-file-b.txt` from filesystem - val testFileResourceDir = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) + // Use `MILL_TEST_RESOURCE_DIR` to read `test-file-b.txt` from filesystem + val testFileResourceDir = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) val testFileResourceText = os.read(testFileResourceDir / "test-file-b.txt") assert(testFileResourceText == "Test Hello World Resource File B") - // Use `MILL_TEST_RESOURCE_FOLDER` to list files available in resource folder + // Use `MILL_TEST_RESOURCE_DIR` to list files available in resource folder assert( os.list(testFileResourceDir).sorted == Seq(testFileResourceDir / "test-file-a.txt", testFileResourceDir / "test-file-b.txt") ) - // Use the `OTHER_FILES_FOLDER` configured in your build to access the + // Use the `OTHER_FILES_DIR` configured in your build to access the // files in `foo/test/other-files/`. - val otherFileText = os.read(os.Path(sys.env("OTHER_FILES_FOLDER")) / "other-file.txt") + val otherFileText = os.read(os.Path(sys.env("OTHER_FILES_DIR")) / "other-file.txt") assert(otherFileText == "Other Hello World File") } } diff --git a/example/scalalib/testing/1-test-suite/build.mill b/example/scalalib/testing/1-test-suite/build.mill index f5ac8acc407..aad7c2f0782 100644 --- a/example/scalalib/testing/1-test-suite/build.mill +++ b/example/scalalib/testing/1-test-suite/build.mill @@ -127,7 +127,7 @@ object bar extends ScalaModule { // // *Note that Mill runs tests with the working directory set to an empty `sandbox/` folder by default*. // Tests can access files from their resource directory via the environment variable -// `MILL_TEST_RESOURCE_FOLDER` which provides the path to the resource folder, and additional +// `MILL_TEST_RESOURCE_DIR` which provides the path to the resource folder, and additional // paths can be provided to test via `forkEnv`. See // xref:javalib/module-config.adoc#_classpath_and_filesystem_resources[Classpath and Filesystem Resources] // for more details. diff --git a/kotlinlib/test/src/mill/kotlinlib/HelloWorldTests.scala b/kotlinlib/test/src/mill/kotlinlib/HelloWorldTests.scala index 0ef9fd0c9e2..58592b560ef 100644 --- a/kotlinlib/test/src/mill/kotlinlib/HelloWorldTests.scala +++ b/kotlinlib/test/src/mill/kotlinlib/HelloWorldTests.scala @@ -28,7 +28,7 @@ object HelloWorldTests extends TestSuite { object main extends Cross[MainCross](kotlinVersions) } - val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world-kotlin" + val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world-kotlin" def testEval() = UnitTester(HelloWorldKotlin, resourcePath) def tests: Tests = Tests { diff --git a/kotlinlib/test/src/mill/kotlinlib/MixedHelloWorldTests.scala b/kotlinlib/test/src/mill/kotlinlib/MixedHelloWorldTests.scala index ebf96e7e899..73d68902b3e 100644 --- a/kotlinlib/test/src/mill/kotlinlib/MixedHelloWorldTests.scala +++ b/kotlinlib/test/src/mill/kotlinlib/MixedHelloWorldTests.scala @@ -29,7 +29,7 @@ object MixedHelloWorldTests extends TestSuite { } val resourcePath = - os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "mixed-code-hello-world-kotlin" + os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "mixed-code-hello-world-kotlin" def testEval() = UnitTester(MixedHelloWorldKotlin, resourcePath) def tests: Tests = Tests { diff --git a/kotlinlib/test/src/mill/kotlinlib/contrib/kover/KoverModuleTests.scala b/kotlinlib/test/src/mill/kotlinlib/contrib/kover/KoverModuleTests.scala index 57570956069..77b01f19996 100644 --- a/kotlinlib/test/src/mill/kotlinlib/contrib/kover/KoverModuleTests.scala +++ b/kotlinlib/test/src/mill/kotlinlib/contrib/kover/KoverModuleTests.scala @@ -13,7 +13,7 @@ object KoverModuleTests extends TestSuite { val kotlinVersion = "1.9.24" - val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "contrib" / "kover" + val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "contrib" / "kover" object module extends TestBaseModule { diff --git a/kotlinlib/test/src/mill/kotlinlib/contrib/ktfmt/KtfmtModuleTests.scala b/kotlinlib/test/src/mill/kotlinlib/contrib/ktfmt/KtfmtModuleTests.scala index 178f09c1038..3b9677a4218 100644 --- a/kotlinlib/test/src/mill/kotlinlib/contrib/ktfmt/KtfmtModuleTests.scala +++ b/kotlinlib/test/src/mill/kotlinlib/contrib/ktfmt/KtfmtModuleTests.scala @@ -15,7 +15,7 @@ object KtfmtModuleTests extends TestSuite { def tests: Tests = Tests { val (before, after) = { - val root = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "contrib" / "ktfmt" + val root = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "contrib" / "ktfmt" (root / "before", root / "after") } diff --git a/main/client/src/mill/main/client/EnvVars.java b/main/client/src/mill/main/client/EnvVars.java index c11b77e9c64..b0c57253470 100644 --- a/main/client/src/mill/main/client/EnvVars.java +++ b/main/client/src/mill/main/client/EnvVars.java @@ -11,7 +11,7 @@ public class EnvVars { * in a convenient fashion. If multiple resource folders are provided on the classpath, * they are provided as a comma-separated list */ - public static final String MILL_TEST_RESOURCE_FOLDER = "MILL_TEST_RESOURCE_FOLDER"; + public static final String MILL_TEST_RESOURCE_DIR = "MILL_TEST_RESOURCE_DIR"; /** diff --git a/main/eval/test/src/mill/eval/JavaCompileJarTests.scala b/main/eval/test/src/mill/eval/JavaCompileJarTests.scala index 1e2333790cb..795529bcb41 100644 --- a/main/eval/test/src/mill/eval/JavaCompileJarTests.scala +++ b/main/eval/test/src/mill/eval/JavaCompileJarTests.scala @@ -18,7 +18,7 @@ object JavaCompileJarTests extends TestSuite { mill.api.PathRef(ctx.dest) } - val resourceFolder = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) + val resourceFolder = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) val javacSrcPath = resourceFolder / "examples/javac" val tests = Tests { diff --git a/readme.adoc b/readme.adoc index 0c759295161..26e9f128db6 100644 --- a/readme.adoc +++ b/readme.adoc @@ -483,7 +483,7 @@ prefixed with `show` and no longer need a separate `graphviz`/`dot` install on M *** Trivial upgrades that just needed to bump a version: https://github.com/com-lihaoyi/geny/pull/87 , https://github.com/com-lihaoyi/sourcecode/pull/175, https://github.com/com-lihaoyi/fansi/pull/107, https://github.com/com-lihaoyi/PPrint/pull/141, https://github.com/com-lihaoyi/mainargs/pull/159/files, https://github.com/com-lihaoyi/fastparse/pull/319, https://github.com/com-lihaoyi/scalatags/pull/284 -*** Less trivial upgrades, needing to make use of `MILL_TEST_RESOURCE_FOLDER` or other explicit path references to be compatible with test sandboxing: https://github.com/com-lihaoyi/requests-scala/pull/174, https://github.com/com-lihaoyi/upickle/pull/627, https://github.com/com-lihaoyi/os-lib/pull/300, https://github.com/com-lihaoyi/scalasql/pull/30 +*** Less trivial upgrades, needing to make use of `MILL_TEST_RESOURCE_DIR` or other explicit path references to be compatible with test sandboxing: https://github.com/com-lihaoyi/requests-scala/pull/174, https://github.com/com-lihaoyi/upickle/pull/627, https://github.com/com-lihaoyi/os-lib/pull/300, https://github.com/com-lihaoyi/scalasql/pull/30 [#0-11-12] === 0.11.12 - 2024-08-20 diff --git a/scalajslib/test/src/mill/scalajslib/EsModuleRemapTests.scala b/scalajslib/test/src/mill/scalajslib/EsModuleRemapTests.scala index ea2ef610197..025fe010679 100644 --- a/scalajslib/test/src/mill/scalajslib/EsModuleRemapTests.scala +++ b/scalajslib/test/src/mill/scalajslib/EsModuleRemapTests.scala @@ -41,7 +41,7 @@ object EsModuleRemapTests extends TestSuite { override lazy val millDiscover = Discover[this.type] } - val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "esModuleRemap" + val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "esModuleRemap" val tests: Tests = Tests { test("should remap the esmodule") { diff --git a/scalajslib/test/src/mill/scalajslib/FullOptESModuleTests.scala b/scalajslib/test/src/mill/scalajslib/FullOptESModuleTests.scala index 91fb3593234..9da8030876f 100644 --- a/scalajslib/test/src/mill/scalajslib/FullOptESModuleTests.scala +++ b/scalajslib/test/src/mill/scalajslib/FullOptESModuleTests.scala @@ -19,7 +19,7 @@ object FullOptESModuleTests extends TestSuite { override lazy val millDiscover = Discover[this.type] } - val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-js-world" + val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-js-world" val tests: Tests = Tests { test("fullOpt with ESModule moduleKind") - UnitTester( diff --git a/scalajslib/test/src/mill/scalajslib/HelloJSWorldTests.scala b/scalajslib/test/src/mill/scalajslib/HelloJSWorldTests.scala index e859df105f0..01ed915f9f1 100644 --- a/scalajslib/test/src/mill/scalajslib/HelloJSWorldTests.scala +++ b/scalajslib/test/src/mill/scalajslib/HelloJSWorldTests.scala @@ -77,7 +77,7 @@ object HelloJSWorldTests extends TestSuite { override lazy val millDiscover = Discover[this.type] } - val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-js-world" + val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-js-world" def tests: Tests = Tests { test("compile") - UnitTester(HelloJSWorld, millSourcePath).scoped { eval => diff --git a/scalajslib/test/src/mill/scalajslib/MultiModuleTests.scala b/scalajslib/test/src/mill/scalajslib/MultiModuleTests.scala index 35ae03ee2b0..7df52a447d1 100644 --- a/scalajslib/test/src/mill/scalajslib/MultiModuleTests.scala +++ b/scalajslib/test/src/mill/scalajslib/MultiModuleTests.scala @@ -7,7 +7,7 @@ import mill.scalalib._ import mill.testkit.{UnitTester, TestBaseModule} import utest._ object MultiModuleTests extends TestSuite { - val sourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "multi-module" + val sourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "multi-module" object MultiModule extends TestBaseModule { trait BaseModule extends ScalaJSModule { diff --git a/scalajslib/test/src/mill/scalajslib/NodeJSConfigTests.scala b/scalajslib/test/src/mill/scalajslib/NodeJSConfigTests.scala index a4c1fe5db1a..730866725fa 100644 --- a/scalajslib/test/src/mill/scalajslib/NodeJSConfigTests.scala +++ b/scalajslib/test/src/mill/scalajslib/NodeJSConfigTests.scala @@ -54,7 +54,7 @@ object NodeJSConfigTests extends TestSuite { override lazy val millDiscover = Discover[this.type] } - val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-js-world" + val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-js-world" val helloWorldEvaluator = UnitTester(HelloJSWorld, millSourcePath) diff --git a/scalajslib/test/src/mill/scalajslib/OutputPatternsTests.scala b/scalajslib/test/src/mill/scalajslib/OutputPatternsTests.scala index ae181d1d2dd..34dbb7f9f6e 100644 --- a/scalajslib/test/src/mill/scalajslib/OutputPatternsTests.scala +++ b/scalajslib/test/src/mill/scalajslib/OutputPatternsTests.scala @@ -21,7 +21,7 @@ object OutputPatternsTests extends TestSuite { override lazy val millDiscover = Discover[this.type] } - val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-js-world" + val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-js-world" val evaluator = UnitTester(OutputPatternsModule, millSourcePath) diff --git a/scalajslib/test/src/mill/scalajslib/SmallModulesForTests.scala b/scalajslib/test/src/mill/scalajslib/SmallModulesForTests.scala index eb88e5408ba..25c5c7150b2 100644 --- a/scalajslib/test/src/mill/scalajslib/SmallModulesForTests.scala +++ b/scalajslib/test/src/mill/scalajslib/SmallModulesForTests.scala @@ -18,7 +18,7 @@ object SmallModulesForTests extends TestSuite { override lazy val millDiscover = Discover[this.type] } - val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "small-modules-for" + val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "small-modules-for" val evaluator = UnitTester(SmallModulesForModule, millSourcePath) diff --git a/scalajslib/test/src/mill/scalajslib/SourceMapTests.scala b/scalajslib/test/src/mill/scalajslib/SourceMapTests.scala index f0a128f09f5..a52ba7edaa3 100644 --- a/scalajslib/test/src/mill/scalajslib/SourceMapTests.scala +++ b/scalajslib/test/src/mill/scalajslib/SourceMapTests.scala @@ -18,7 +18,7 @@ object SourceMapTests extends TestSuite { override lazy val millDiscover = Discover[this.type] } - val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-js-world" + val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-js-world" val evaluator = UnitTester(SourceMapModule, millSourcePath) diff --git a/scalajslib/test/src/mill/scalajslib/TopLevelExportsTests.scala b/scalajslib/test/src/mill/scalajslib/TopLevelExportsTests.scala index a1c409748de..6ea7bbaf780 100644 --- a/scalajslib/test/src/mill/scalajslib/TopLevelExportsTests.scala +++ b/scalajslib/test/src/mill/scalajslib/TopLevelExportsTests.scala @@ -16,7 +16,7 @@ object TopLevelExportsTests extends TestSuite { override lazy val millDiscover = Discover[this.type] } - val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "top-level-exports" + val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "top-level-exports" val evaluator = UnitTester(TopLevelExportsModule, millSourcePath) diff --git a/scalalib/src/mill/scalalib/TestModuleUtil.scala b/scalalib/src/mill/scalalib/TestModuleUtil.scala index bddb0a37c55..3db401c3259 100644 --- a/scalalib/src/mill/scalalib/TestModuleUtil.scala +++ b/scalalib/src/mill/scalalib/TestModuleUtil.scala @@ -38,8 +38,7 @@ private[scalalib] object TestModuleUtil { .mkString(",") val resourceEnv = Map( - "MILL_TEST_RESOURCE_DIR" -> resources.map(_.path).mkString(";"), - EnvVars.MILL_TEST_RESOURCE_FOLDER -> resources.map(_.path).mkString(";"), + EnvVars.MILL_TEST_RESOURCE_DIR -> resources.map(_.path).mkString(";"), EnvVars.MILL_WORKSPACE_ROOT -> T.workspace.toString ) diff --git a/scalalib/test/src/mill/javalib/palantirformat/PalantirFormatModuleTest.scala b/scalalib/test/src/mill/javalib/palantirformat/PalantirFormatModuleTest.scala index d76b078eadc..540e3b76282 100644 --- a/scalalib/test/src/mill/javalib/palantirformat/PalantirFormatModuleTest.scala +++ b/scalalib/test/src/mill/javalib/palantirformat/PalantirFormatModuleTest.scala @@ -11,7 +11,7 @@ object PalantirFormatModuleTest extends TestSuite { def tests: Tests = Tests { val (before, after) = { - val root = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "javalib" / "palantirformat" + val root = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "javalib" / "palantirformat" (root / "before", root / "after") } diff --git a/scalalib/test/src/mill/scalalib/AssemblyTests.scala b/scalalib/test/src/mill/scalalib/AssemblyTests.scala index 0cc7537801c..72af5839fda 100644 --- a/scalalib/test/src/mill/scalalib/AssemblyTests.scala +++ b/scalalib/test/src/mill/scalalib/AssemblyTests.scala @@ -54,7 +54,7 @@ object AssemblyTests extends TestSuite { } - val sources = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "assembly" + val sources = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "assembly" def runAssembly(file: os.Path, wd: os.Path, checkExe: Boolean = false): Unit = { println(s"File size: ${os.stat(file).size}") diff --git a/scalalib/test/src/mill/scalalib/CoursierMirrorTests.scala b/scalalib/test/src/mill/scalalib/CoursierMirrorTests.scala index b72c882fbd2..91000d0549e 100644 --- a/scalalib/test/src/mill/scalalib/CoursierMirrorTests.scala +++ b/scalalib/test/src/mill/scalalib/CoursierMirrorTests.scala @@ -8,7 +8,7 @@ import utest.framework.TestPath object CoursierMirrorTests extends TestSuite { - val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "coursier" + val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "coursier" object CoursierTest extends TestBaseModule { object core extends ScalaModule { diff --git a/scalalib/test/src/mill/scalalib/DottyDocTests.scala b/scalalib/test/src/mill/scalalib/DottyDocTests.scala index 8f948fd3840..53c5b9f9b9d 100644 --- a/scalalib/test/src/mill/scalalib/DottyDocTests.scala +++ b/scalalib/test/src/mill/scalalib/DottyDocTests.scala @@ -32,7 +32,7 @@ object DottyDocTests extends TestSuite { } } - val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "dottydoc" + val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "dottydoc" def tests: Tests = Tests { test("static") - UnitTester(StaticDocsModule, resourcePath).scoped { eval => diff --git a/scalalib/test/src/mill/scalalib/HelloJavaTests.scala b/scalalib/test/src/mill/scalalib/HelloJavaTests.scala index 4faf5d28f99..7c8a0461087 100644 --- a/scalalib/test/src/mill/scalalib/HelloJavaTests.scala +++ b/scalalib/test/src/mill/scalalib/HelloJavaTests.scala @@ -25,7 +25,7 @@ object HelloJavaTests extends TestSuite { } } } - val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-java" + val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-java" def testEval() = UnitTester(HelloJava, resourcePath) def tests: Tests = Tests { diff --git a/scalalib/test/src/mill/scalalib/HelloWorldTests.scala b/scalalib/test/src/mill/scalalib/HelloWorldTests.scala index 32f3b352cf9..0f3ced9dc95 100644 --- a/scalalib/test/src/mill/scalalib/HelloWorldTests.scala +++ b/scalalib/test/src/mill/scalalib/HelloWorldTests.scala @@ -80,7 +80,7 @@ object HelloWorldTests extends TestSuite { } } - val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world" + val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world" def jarMainClass(jar: JarFile): Option[String] = { import java.util.jar.Attributes._ diff --git a/scalalib/test/src/mill/scalalib/PublishModuleTests.scala b/scalalib/test/src/mill/scalalib/PublishModuleTests.scala index 3459b5f9577..fb04528779b 100644 --- a/scalalib/test/src/mill/scalalib/PublishModuleTests.scala +++ b/scalalib/test/src/mill/scalalib/PublishModuleTests.scala @@ -77,7 +77,7 @@ object PublishModuleTests extends TestSuite { } } - val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "publish" + val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "publish" def tests: Tests = Tests { test("pom") { diff --git a/scalalib/test/src/mill/scalalib/ScalaAssemblyTests.scala b/scalalib/test/src/mill/scalalib/ScalaAssemblyTests.scala index 4ec530e064c..75a38958b20 100644 --- a/scalalib/test/src/mill/scalalib/ScalaAssemblyTests.scala +++ b/scalalib/test/src/mill/scalalib/ScalaAssemblyTests.scala @@ -148,7 +148,7 @@ object ScalaAssemblyTests extends TestSuite { } val helloWorldMultiResourcePath = - os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world-multi" + os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world-multi" def checkAppendMulti[M <: mill.testkit.TestBaseModule]( module: M, @@ -268,7 +268,7 @@ object ScalaAssemblyTests extends TestSuite { test("run") - UnitTester( HelloWorldAkkaHttpRelocate, - sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world-deps" + sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world-deps" ).scoped { eval => val Right(result) = eval.apply(HelloWorldAkkaHttpRelocate.core.runMain("Main")) assert(result.evalCount > 0) diff --git a/scalalib/test/src/mill/scalalib/ScalaColorOutputTests.scala b/scalalib/test/src/mill/scalalib/ScalaColorOutputTests.scala index 75362f721a9..6b9a815d464 100644 --- a/scalalib/test/src/mill/scalalib/ScalaColorOutputTests.scala +++ b/scalalib/test/src/mill/scalalib/ScalaColorOutputTests.scala @@ -25,7 +25,7 @@ object ScalaColorOutputTests extends TestSuite { UnitTester( HelloWorldColorOutput, - sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world-color-output", + sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world-color-output", errStream = new PrintStream(errStream, true) ).scoped { eval => val Left(Result.Failure("Compilation failed", _)) = diff --git a/scalalib/test/src/mill/scalalib/ScalaDoc3Tests.scala b/scalalib/test/src/mill/scalalib/ScalaDoc3Tests.scala index ee3245e9a05..5f070076c65 100644 --- a/scalalib/test/src/mill/scalalib/ScalaDoc3Tests.scala +++ b/scalalib/test/src/mill/scalalib/ScalaDoc3Tests.scala @@ -32,7 +32,7 @@ object ScalaDoc3Tests extends TestSuite { } } - val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "scaladoc3" + val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "scaladoc3" def tests: Tests = Tests { test("static") - UnitTester(StaticDocsModule, resourcePath).scoped { eval => diff --git a/scalalib/test/src/mill/scalalib/ScalaDotty213Tests.scala b/scalalib/test/src/mill/scalalib/ScalaDotty213Tests.scala index c12fe2ee283..8f6f2acaf95 100644 --- a/scalalib/test/src/mill/scalalib/ScalaDotty213Tests.scala +++ b/scalalib/test/src/mill/scalalib/ScalaDotty213Tests.scala @@ -17,7 +17,7 @@ object ScalaDotty213Tests extends TestSuite { test("dotty213") - UnitTester( Dotty213, - sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "dotty213" + sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "dotty213" ).scoped { eval => val Right(result) = eval.apply(Dotty213.foo.run()) assert(result.evalCount > 0) diff --git a/scalalib/test/src/mill/scalalib/ScalaFlagsTests.scala b/scalalib/test/src/mill/scalalib/ScalaFlagsTests.scala index c06893f8df3..4ba5307c001 100644 --- a/scalalib/test/src/mill/scalalib/ScalaFlagsTests.scala +++ b/scalalib/test/src/mill/scalalib/ScalaFlagsTests.scala @@ -21,7 +21,7 @@ object ScalaFlagsTests extends TestSuite { // make sure flags are passed when compiling/running test("runMain") - UnitTester( HelloWorldFlags, - sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world-flags" + sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world-flags" ).scoped { eval => val Right(result) = eval.apply(HelloWorldFlags.core.runMain("Main")) assert(result.evalCount > 0) @@ -29,7 +29,7 @@ object ScalaFlagsTests extends TestSuite { // make sure flags are passed during ScalaDoc generation test("docJar") - UnitTester( HelloWorldFlags, - sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world-flags" + sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world-flags" ).scoped { eval => val Right(result) = eval.apply(HelloWorldFlags.core.docJar) assert(result.evalCount > 0) diff --git a/scalalib/test/src/mill/scalalib/ScalaMacrosTests.scala b/scalalib/test/src/mill/scalalib/ScalaMacrosTests.scala index 1f61e841710..540bdf77d0b 100644 --- a/scalalib/test/src/mill/scalalib/ScalaMacrosTests.scala +++ b/scalalib/test/src/mill/scalalib/ScalaMacrosTests.scala @@ -36,7 +36,7 @@ object ScalaMacrosTests extends TestSuite { val mod = HelloWorldMacros212 test("runMain") - UnitTester( mod, - sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world-macros" + sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world-macros" ).scoped { eval => if (Properties.isJavaAtLeast(17)) "skipped on Java 17+" else { @@ -47,7 +47,7 @@ object ScalaMacrosTests extends TestSuite { // make sure macros are applied when compiling during scaladoc generation test("docJar") - UnitTester( mod, - sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world-macros" + sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world-macros" ).scoped { eval => if (Properties.isJavaAtLeast(17)) "skipped on Java 17+" else { @@ -61,7 +61,7 @@ object ScalaMacrosTests extends TestSuite { val mod = HelloWorldMacros213 test("runMain") - UnitTester( mod, - sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world-macros" + sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world-macros" ).scoped { eval => val Right(result) = eval.apply(mod.core.runMain("Main")) assert(result.evalCount > 0) @@ -69,7 +69,7 @@ object ScalaMacrosTests extends TestSuite { // make sure macros are applied when compiling during scaladoc generation test("docJar") - UnitTester( mod, - sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world-macros" + sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world-macros" ).scoped { eval => val Right(result) = eval.apply(mod.core.docJar) assert(result.evalCount > 0) diff --git a/scalalib/test/src/mill/scalalib/ScalaRunTests.scala b/scalalib/test/src/mill/scalalib/ScalaRunTests.scala index a7ce992e027..1122268cfcf 100644 --- a/scalalib/test/src/mill/scalalib/ScalaRunTests.scala +++ b/scalalib/test/src/mill/scalalib/ScalaRunTests.scala @@ -104,7 +104,7 @@ object ScalaRunTests extends TestSuite { } test("notRunWithoutMainClass") - UnitTester( HelloWorldWithoutMain, - sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world-no-main" + sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world-no-main" ).scoped { eval => val Left(Result.Failure(_, None)) = eval.apply(HelloWorldWithoutMain.core.run()) } @@ -156,7 +156,7 @@ object ScalaRunTests extends TestSuite { } test("notRunWithoutMainClass") - UnitTester( HelloWorldWithoutMain, - sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world-no-main" + sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world-no-main" ).scoped { eval => val Left(Result.Failure(_, None)) = eval.apply(HelloWorldWithoutMain.core.runLocal()) } diff --git a/scalalib/test/src/mill/scalalib/ScalaScalacheckTests.scala b/scalalib/test/src/mill/scalalib/ScalaScalacheckTests.scala index bf86b1c9387..93fc75003a9 100644 --- a/scalalib/test/src/mill/scalalib/ScalaScalacheckTests.scala +++ b/scalalib/test/src/mill/scalalib/ScalaScalacheckTests.scala @@ -21,7 +21,7 @@ object ScalaScalacheckTests extends TestSuite { test("scalacheck") - UnitTester( HelloScalacheck, - sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-scalacheck" + sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-scalacheck" ).scoped { eval => val Right(result) = eval.apply(HelloScalacheck.foo.test.test()) assert( diff --git a/scalalib/test/src/mill/scalalib/ScalaScaladocTests.scala b/scalalib/test/src/mill/scalalib/ScalaScaladocTests.scala index 1ef99235fb1..f68c67d4e23 100644 --- a/scalalib/test/src/mill/scalalib/ScalaScaladocTests.scala +++ b/scalalib/test/src/mill/scalalib/ScalaScaladocTests.scala @@ -54,7 +54,7 @@ object ScalaScaladocTests extends TestSuite { // make sure options are passed during ScalaDoc generation test("docJarWithTitle") - UnitTester( HelloWorldDocTitle, - sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world" + sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world" ).scoped { eval => val Right(result) = eval.apply(HelloWorldDocTitle.core.docJar) assert( @@ -66,14 +66,14 @@ object ScalaScaladocTests extends TestSuite { } test("docJarWithVersion") - UnitTester( HelloWorldWithDocVersion, - sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world" + sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world" ).scoped { eval => // scaladoc generation fails because of "-Xfatal-warnings" flag val Left(Result.Failure(_, None)) = eval.apply(HelloWorldWithDocVersion.core.docJar) } test("docJarOnlyVersion") - UnitTester( HelloWorldOnlyDocVersion, - sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-world" + sourceRoot = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-world" ).scoped { eval => // `docJar` requires the `compile` task to succeed (since the addition of Scaladoc 3) val Left(Result.Failure(_, None)) = eval.apply(HelloWorldOnlyDocVersion.core.docJar) diff --git a/scalalib/test/src/mill/scalalib/ScalaVersionsRangesTests.scala b/scalalib/test/src/mill/scalalib/ScalaVersionsRangesTests.scala index feef4991855..3da405e9fad 100644 --- a/scalalib/test/src/mill/scalalib/ScalaVersionsRangesTests.scala +++ b/scalalib/test/src/mill/scalalib/ScalaVersionsRangesTests.scala @@ -18,7 +18,7 @@ object ScalaVersionsRangesTests extends TestSuite { } } val resourcePath = - os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "scala-versions-ranges" + os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "scala-versions-ranges" val tests = Tests { test("main with Scala 2.12- and 2.13+ specific code") - UnitTester( diff --git a/scalalib/test/src/mill/scalalib/TestClassLoaderTests.scala b/scalalib/test/src/mill/scalalib/TestClassLoaderTests.scala index 09365585ae8..2889b77ba14 100644 --- a/scalalib/test/src/mill/scalalib/TestClassLoaderTests.scala +++ b/scalalib/test/src/mill/scalalib/TestClassLoaderTests.scala @@ -20,7 +20,7 @@ object TestClassLoaderTests extends TestSuite { } } - val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "classloader-test" + val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "classloader-test" override def tests: Tests = Tests { test("com.sun classes exist in tests classpath (Java 8 only)") - UnitTester( diff --git a/scalalib/test/src/mill/scalalib/TestRunnerTests.scala b/scalalib/test/src/mill/scalalib/TestRunnerTests.scala index 8dd71221cc1..c85fa702b1c 100644 --- a/scalalib/test/src/mill/scalalib/TestRunnerTests.scala +++ b/scalalib/test/src/mill/scalalib/TestRunnerTests.scala @@ -70,7 +70,7 @@ object TestRunnerTests extends TestSuite { } } - val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "testrunner" + val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "testrunner" override def tests: Tests = Tests { test("TestRunner") - { diff --git a/scalalib/test/src/mill/scalalib/scalafmt/ScalafmtTests.scala b/scalalib/test/src/mill/scalalib/scalafmt/ScalafmtTests.scala index 471a02ad921..6fbb02332c9 100644 --- a/scalalib/test/src/mill/scalalib/scalafmt/ScalafmtTests.scala +++ b/scalalib/test/src/mill/scalalib/scalafmt/ScalafmtTests.scala @@ -27,7 +27,7 @@ object ScalafmtTests extends TestSuite { } } - val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "scalafmt" + val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "scalafmt" def tests: Tests = Tests { test("scalafmt") { diff --git a/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala b/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala index 241687aa8da..44c18789178 100644 --- a/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala +++ b/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala @@ -356,8 +356,7 @@ trait TestScalaNativeModule extends ScalaNativeModule with TestModule { nativeLink().toIO, forkEnv() ++ Map( - "MILL_TEST_RESOURCE_DIR" -> resources().map(_.path).mkString(";"), - EnvVars.MILL_TEST_RESOURCE_FOLDER -> resources().map(_.path).mkString(";"), + EnvVars.MILL_TEST_RESOURCE_DIR -> resources().map(_.path).mkString(";"), EnvVars.MILL_WORKSPACE_ROOT -> T.workspace.toString ), toWorkerApi(logLevel()), diff --git a/scalanativelib/test/resources/hello-native-world/build/test/src/utest/tests/MainTests.scala b/scalanativelib/test/resources/hello-native-world/build/test/src/utest/tests/MainTests.scala index 739c1b978a0..7ddd93d8591 100644 --- a/scalanativelib/test/resources/hello-native-world/build/test/src/utest/tests/MainTests.scala +++ b/scalanativelib/test/resources/hello-native-world/build/test/src/utest/tests/MainTests.scala @@ -20,13 +20,13 @@ object MainTests extends TestSuite { } test("resource") { val expected = new java.util.ArrayList[Path]() - expected.add(Paths.get(sys.env("MILL_TEST_RESOURCE_FOLDER") + "/hello-resource.txt")) + expected.add(Paths.get(sys.env("MILL_TEST_RESOURCE_DIR") + "/hello-resource.txt")) val listed = - Files.list(Paths.get(sys.env("MILL_TEST_RESOURCE_FOLDER"))).collect(Collectors.toList()) + Files.list(Paths.get(sys.env("MILL_TEST_RESOURCE_DIR"))).collect(Collectors.toList()) assert(listed == expected) assert( Files.readString( - Paths.get(sys.env("MILL_TEST_RESOURCE_FOLDER") + "/hello-resource.txt") + Paths.get(sys.env("MILL_TEST_RESOURCE_DIR") + "/hello-resource.txt") ) == "hello world resource text" ) diff --git a/scalanativelib/test/src/mill/scalanativelib/FeaturesTests.scala b/scalanativelib/test/src/mill/scalanativelib/FeaturesTests.scala index c151c559662..a796c0c9542 100644 --- a/scalanativelib/test/src/mill/scalanativelib/FeaturesTests.scala +++ b/scalanativelib/test/src/mill/scalanativelib/FeaturesTests.scala @@ -13,7 +13,7 @@ object FeaturesTests extends TestSuite { override lazy val millDiscover: Discover = Discover[this.type] } - val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "features" + val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "features" val tests: Tests = Tests { test("incremental compilation works") - UnitTester(Features, millSourcePath).scoped { eval => diff --git a/scalanativelib/test/src/mill/scalanativelib/HelloNativeWorldTests.scala b/scalanativelib/test/src/mill/scalanativelib/HelloNativeWorldTests.scala index 6ac688780f3..f74567df940 100644 --- a/scalanativelib/test/src/mill/scalanativelib/HelloNativeWorldTests.scala +++ b/scalanativelib/test/src/mill/scalanativelib/HelloNativeWorldTests.scala @@ -79,7 +79,7 @@ object HelloNativeWorldTests extends TestSuite { override lazy val millDiscover: Discover = Discover[this.type] } - val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "hello-native-world" + val millSourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "hello-native-world" def tests: Tests = Tests { test("compile") { diff --git a/testkit/src/mill/testkit/UtestExampleTestSuite.scala b/testkit/src/mill/testkit/UtestExampleTestSuite.scala index 7863d2473e3..0a6ccb1b81a 100644 --- a/testkit/src/mill/testkit/UtestExampleTestSuite.scala +++ b/testkit/src/mill/testkit/UtestExampleTestSuite.scala @@ -5,7 +5,7 @@ import utest._ import scala.concurrent.duration.DurationInt object UtestExampleTestSuite extends TestSuite { - val workspaceSourcePath: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) + val workspaceSourcePath: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) val clientServerMode: Boolean = sys.env("MILL_INTEGRATION_SERVER_MODE").toBoolean val millExecutable: os.Path = os.Path(System.getenv("MILL_INTEGRATION_LAUNCHER"), os.pwd) diff --git a/testkit/src/mill/testkit/UtestIntegrationTestSuite.scala b/testkit/src/mill/testkit/UtestIntegrationTestSuite.scala index d3c5d77a38d..6c1b5efb25b 100644 --- a/testkit/src/mill/testkit/UtestIntegrationTestSuite.scala +++ b/testkit/src/mill/testkit/UtestIntegrationTestSuite.scala @@ -5,7 +5,7 @@ import scala.concurrent.duration.DurationInt import scala.concurrent.{ExecutionContext, Future} abstract class UtestIntegrationTestSuite extends utest.TestSuite with IntegrationTestSuite { - protected def workspaceSourcePath: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) + protected def workspaceSourcePath: os.Path = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) protected def clientServerMode: Boolean = sys.env("MILL_INTEGRATION_SERVER_MODE").toBoolean protected def millExecutable: os.Path = os.Path(System.getenv("MILL_INTEGRATION_LAUNCHER"), os.pwd) diff --git a/testkit/test/src/mill/testkit/ExampleTesterTests.scala b/testkit/test/src/mill/testkit/ExampleTesterTests.scala index 5d7d36072ee..53879a0a5dc 100644 --- a/testkit/test/src/mill/testkit/ExampleTesterTests.scala +++ b/testkit/test/src/mill/testkit/ExampleTesterTests.scala @@ -9,7 +9,7 @@ object ExampleTesterTests extends TestSuite { ExampleTester.run( clientServerMode = true, workspaceSourcePath = - os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "example-test-example-project", + os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "example-test-example-project", millExecutable = os.Path(sys.env("MILL_EXECUTABLE_PATH")) ) } diff --git a/testkit/test/src/mill/testkit/IntegrationTesterTests.scala b/testkit/test/src/mill/testkit/IntegrationTesterTests.scala index 9172a036427..4afbd81cf26 100644 --- a/testkit/test/src/mill/testkit/IntegrationTesterTests.scala +++ b/testkit/test/src/mill/testkit/IntegrationTesterTests.scala @@ -5,7 +5,7 @@ import utest._ object IntegrationTesterTests extends TestSuite with IntegrationTestSuite { def clientServerMode = true def workspaceSourcePath = - os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "integration-test-example-project" + os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "integration-test-example-project" def millExecutable = os.Path(sys.env("MILL_EXECUTABLE_PATH")) def tests: Tests = Tests { diff --git a/testkit/test/src/mill/testkit/UnitTesterTests.scala b/testkit/test/src/mill/testkit/UnitTesterTests.scala index 801c92bbe7b..96aeb9c66c5 100644 --- a/testkit/test/src/mill/testkit/UnitTesterTests.scala +++ b/testkit/test/src/mill/testkit/UnitTesterTests.scala @@ -5,7 +5,7 @@ import utest._ object UnitTesterTests extends TestSuite { - val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_FOLDER")) / "unit-test-example-project" + val resourcePath = os.Path(sys.env("MILL_TEST_RESOURCE_DIR")) / "unit-test-example-project" def tests: Tests = Tests { test("simple") { object build extends TestBaseModule {