summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiuyang liu2021-01-14 10:47:05 +0000
committerJiuyang liu2021-01-15 05:01:12 +0000
commitb96e7dde38576cb7be400bfa28bf77a10091a81f (patch)
treeb118eb97607b0ebfced714c6c2585ffd5a6d31f9
parentb578aa5e45e4ac5c2a71dda42367863a577ccaa4 (diff)
farewell Scala 2.11
-rw-r--r--.github/workflows/test.yml2
-rw-r--r--build.sbt45
-rw-r--r--build.sc28
3 files changed, 14 insertions, 61 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 52c60702..f9c2b2b0 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- scala: [2.12.12, 2.11.12]
+ scala: [2.12.12]
container:
image: ucbbar/chisel3-tools
options: --user github --entrypoint /bin/bash
diff --git a/build.sbt b/build.sbt
index 05755f7c..267ee57f 100644
--- a/build.sbt
+++ b/build.sbt
@@ -2,32 +2,6 @@
enablePlugins(SiteScaladocPlugin)
-def scalacOptionsVersion(scalaVersion: String): Seq[String] = {
- Seq() ++ {
- // If we're building with Scala > 2.11, enable the compile option
- // switch to support our anonymous Bundle definitions:
- // https://github.com/scala/bug/issues/10047
- CrossVersion.partialVersion(scalaVersion) match {
- case Some((2, scalaMajor: Long)) if scalaMajor < 12 => Seq()
- case _ => Seq("-Xsource:2.11")
- }
- }
-}
-
-def javacOptionsVersion(scalaVersion: String): Seq[String] = {
- Seq() ++ {
- // Scala 2.12 requires Java 8. We continue to generate
- // Java 7 compatible code for Scala 2.11
- // for compatibility with old clients.
- CrossVersion.partialVersion(scalaVersion) match {
- case Some((2, scalaMajor: Long)) if scalaMajor < 12 =>
- Seq("-source", "1.7", "-target", "1.7")
- case _ =>
- Seq("-source", "1.8", "-target", "1.8")
- }
- }
-}
-
val defaultVersions = Map(
"firrtl" -> "edu.berkeley.cs" %% "firrtl" % "1.5-SNAPSHOT",
"treadle" -> "edu.berkeley.cs" %% "treadle" % "1.5-SNAPSHOT"
@@ -42,8 +16,13 @@ lazy val commonSettings = Seq (
version := "3.5-SNAPSHOT",
autoAPIMappings := true,
scalaVersion := "2.12.12",
- crossScalaVersions := Seq("2.12.12", "2.11.12"),
- scalacOptions := Seq("-deprecation", "-feature") ++ scalacOptionsVersion(scalaVersion.value),
+ crossScalaVersions := Seq("2.12.12"),
+ scalacOptions := Seq("-deprecation", "-feature",
+ // We're building with Scala > 2.11, enable the compile option
+ // switch to support our anonymous Bundle definitions:
+ // https://github.com/scala/bug/issues/10047
+ "-Xsource:2.11"
+ ),
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full),
)
@@ -83,16 +62,11 @@ lazy val publishSettings = Seq (
lazy val chiselSettings = Seq (
name := "chisel3",
-// sbt 1.2.6 fails with `Symbol 'term org.junit' is missing from the classpath`
-// when compiling tests under 2.11.12
-// An explicit dependency on junit seems to alleviate this.
libraryDependencies ++= Seq(
- "junit" % "junit" % "4.13.1" % "test",
"org.scalatest" %% "scalatest" % "3.1.2" % "test",
"org.scalatestplus" %% "scalacheck-1-14" % "3.1.1.1" % "test",
"com.github.scopt" %% "scopt" % "3.7.1"
),
- javacOptions ++= javacOptionsVersion(scalaVersion.value)
) ++ (
// Tests from other projects may still run concurrently
// if we're not running with -DminimalResources.
@@ -110,7 +84,6 @@ autoCompilerPlugins := true
// Plugin must be fully cross-versioned (published for Scala minor version)
// The plugin only works in Scala 2.12+
lazy val pluginScalaVersions = Seq(
- "2.11.12", // Only to support chisel3 cross building for 2.11, plugin does nothing in 2.11
// scalamacros paradise version used is not published for 2.12.0 and 2.12.1
"2.12.2",
"2.12.3",
@@ -144,9 +117,7 @@ lazy val plugin = (project in file("plugin")).
).
settings(
mimaPreviousArtifacts := {
- // Not published for 2.11, do not try to check binary compatibility with a 2.11 artifact
- if (scalaVersion.value.startsWith("2.11")) Set()
- else Set()
+ Set()
}
)
diff --git a/build.sc b/build.sc
index 6657f911..475d432d 100644
--- a/build.sc
+++ b/build.sc
@@ -5,7 +5,7 @@ import coursier.maven.MavenRepository
import $ivy.`com.lihaoyi::mill-contrib-buildinfo:$MILL_VERSION`
import mill.contrib.buildinfo.BuildInfo
-object chisel3 extends mill.Cross[chisel3CrossModule]("2.11.12", "2.12.12")
+object chisel3 extends mill.Cross[chisel3CrossModule]("2.12.12")
// The following stanza is searched for and used when preparing releases.
// Please retain it.
@@ -56,25 +56,12 @@ trait CommonModule extends CrossSbtModule with PublishModule {
MavenRepository("https://oss.sonatype.org/content/repositories/releases")
)
- private def scalacCrossOptions = majorVersion match {
- case i if i < 12 => Seq()
- case _ => Seq("-Xsource:2.11")
- }
-
- private def javacCrossOptions = majorVersion match {
- case i if i < 12 => Seq("-source", "1.7", "-target", "1.7")
- case _ => Seq("-source", "1.8", "-target", "1.8")
- }
-
override def scalacOptions = T {
super.scalacOptions() ++ Agg(
"-deprecation",
- "-feature"
- ) ++ scalacCrossOptions
- }
-
- override def javacOptions = T {
- super.javacOptions() ++ javacCrossOptions
+ "-feature",
+ "-Xsource:2.11"
+ )
}
private val macroParadise = ivy"org.scalamacros:::paradise:2.1.1"
@@ -118,16 +105,11 @@ class chisel3CrossModule(val crossScalaVersion: String) extends CommonModule wit
object test extends Tests {
override def scalacPluginClasspath = m.scalacPluginClasspath
- private def ivyCrossDeps = majorVersion match {
- case i if i < 12 => Agg(ivy"junit:junit:4.13.1")
- case _ => Agg()
- }
-
override def ivyDeps = m.ivyDeps() ++ Agg(
ivy"org.scalatest::scalatest:3.1.2",
ivy"org.scalatestplus::scalacheck-1-14:3.1.1.1",
ivy"com.github.scopt::scopt:3.7.1"
- ) ++ ivyCrossDeps ++ m.treadleIvyDeps
+ ) ++ m.treadleIvyDeps
override def moduleDeps = super.moduleDeps ++ treadleModule