-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathbuild.sc
61 lines (54 loc) · 1.84 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
import mill._, scalalib._
import coursier.maven.MavenRepository
/**
* Scala 2.12 module that is source-compatible with 2.11.
* This is due to Chisel's use of structural types. See
* https://github.com/freechipsproject/chisel3/issues/606
*/
trait HasXsource211 extends ScalaModule {
override def scalacOptions = T {
super.scalacOptions() ++ Seq(
"-deprecation",
"-unchecked",
"-Xsource:2.11"
)
}
}
trait HasChisel3 extends ScalaModule {
override def ivyDeps = Agg(
ivy"edu.berkeley.cs::chisel3:3.5.5"
)
}
trait HasChiselTests extends CrossSbtModule {
def repositories() = super.repositories ++ Seq(
MavenRepository("https://oss.sonatype.org/content/repositories/snapshots"),
MavenRepository("https://oss.sonatype.org/content/repositories/releases")
)
object test extends Tests {
override def ivyDeps = Agg(
// ivy"org.scalatest::scalatest:3.0.4",
ivy"edu.berkeley.cs::chiseltest:0.5.+"
)
def testFrameworks = Seq("org.scalatest.tools.Framework")
// sbt-like testOnly command
def testOnly(args: String*) = T.command {
super.runMain("org.scalatest.run", args: _*)
}
}
}
trait HasMacroParadise extends ScalaModule {
// Enable macro paradise for @chiselName et al
val macroPlugins = Agg(ivy"org.scalamacros:::paradise:2.1.0")
def scalacPluginIvyDeps = macroPlugins
def compileIvyDeps = macroPlugins
}
trait HasCompilerPLugin extends ScalaModule {
// Enable macro paradise for @chiselName et al
val compilerPlugins = Agg(ivy"edu.berkeley.cs::chisel3-pluginorg:3.5.+")
def scalacPluginIvyDeps = compilerPlugins
def compileIvyDeps = compilerPlugins
}
object flexpret extends CrossSbtModule with HasCompilerPLugin with HasChisel3 with HasChiselTests with HasXsource211 with HasMacroParadise {
def crossScalaVersion = "2.12.10"
def mainClass = Some("Core.CoreMain")
}