aboutsummaryrefslogtreecommitdiff
path: root/build.sbt
diff options
context:
space:
mode:
authorKevin Laeufer2021-02-03 17:56:02 -0800
committerGitHub2021-02-03 17:56:02 -0800
commit9c59c3d94ae3f922ee538d593304cdf2976685aa (patch)
tree0c24f609a8301777ea9a572831ff6d984a019470 /build.sbt
parent81ff0fe30f7dd63cffd0c4cd93b72ebee9c8bec9 (diff)
IR: turn some IR nodes into data classes (#2071)
* build: add data-class dependency * ir: turn Print, Stop and Verification nodes into data classes This is in preparation to add a name field to them. Co-authored-by: Jack Koenig <jack.koenig3@gmail.com>
Diffstat (limited to 'build.sbt')
-rw-r--r--build.sbt17
1 files changed, 16 insertions, 1 deletions
diff --git a/build.sbt b/build.sbt
index 76908bb7..374bc273 100644
--- a/build.sbt
+++ b/build.sbt
@@ -22,6 +22,11 @@ lazy val commonSettings = Seq(
crossScalaVersions := Seq("2.13.4", "2.12.13", "2.11.12")
)
+lazy val isAtLeastScala213 = Def.setting {
+ import Ordering.Implicits._
+ CrossVersion.partialVersion(scalaVersion.value).exists(_ >= (2, 13))
+}
+
lazy val firrtlSettings = Seq(
name := "firrtl",
version := "1.5-SNAPSHOT",
@@ -42,8 +47,18 @@ lazy val firrtlSettings = Seq(
"com.github.scopt" %% "scopt" % "3.7.1",
"net.jcazevedo" %% "moultingyaml" % "0.4.2",
"org.json4s" %% "json4s-native" % "3.6.9",
- "org.apache.commons" % "commons-text" % "1.8"
+ "org.apache.commons" % "commons-text" % "1.8",
+ "io.github.alexarchambault" %% "data-class" % "0.2.5",
),
+ // macros for the data-class library
+ libraryDependencies ++= {
+ if (isAtLeastScala213.value) Nil
+ else Seq(compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full))
+ },
+ scalacOptions ++= {
+ if (isAtLeastScala213.value) Seq("-Ymacro-annotations")
+ else Nil
+ },
// starting with scala 2.13 the parallel collections are separate from the standard library
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {