Skip to content

Commit 4a971df

Browse files
chore(build, workflow): update mill for JDK 21+ support (#75)
1 parent ea9656a commit 4a971df

3 files changed

Lines changed: 28 additions & 18 deletions

File tree

.github/workflows/main.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ jobs:
4848
sudo bash install-verilator.sh
4949
5050
- name: Setup Scala
51-
uses: olafurpg/setup-scala@v10
51+
uses: olafurpg/setup-scala@v11
52+
with:
53+
java-version: openjdk@1.17
5254

5355
- name: Setup Mill
5456
uses: jodersky/setup-mill@v0.2.3
5557
with:
56-
mill-version: 0.11.1
58+
mill-version: 0.12.3
5759

5860
- name: Compile
5961
run: make compile

.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: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import $file.common
77
import $file.`rocket-chip`.common
88
import $file.`rocket-chip`.common
99
import $file.`rocket-chip`.cde.common
10-
import $file.`rocket-chip`.hardfloat.build
10+
import $file.`rocket-chip`.hardfloat.common
1111

1212
val defaultScalaVersion = "2.13.15"
1313

@@ -16,7 +16,9 @@ def defaultVersions = Map(
1616
"chisel-plugin" -> ivy"org.chipsalliance:::chisel-plugin:7.0.0"
1717
)
1818

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

2224
def chiselPluginJar: T[Option[PathRef]] = None
@@ -37,18 +39,24 @@ trait HasChisel extends ScalaModule {
3739

3840
object rocketchip extends `rocket-chip`.common.RocketChipModule with HasChisel {
3941

40-
val rcPath = os.pwd / "rocket-chip"
42+
val rcPath = pwd / "rocket-chip"
4143
override def millSourcePath = rcPath
4244

4345
def mainargsIvy = ivy"com.lihaoyi::mainargs:0.7.0"
4446

4547
def json4sJacksonIvy = ivy"org.json4s::json4s-jackson:4.0.7"
4648

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

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

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

6573
}
6674

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

7078
override def moduleDeps = super.moduleDeps ++ Seq(rocketchip)
7179

@@ -74,27 +82,27 @@ object utility extends SbtModule with HasChisel {
7482
)
7583
}
7684

77-
object huancun extends SbtModule with HasChisel {
78-
override def millSourcePath = os.pwd / "coupledL2" / "HuanCun"
85+
object huancun extends HasChisel {
86+
override def millSourcePath = pwd / "coupledL2" / "HuanCun"
7987

8088
override def moduleDeps = super.moduleDeps ++ Seq(
8189
rocketchip, utility
8290
)
8391
}
8492

85-
object coupledL2 extends SbtModule with HasChisel {
86-
override def millSourcePath = os.pwd / "coupledL2"
93+
object coupledL2 extends HasChisel {
94+
override def millSourcePath = pwd / "coupledL2"
8795
override def moduleDeps = super.moduleDeps ++ Seq(
8896
rocketchip, utility, huancun
8997
)
9098
}
9199

92-
object openNCB extends SbtModule with HasChisel {
93-
override def millSourcePath = os.pwd / "openNCB"
100+
object openNCB extends HasChisel {
101+
override def millSourcePath = pwd / "openNCB"
94102
override def moduleDeps = super.moduleDeps ++ Seq(rocketchip)
95103
}
96104

97-
object OpenLLC extends SbtModule with HasChisel with millbuild.common.OpenLLCModule {
105+
object OpenLLC extends HasChisel with $file.common.OpenLLCModule {
98106

99107
override def millSourcePath = millOuterCtx.millSourcePath
100108

@@ -106,7 +114,7 @@ object OpenLLC extends SbtModule with HasChisel with millbuild.common.OpenLLCMod
106114

107115
def openNCBModule: ScalaModule = openNCB
108116

109-
object test extends SbtModuleTests with TestModule.ScalaTest
117+
object test extends SbtTests with TestModule.ScalaTest
110118

111119
override def scalacOptions = super.scalacOptions() ++ Agg("-deprecation", "-feature")
112120

0 commit comments

Comments
 (0)