-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sc
85 lines (68 loc) · 2.33 KB
/
build.sc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import mill._
import mill.scalalib.publish._
import scalalib._
import scalafmt._
import coursier.maven.MavenRepository
import $ivy.`com.goyeau::mill-scalafix:0.2.6`
import com.goyeau.mill.scalafix.ScalafixModule
// learned from https://github.com/OpenXiangShan/fudian/blob/main/build.sc
val defaultVersions = Map(
"chisel3" -> ("edu.berkeley.cs", "3.5.0", false),
"chisel3-plugin" -> ("edu.berkeley.cs", "3.5.0", true),
"chiseltest" -> ("edu.berkeley.cs", "0.5.0", false),
"scalatest" -> ("org.scalatest", "3.2.10", false)
)
val commonScalaVersion = "2.12.13"
def getVersion(dep: String) = {
val (org, ver, cross) = defaultVersions(dep)
val version = sys.env.getOrElse(dep + "Version", ver)
if (cross)
ivy"$org:::$dep:$version"
else
ivy"$org::$dep:$version"
}
object hardfloat extends ScalaModule {
override def scalaVersion = commonScalaVersion
override def millSourcePath = os.pwd / "berkeley-hardfloat"
override def ivyDeps = super.ivyDeps() ++ Agg(
getVersion("chisel3"),
getVersion("scalatest")
)
override def scalacPluginIvyDeps = super.scalacPluginIvyDeps() ++ Agg(
getVersion("chisel3-plugin")
)
}
object meowv64 extends SbtModule with ScalafmtModule with ScalafixModule {
override def scalaVersion = commonScalaVersion
override def millSourcePath = os.pwd
override def ivyDeps = super.ivyDeps() ++ Agg(
getVersion("chisel3"),
getVersion("scalatest")
)
override def scalacPluginIvyDeps = super.scalacPluginIvyDeps() ++ Agg(
getVersion("chisel3-plugin")
)
override def scalacOptions = super.scalacOptions() ++
Seq("-deprecation", "-unchecked", "-Xsource:2.11") ++ // for chisel3
Seq("-Ywarn-unused", "-Ywarn-adapted-args", "-deprecation") // for scalafix
override def scalafixIvyDeps = Agg(
ivy"com.github.liancheng::organize-imports:0.5.0"
)
override def moduleDeps = super.moduleDeps ++ Seq(hardfloat)
object test
extends Tests
with TestModule.ScalaTest
with ScalafmtModule
with ScalafixModule {
override def ivyDeps = super.ivyDeps() ++ Agg(
getVersion("scalatest"),
getVersion("chiseltest")
)
override def scalafixIvyDeps = Agg(
ivy"com.github.liancheng::organize-imports:0.5.0"
)
override def scalacPluginIvyDeps = super.scalacPluginIvyDeps() ++ Agg(
getVersion("chisel3-plugin")
)
}
}