-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.sc
50 lines (39 loc) · 1.29 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
// import Mill dependency
import mill._
import scalalib._
import scalafmt._
import coursier.maven.MavenRepository
val defaultVersions = Map(
"chisel3" -> "3.6.0",
"chisel3-plugin" -> "3.6.0",
"scala" -> "2.13.10",
"chiseltest" -> "0.6.2",
"scalatest" -> "3.2.15"
)
def getVersion(dep: String, org: String = "edu.berkeley.cs", cross: Boolean = false) = {
val version = sys.env.getOrElse(dep + "Version", defaultVersions(dep))
if (cross)
ivy"$org:::$dep:$version"
else
ivy"$org::$dep:$version"
}
object fudian extends SbtModule with ScalaModule with ScalafmtModule {
override def millSourcePath = millOuterCtx.millSourcePath
override def repositoriesTask = T.task {
super.repositoriesTask() ++ Seq(
MavenRepository("https://oss.sonatype.org/content/repositories/snapshots")
)
}
def scalaVersion = defaultVersions("scala")
override def scalacPluginIvyDeps = super.scalacPluginIvyDeps() ++ Agg(getVersion("chisel3-plugin", cross = true))
override def ivyDeps = super.ivyDeps() ++ Agg(
getVersion("chisel3"),
getVersion("chiseltest")
)
object tests extends Tests {
override def ivyDeps = super.ivyDeps() ++ Agg(
getVersion("scalatest","org.scalatest")
)
override def testFramework: T[String] = T("org.scalatest.tools.testFramework")
}
}