def isScala212x()

in build.sbt [34:67]


def isScala212x(scalaVersion: String) = scalaBinaryVersion(scalaVersion) == "2.12"
def isScala213x(scalaVersion: String) = scalaBinaryVersion(scalaVersion) == "2.13"

noPublishSettings
crossScalaVersions := Nil

val sharedSettings = Seq(
  organization := "com.twitter",
  scalaVersion := "2.12.18",
  crossScalaVersions := Seq("2.11.12", scalaVersion.value),
  Test / parallelExecution := true,
  scalacOptions ++= Seq(
    "-unchecked",
    "-deprecation",
    "-Xlint",
    "-language:implicitConversions",
    "-language:higherKinds",
    "-language:existentials"
  ),
  scalacOptions ++= {
    VersionNumber(scalaVersion.value) match {
      case v if v.matchesSemVer(SemanticSelector("<2.12")) =>
        Seq("-Ywarn-unused", "-Ywarn-unused-import", "-optimize")
      case v if v.matchesSemVer(SemanticSelector(">=2.12")) =>
        val ops = Seq("-Ywarn-unused", "-opt:l:inline", "-opt-inline-from:com.twitter.algebird.**")
        if (v.matchesSemVer(SemanticSelector("2.13.x"))) {
          "-Ymacro-annotations" +: ops
        } else {
          ops
        }
      case _ =>
        Nil
    }
  },