-
Notifications
You must be signed in to change notification settings - Fork 611
/
Copy pathpackage.mill
51 lines (42 loc) · 1.21 KB
/
package.mill
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
package build.firrtl
import mill._
import mill.scalalib._
import mill.scalalib.scalafmt._
import mill.define.Cross
import build._
object `package` extends RootModule {
// /~https://github.com/com-lihaoyi/mill/issues/3693
object cross extends Cross[Firrtl](v.scalaCrossVersions)
}
trait Firrtl extends CrossSbtModule with Cross.Module[String] with HasScala2MacroAnno with ScalafmtModule {
def scalaVersion = crossScalaVersion
def millSourcePath = super.millSourcePath / os.up
override def scalacOptions = Task {
if (v.isScala3(crossScalaVersion)) {
Seq.empty[String]
} else {
v.scala2CommonOptions ++ Seq(
"-language:reflectiveCalls",
"-language:existentials",
"-language:implicitConversions",
"-Yrangepos", // required by SemanticDB compiler plugin
"-Xsource:3",
"-Xsource-features:infer-override"
)
}
}
val commonDeps = Agg(
v.scopt,
v.commonText,
v.osLib,
v.json4s
)
def ivyDeps = if (v.isScala3(crossScalaVersion)) {
commonDeps
} else {
commonDeps ++ Agg(v.dataclass)
}
object test extends SbtTests with TestModule.ScalaTest with ScalafmtModule {
def ivyDeps = Agg(v.scalatest, v.scalacheck)
}
}