diff --git a/.github/workflows/template-cleanup.yml b/.github/workflows/template-cleanup.yml index 340495b..28d415e 100644 --- a/.github/workflows/template-cleanup.yml +++ b/.github/workflows/template-cleanup.yml @@ -41,7 +41,7 @@ jobs: # Replace placeholders sed -i "s/%NAME%/$NAME/g" build.sbt README.md src/test/scala/gcd/* - sed -i "s/%NAME%/$WRAPPED_NAME/g" build.sc + sed -i "s/%NAME%/$WRAPPED_NAME/g" build.mill sed -i "s/%REPOSITORY%/${GITHUB_REPOSITORY/\//\\/}/g" README.md sed -i "s/%ORGANIZATION%/$GROUP/g" build.sbt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb323e7..e0d656a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,14 +19,17 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Cleanup - run: sed -i "s/%NAME%/test/g" build.sc + run: sed -i "s/%NAME%/test/g" build.mill - name: Cache Scala uses: coursier/cache-action@v6 - name: Setup Scala uses: coursier/setup-action@v1 with: jvm: adopt:11 - apps: sbt mill + apps: sbt + - name: Setup Mill + run: | + curl -L https://github.com/com-lihaoyi/mill/releases/download/0.12.5/0.12.5 > mill && chmod +x mill - name: Setup Dependencies run: | sudo apt-get install ccache @@ -56,4 +59,4 @@ jobs: - name: SBT Test run: sbt test - name: mill Test - run: mill _.test + run: ./mill _.test diff --git a/.mill-jvm-opts b/.mill-jvm-opts new file mode 100644 index 0000000..f5f4f57 --- /dev/null +++ b/.mill-jvm-opts @@ -0,0 +1 @@ +-Dchisel.project.root=${PWD} diff --git a/.mill-version b/.mill-version index 62d5dbd..6799343 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.11.5 +0.12.5 \ No newline at end of file diff --git a/README.md b/README.md index db79f5a..b63d8b4 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ with a clean running [Chisel3](https://www.chisel-lang.org/) project. ### Dependencies -#### JDK 8 or newer +#### JDK 11 or newer -We recommend LTS releases Java 8 and Java 11. You can install the JDK as your operating system recommends, or use the prebuilt binaries from [AdoptOpenJDK](https://adoptopenjdk.net/). +We recommend using Java 11 or later LTS releases. While Chisel itself works with Java 8, our preferred build tool Mill requires Java 11. You can install the JDK as your operating system recommends, or use the prebuilt binaries from [Adoptium](https://adoptium.net/) (formerly AdoptOpenJDK). #### SBT or mill diff --git a/build.sc b/build.mill similarity index 61% rename from build.sc rename to build.mill index 20bfb1a..6b5b08d 100644 --- a/build.sc +++ b/build.mill @@ -7,8 +7,14 @@ import scalalib._ // support BSP import mill.bsp._ +// Note: This project requires .mill-jvm-opts file containing: +// -Dchisel.project.root=${PWD} +// This is needed because Chisel needs to know the project root directory +// to properly generate and handle test directories and output files. +// See: https://github.com/com-lihaoyi/mill/issues/3840 + object %NAME% extends SbtModule { m => - override def millSourcePath = os.pwd + override def millSourcePath = super.millSourcePath / os.up override def scalaVersion = "2.13.15" override def scalacOptions = Seq( "-language:reflectiveCalls", @@ -22,7 +28,7 @@ object %NAME% extends SbtModule { m => override def scalacPluginIvyDeps = Agg( ivy"org.chipsalliance:::chisel-plugin:6.6.0", ) - object test extends SbtModuleTests with TestModule.ScalaTest { + object test extends SbtTests with TestModule.ScalaTest { override def ivyDeps = m.ivyDeps() ++ Agg( ivy"org.scalatest::scalatest::3.2.16" )