Skip to content

Commit

Permalink
Drop 2.10 support / update to 2.13-M4 (#2306)
Browse files Browse the repository at this point in the history
* drop 2.10 support from the build

* drop Scala 2.10 /update to 2.13-M3
  • Loading branch information
larsrh authored and kailuowang committed Jul 24, 2018
1 parent e32a591 commit 16f9d81
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 60 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ git:
depth: 9999

scala:
- 2.10.7
- 2.11.12
- 2.13.0-M4
- 2.12.6

matrix:
allow_failures:
# There are known issues in this scala milestone release that prevent the tests to compile.
# But we want to enable the build to facilitate debuging, esp on the community build.
- scala: 2.13.0-M3
- scala: 2.13.0-M4

jdk:
- oraclejdk8
Expand Down Expand Up @@ -60,4 +60,4 @@ cache:
- $HOME/.coursier
# Pants cache
- $HOME/.cache

63 changes: 6 additions & 57 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,13 @@ import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
lazy val scoverageSettings = Seq(
coverageMinimum := 60,
coverageFailOnMinimum := false,
//https://github.com/scoverage/sbt-scoverage/issues/72
coverageHighlighting := {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 10)) => false
case _ => true
}
}
coverageHighlighting := true
)

organization in ThisBuild := "org.typelevel"

lazy val kernelSettings = Seq(
// don't warn on value discarding because it's broken on 2.10 with @sp(Unit)
scalacOptions ++= commonScalacOptions.filter(_ != "-Ywarn-value-discard"),
scalacOptions ++= commonScalacOptions,
resolvers ++= Seq(
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots")),
Expand Down Expand Up @@ -53,17 +46,10 @@ lazy val commonSettings = Seq(
case _ => Seq(node)
}
}).transform(node).head
},
},
fork in test := true,
parallelExecution in Test := false,
scalacOptions in (Compile, doc) := (scalacOptions in (Compile, doc)).value.filter(_ != "-Xfatal-warnings"),
unmanagedSourceDirectories in Test ++= {
val bd = baseDirectory.value
if (CrossVersion.partialVersion(scalaVersion.value) exists (_._2 >= 11))
CrossType.Pure.sharedSrcDir(bd, "test").toList map (f => file(f.getPath + "-2.11+"))
else
Nil
}
scalacOptions in (Compile, doc) := (scalacOptions in (Compile, doc)).value.filter(_ != "-Xfatal-warnings")
) ++ warnUnusedImport ++ update2_12 ++ xlint


Expand Down Expand Up @@ -107,7 +93,7 @@ lazy val includeGeneratedSrc: Setting[_] = {
}
}

lazy val catsSettings = commonSettings ++ publishSettings ++ scoverageSettings ++ javadocSettings
lazy val catsSettings = commonSettings ++ publishSettings ++ scoverageSettings

lazy val scalaCheckVersion = "1.13.5"
// 2.13.0-M3 workaround
Expand All @@ -133,26 +119,6 @@ lazy val testingDependencies = Seq(
// libraryDependencies += "org.scalatest" %%% "scalatest" % scalaTestVersion % "test")
libraryDependencies += "org.scalatest" %%% "scalatest" % scalatestVersion(scalaVersion.value) % "test")

/**
* Remove 2.10 projects from doc generation, as the macros used in the projects
* cause problems generating the documentation on scala 2.10. As the APIs for 2.10
* and 2.11 are the same this has no effect on the resultant documentation, though
* it does mean that the scaladocs cannot be generated when the build is in 2.10 mode.
*/
def docsSourcesAndProjects(sv: String): (Boolean, Seq[ProjectReference]) =
CrossVersion.partialVersion(sv) match {
case Some((2, 10)) => (false, Nil)
case _ => (true, Seq(kernelJVM, coreJVM, freeJVM))
}

lazy val javadocSettings = Seq(
sources in (Compile, doc) := {
val docSource = (sources in (Compile, doc)).value
if (docsSourcesAndProjects(scalaVersion.value)._1) docSource else Nil
}
)


lazy val docsMappingsAPIDir = settingKey[String]("Name of subdirectory in site target directory for api docs")

lazy val docSettings = Seq(
Expand Down Expand Up @@ -193,8 +159,7 @@ lazy val docSettings = Seq(
"gray-lighter" -> "#F4F3F4",
"white-color" -> "#FFFFFF"),
autoAPIMappings := true,
unidocProjectFilter in (ScalaUnidoc, unidoc) :=
inProjects(docsSourcesAndProjects(scalaVersion.value)._2:_*),
unidocProjectFilter in (ScalaUnidoc, unidoc) := inProjects(kernelJVM, coreJVM, freeJVM),
docsMappingsAPIDir := "api",
addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), docsMappingsAPIDir),
ghpagesNoJekyll := false,
Expand Down Expand Up @@ -628,22 +593,6 @@ lazy val crossVersionSharedSources: Seq[Setting[_]] =
}
}

lazy val scalaMacroDependencies: Seq[Setting[_]] = Seq(
libraryDependencies += scalaOrganization.value %%% "scala-reflect" % scalaVersion.value % "provided",
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
// if scala 2.11+ is used, quasiquotes are merged into scala-reflect
case Some((2, scalaMajor)) if scalaMajor >= 11 => Seq()
// in Scala 2.10, quasiquotes are provided by macro paradise
case Some((2, 10)) =>
Seq(
compilerPlugin("org.scalamacros" %% "paradise" % "2.1.0" cross CrossVersion.patch),
"org.scalamacros" %% "quasiquotes" % "2.1.0" cross CrossVersion.binary
)
}
}
)

lazy val commonScalacOptions = Seq(
"-deprecation",
"-encoding", "UTF-8",
Expand Down

0 comments on commit 16f9d81

Please sign in to comment.