Skip to content

Commit 2bd7cbd

Browse files
chore(build): update mill for JDK 21+ support (#481)
1 parent 727a04c commit 2bd7cbd

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,14 @@ jobs:
6767
sudo bash install-verilator.sh
6868
6969
- name: Setup Scala
70-
uses: olafurpg/setup-scala@v10
70+
uses: olafurpg/setup-scala@v11
71+
with:
72+
java-version: openjdk@1.17
7173

7274
- name: Setup Mill
7375
uses: jodersky/setup-mill@v0.2.3
7476
with:
75-
mill-version: 0.11.1
77+
mill-version: 0.12.3
7678

7779
# - name: Check scalafmt
7880
# run: make checkformat

.mill-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.11.1
1+
0.12.3

build.sc

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import os.Path
55
import publish._
66
import $file.common
77
import $file.`rocket-chip`.common
8-
import $file.`rocket-chip`.common
98
import $file.`rocket-chip`.cde.common
10-
import $file.`rocket-chip`.hardfloat.build
9+
import $file.`rocket-chip`.hardfloat.common
1110

1211
val defaultScalaVersion = "2.13.15"
1312

@@ -16,7 +15,9 @@ def defaultVersions = Map(
1615
"chisel-plugin" -> ivy"org.chipsalliance:::chisel-plugin:7.0.0"
1716
)
1817

19-
trait HasChisel extends ScalaModule {
18+
val pwd = os.Path(sys.env("MILL_WORKSPACE_ROOT"))
19+
20+
trait HasChisel extends SbtModule {
2021
def chiselModule: Option[ScalaModule] = None
2122

2223
def chiselPluginJar: T[Option[PathRef]] = None
@@ -37,18 +38,24 @@ trait HasChisel extends ScalaModule {
3738

3839
object rocketchip extends `rocket-chip`.common.RocketChipModule with HasChisel {
3940

40-
val rcPath = os.pwd / "rocket-chip"
41+
val rcPath = pwd / "rocket-chip"
4142
override def millSourcePath = rcPath
4243

4344
def mainargsIvy = ivy"com.lihaoyi::mainargs:0.7.0"
4445

4546
def json4sJacksonIvy = ivy"org.json4s::json4s-jackson:4.0.7"
4647

47-
object macros extends `rocket-chip`.common.MacrosModule with HasChisel {
48+
object macros extends `rocket-chip`.common.MacrosModule with SbtModule {
49+
50+
def scalaVersion: T[String] = T(defaultScalaVersion)
51+
4852
def scalaReflectIvy = ivy"org.scala-lang:scala-reflect:${scalaVersion}"
4953
}
5054

51-
object cde extends `rocket-chip`.cde.common.CDEModule with HasChisel {
55+
object cde extends `rocket-chip`.cde.common.CDEModule with ScalaModule {
56+
57+
def scalaVersion: T[String] = T(defaultScalaVersion)
58+
5259
override def millSourcePath = rcPath / "cde" / "cde"
5360
}
5461

@@ -64,8 +71,8 @@ object rocketchip extends `rocket-chip`.common.RocketChipModule with HasChisel {
6471

6572
}
6673

67-
object utility extends SbtModule with HasChisel {
68-
override def millSourcePath = os.pwd / "utility"
74+
object utility extends HasChisel {
75+
override def millSourcePath = pwd / "utility"
6976

7077
override def moduleDeps = super.moduleDeps ++ Seq(rocketchip)
7178

@@ -74,14 +81,14 @@ object utility extends SbtModule with HasChisel {
7481
)
7582
}
7683

77-
object huancun extends SbtModule with HasChisel {
78-
override def millSourcePath = os.pwd / "HuanCun"
84+
object huancun extends HasChisel {
85+
override def millSourcePath = pwd / "HuanCun"
7986
override def moduleDeps = super.moduleDeps ++ Seq(
8087
rocketchip, utility
8188
)
8289
}
8390

84-
object CoupledL2 extends SbtModule with HasChisel with millbuild.common.CoupledL2Module {
91+
object CoupledL2 extends HasChisel with $file.common.CoupledL2Module {
8592

8693
override def millSourcePath = millOuterCtx.millSourcePath
8794

@@ -91,7 +98,7 @@ object CoupledL2 extends SbtModule with HasChisel with millbuild.common.CoupledL
9198

9299
def huancunModule: ScalaModule = huancun
93100

94-
object test extends SbtModuleTests with TestModule.ScalaTest
101+
object test extends SbtTests with TestModule.ScalaTest
95102

96103
override def scalacOptions = super.scalacOptions() ++ Agg("-deprecation", "-feature")
97104

0 commit comments

Comments
 (0)