aboutsummaryrefslogtreecommitdiff
path: root/build.sc
diff options
context:
space:
mode:
Diffstat (limited to 'build.sc')
-rw-r--r--build.sc58
1 files changed, 38 insertions, 20 deletions
diff --git a/build.sc b/build.sc
index 97a1cfd0..7259b613 100644
--- a/build.sc
+++ b/build.sc
@@ -12,7 +12,11 @@ import java.io.IOException
object firrtl extends mill.Cross[firrtlCrossModule]("2.12.14", "2.13.6")
-class firrtlCrossModule(val crossScalaVersion: String) extends CrossSbtModule with ScalafmtModule with PublishModule with BuildInfo {
+class firrtlCrossModule(val crossScalaVersion: String)
+ extends CrossSbtModule
+ with ScalafmtModule
+ with PublishModule
+ with BuildInfo {
override def millSourcePath = super.millSourcePath / os.up
// 2.12.12 -> Array("2", "12", "12") -> "12" -> 12
@@ -48,7 +52,7 @@ class firrtlCrossModule(val crossScalaVersion: String) extends CrossSbtModule wi
ivy"io.github.alexarchambault::data-class:0.2.5",
ivy"org.antlr:antlr4-runtime:$antlr4Version",
ivy"com.google.protobuf:protobuf-java:$protocVersion",
- ivy"com.lihaoyi::os-lib:0.7.8",
+ ivy"com.lihaoyi::os-lib:0.7.8"
) ++ {
if (majorVersion == 13)
Agg(ivy"org.scala-lang.modules::scala-parallel-collections:1.0.3")
@@ -57,7 +61,8 @@ class firrtlCrossModule(val crossScalaVersion: String) extends CrossSbtModule wi
}
}
- override def scalacPluginIvyDeps = if (majorVersion == 12) Agg(ivy"org.scalamacros:::paradise:2.1.1") else super.scalacPluginIvyDeps
+ override def scalacPluginIvyDeps =
+ if (majorVersion == 12) Agg(ivy"org.scalamacros:::paradise:2.1.1") else super.scalacPluginIvyDeps
object test extends Tests {
override def ivyDeps = T {
@@ -87,7 +92,7 @@ class firrtlCrossModule(val crossScalaVersion: String) extends CrossSbtModule wi
}
/* antlr4 */
- def antlr4Version = "4.9.2"
+ def antlr4Version = "4.9.3"
def antlrSource = T.source {
millSourcePath / "src" / "main" / "antlr4" / "FIRRTL.g4"
@@ -124,20 +129,31 @@ class firrtlCrossModule(val crossScalaVersion: String) extends CrossSbtModule wi
def generatedAntlr4Source = T.sources {
antlr4Path().path match {
case f if f.last == "antlr4.jar" =>
- os.proc("java",
- "-jar", f.toString,
- "-o", T.ctx.dest.toString,
- "-lib", antlrSource().path.toString,
- "-package", "firrtl.antlr",
- "-no-listener", "-visitor",
+ os.proc(
+ "java",
+ "-jar",
+ f.toString,
+ "-o",
+ T.ctx.dest.toString,
+ "-lib",
+ antlrSource().path.toString,
+ "-package",
+ "firrtl.antlr",
+ "-no-listener",
+ "-visitor",
antlrSource().path.toString
).call()
case _ =>
- os.proc(antlr4Path().path.toString,
- "-o", T.ctx.dest.toString,
- "-lib", antlrSource().path.toString,
- "-package", "firrtl.antlr",
- "-no-listener", "-visitor",
+ os.proc(
+ antlr4Path().path.toString,
+ "-o",
+ T.ctx.dest.toString,
+ "-lib",
+ antlrSource().path.toString,
+ "-package",
+ "firrtl.antlr",
+ "-no-listener",
+ "-visitor",
antlrSource().path.toString
).call()
}
@@ -214,10 +230,11 @@ class firrtlCrossModule(val crossScalaVersion: String) extends CrossSbtModule wi
val unpackPath = os.rel / "unpacked"
- val bin = if (isWindows)
- T.ctx.dest / unpackPath / "bin" / "protoc.exe"
- else
- T.ctx.dest / unpackPath / "bin" / "protoc"
+ val bin =
+ if (isWindows)
+ T.ctx.dest / unpackPath / "bin" / "protoc.exe"
+ else
+ T.ctx.dest / unpackPath / "bin" / "protoc"
if (!os.exists(bin)) {
Util.downloadUnpackZip(
@@ -234,7 +251,8 @@ class firrtlCrossModule(val crossScalaVersion: String) extends CrossSbtModule wi
def generatedProtoSources = T.sources {
os.proc(
protocPath().path.toString,
- "-I", protobufSource().path / os.up,
+ "-I",
+ protobufSource().path / os.up,
s"--java_out=${T.ctx.dest.toString}",
protobufSource().path.toString()
).call()