Skip to content

Commit aa358a5

Browse files
committed
deps: refactor build.sc and bump dependencies
- Removed unused imports (`scalafmt`, `os.Path`, `publish`). - Standardized `rocket-chip` module definitions under `millbuild` namespace. - Updated `defaultVersions` to include `sourcecode` dependency. - Modified `millSourcePath` assignments to use `super.millSourcePath`. - Added `mainargs` and `json4s-jackson` as `ivyDeps` for `rocket-chip`. - Updated `moduleDeps` to reference renamed `rocket-chip` object. - Changed test module to use `SbtTests` instead of `SbtModuleTests`. - Improved consistency in dependency declarations across modules. Signed-off-by: Qiming Chu <[email protected]>
1 parent f134214 commit aa358a5

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

build.sc

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import mill._
22
import scalalib._
3-
import scalafmt._
4-
import os.Path
5-
import publish._
63
import $file.common
74
import $file.`rocket-chip`.common
85
import $file.`rocket-chip`.common
@@ -14,7 +11,8 @@ val defaultScalaVersion = "2.13.15"
1411
def defaultVersions = Map(
1512
"chisel" -> ivy"org.chipsalliance::chisel:6.6.0",
1613
"chisel-plugin" -> ivy"org.chipsalliance:::chisel-plugin:6.6.0",
17-
"chiseltest" -> ivy"edu.berkeley.cs::chiseltest:6.0.0"
14+
"chiseltest" -> ivy"edu.berkeley.cs::chiseltest:6.0.0",
15+
"sourcecode" -> ivy"com.lihaoyi::sourcecode:0.4.2",
1816
)
1917

2018
trait HasChisel extends ScalaModule {
@@ -36,25 +34,22 @@ trait HasChisel extends ScalaModule {
3634
override def scalacPluginIvyDeps = super.scalacPluginIvyDeps() ++ Agg(chiselPluginIvy.get)
3735
}
3836

39-
object rocketchip extends `rocket-chip`.common.RocketChipModule with HasChisel {
40-
41-
val rcPath = os.pwd / "rocket-chip"
42-
override def millSourcePath = rcPath
37+
object `rocket-chip` extends millbuild.`rocket-chip`.common.RocketChipModule with HasChisel {
4338

4439
def mainargsIvy = ivy"com.lihaoyi::mainargs:0.7.0"
4540

4641
def json4sJacksonIvy = ivy"org.json4s::json4s-jackson:4.0.7"
4742

48-
object macros extends `rocket-chip`.common.MacrosModule with HasChisel {
43+
object macros extends millbuild.`rocket-chip`.common.MacrosModule with HasChisel {
4944
def scalaReflectIvy = ivy"org.scala-lang:scala-reflect:${scalaVersion}"
5045
}
5146

52-
object cde extends `rocket-chip`.cde.common.CDEModule with HasChisel {
53-
override def millSourcePath = rcPath / "cde" / "cde"
47+
object cde extends millbuild.`rocket-chip`.cde.common.CDEModule with HasChisel {
48+
override def millSourcePath = super.millSourcePath / "cde"
5449
}
5550

56-
object hardfloat extends `rocket-chip`.hardfloat.common.HardfloatModule with HasChisel {
57-
override def millSourcePath = rcPath / "hardfloat" / "hardfloat"
51+
object hardfloat extends millbuild.`rocket-chip`.hardfloat.common.HardfloatModule with HasChisel {
52+
override def millSourcePath = super.millSourcePath / "hardfloat"
5853
}
5954

6055
def macrosModule = macros
@@ -63,37 +58,41 @@ object rocketchip extends `rocket-chip`.common.RocketChipModule with HasChisel {
6358

6459
def cdeModule = cde
6560

61+
override def ivyDeps = super.ivyDeps() ++ Agg(
62+
mainargsIvy,
63+
json4sJacksonIvy,
64+
)
65+
override def moduleDeps = super.moduleDeps ++ Seq(macrosModule, hardfloatModule, cdeModule)
6666
}
6767

6868
object utility extends SbtModule with HasChisel {
69-
override def millSourcePath = os.pwd / "utility"
69+
override def moduleDeps = super.moduleDeps ++ Seq(`rocket-chip`)
7070

71-
override def moduleDeps = super.moduleDeps ++ Seq(rocketchip)
71+
override def ivyDeps = super.ivyDeps() ++ Agg(
72+
defaultVersions("sourcecode"),
73+
)
7274
}
7375

74-
object huancun extends SbtModule with HasChisel {
75-
override def millSourcePath = os.pwd / "HuanCun"
76-
override def moduleDeps = super.moduleDeps ++ Seq(
77-
rocketchip, utility
78-
)
76+
object HuanCun extends SbtModule with HasChisel {
77+
override def moduleDeps = super.moduleDeps ++ Seq(`rocket-chip`, utility)
7978
}
8079

8180
object CoupledL2 extends SbtModule with HasChisel with millbuild.common.CoupledL2Module {
8281

83-
override def millSourcePath = millOuterCtx.millSourcePath
82+
override def millSourcePath = super.millSourcePath / os.up
8483

85-
def rocketModule: ScalaModule = rocketchip
84+
def rocketModule: ScalaModule = `rocket-chip`
8685

8786
def utilityModule: ScalaModule = utility
8887

89-
def huancunModule: ScalaModule = huancun
88+
def huancunModule: ScalaModule = HuanCun
9089

91-
object test extends SbtModuleTests with TestModule.ScalaTest {
90+
object test extends SbtTests with TestModule.ScalaTest {
9291
override def ivyDeps = super.ivyDeps() ++ Agg(
9392
defaultVersions("chiseltest"),
9493
)
9594
}
96-
9795
override def scalacOptions = super.scalacOptions() ++ Agg("-deprecation", "-feature")
9896

97+
override def moduleDeps = super.moduleDeps ++ Seq(rocketModule, utilityModule, huancunModule)
9998
}

0 commit comments

Comments
 (0)