diff --git a/build.sbt b/build.sbt index e11f565..f06a638 100644 --- a/build.sbt +++ b/build.sbt @@ -1,33 +1,34 @@ -scalaVersion in ThisBuild := "2.13.10" +ThisBuild/scalaVersion := "3.2.1" -crossScalaVersions in ThisBuild := Seq(scalaVersion.value, "2.12.17") +ThisBuild/crossScalaVersions := Seq(scalaVersion.value, "2.13.10") val commonSettings = Seq( organization := "com.gu", homepage := Some(url("https://github.com/guardian/marley")), licenses := Seq("Apache V2" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")), libraryDependencies ++= Seq( - "org.scala-lang" % "scala-reflect" % scalaVersion.value, - "com.twitter" %% "scrooge-core" % "19.10.0", - "org.apache.thrift" % "libthrift" % "0.12.0" - ) + ("com.twitter" %% "scrooge-core" % "22.12.0").cross(CrossVersion.for3Use2_13), + "org.apache.thrift" % "libthrift" % "0.17.0" + ) ++ (CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, _)) => Seq( + "org.scala-lang" % "scala-reflect" % scalaVersion.value, + "org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided", + ) + case _ => Seq.empty + }) ) -def versionDependent[T](scalaV: String, handlesAnnotations: Boolean, value: T):Option[T] = { - val preMacroAnnotationsScalaVersions = Set("2.11", "2.12") - Some(value).filter(_ => handlesAnnotations != preMacroAnnotationsScalaVersions.contains(scalaV)) -} - lazy val core = project.settings( name := "marley", - Compile / scalacOptions += versionDependent(scalaBinaryVersion.value, handlesAnnotations=true, "-Ymacro-annotations"), - libraryDependencies ++= versionDependent(scalaBinaryVersion.value, handlesAnnotations=false, - compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full)).toSeq ++ Seq( + Compile / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, _)) => Some("-Ymacro-annotations") + case _ => None + }), + libraryDependencies ++= Seq( "org.apache.avro" % "avro" % "1.7.7", - "org.parboiled" %% "parboiled" % "2.1.8", - "org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided", - "org.scalatest" %% "scalatest" % "3.0.9" % Test, - "org.scalacheck" %% "scalacheck" % "1.14.2" % Test + "org.parboiled" %% "parboiled" % "2.4.1", + "org.scalatest" %% "scalatest" % "3.2.15" % Test, + "org.scalacheck" %% "scalacheck" % "1.17.0" % Test ), Test/testOptions += Tests.Argument( TestFrameworks.ScalaTest, @@ -37,10 +38,10 @@ lazy val core = project.settings( lazy val thriftExample = project.settings(commonSettings: _*) -publishArtifact in Test := false +Test/publishArtifact := false lazy val root = (project in file(".")).aggregate(core).settings( - aggregate in update := false, + update/aggregate := false, publishArtifact := false, publish := {}, publishLocal := {}