From f0e538b69b30bc197ccc1ddae37a98de28d3577f Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Thu, 13 Aug 2020 16:47:31 -0700 Subject: Bump to Scala 2.12.12 (#1847) Also fix mill build to include new BuildInfo Leave Scala 2.13.2 alone, there are problems when bumping--- build.sbt | 4 ++-- build.sc | 24 ++++++++++++++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/build.sbt b/build.sbt index 1a0352b7..f329808a 100644 --- a/build.sbt +++ b/build.sbt @@ -21,8 +21,8 @@ lazy val commonSettings = Seq( organization := "edu.berkeley.cs", name := "firrtl", version := "1.4-SNAPSHOT", - scalaVersion := "2.12.11", - crossScalaVersions := Seq("2.13.2", "2.12.11", "2.11.12"), + scalaVersion := "2.12.12", + crossScalaVersions := Seq("2.13.2", "2.12.12", "2.11.12"), addCompilerPlugin(scalafixSemanticdb), scalacOptions := Seq( "-deprecation", diff --git a/build.sc b/build.sc index 11bb5eff..78b03cea 100644 --- a/build.sc +++ b/build.sc @@ -3,17 +3,19 @@ import mill._ import mill.scalalib._ import mill.scalalib.publish._ import mill.modules.Util +import $ivy.`com.lihaoyi::mill-contrib-buildinfo:$MILL_VERSION` +import mill.contrib.buildinfo.BuildInfo -object firrtl extends mill.Cross[firrtlCrossModule]("2.11.12", "2.12.11") +object firrtl extends mill.Cross[firrtlCrossModule]("2.11.12", "2.12.12") -class firrtlCrossModule(crossVersion: String) extends ScalaModule with SbtModule with PublishModule { +class firrtlCrossModule(crossVersion: String) extends ScalaModule with SbtModule with PublishModule with BuildInfo { // different scala version shares same sources - // mill use foo/2.11.12 foo/2.12.11 as millSourcePath by default + // mill use foo/2.11.12 foo/2.12.12 as millSourcePath by default override def millSourcePath = super.millSourcePath / os.up / os.up def scalaVersion = crossVersion - // 2.12.11 -> Array("2", "12", "10") -> "12" -> 12 + // 2.12.12 -> Array("2", "12", "12") -> "12" -> 12 private def majorVersion = crossVersion.split('.')(1).toInt def publishVersion = "1.4-SNAPSHOT" @@ -66,14 +68,24 @@ class firrtlCrossModule(crossVersion: String) extends ScalaModule with SbtModule def testFrameworks = Seq("org.scalatest.tools.Framework") // a sbt-like testOnly command. - // for example, mill -i "firrtl[2.12.11].test.testOnly" "firrtlTests.AsyncResetSpec" + // for example, mill -i "firrtl[2.12.12].test.testOnly" "firrtlTests.AsyncResetSpec" def testOnly(args: String*) = T.command { super.runMain("org.scalatest.run", args: _*) } } + override def buildInfoPackageName = Some("firrtl") + + override def buildInfoMembers: T[Map[String, String]] = T { + Map( + "buildInfoPackage" -> artifactName(), + "version" -> publishVersion(), + "scalaVersion" -> scalaVersion() + ) + } + override def generatedSources = T { - generatedAntlr4Source() ++ generatedProtoSources() + generatedAntlr4Source() ++ generatedProtoSources() :+ generatedBuildInfo()._2 } /** antlr4 */ -- cgit v1.2.3