Created
June 5, 2023 17:31
-
-
Save mackenziestarr/2dce93557cb27c667289cef19c23eb77 to your computer and use it in GitHub Desktop.
removing crossScalaVersions from project settings and project definitions, add missing compiler flags usually provided by sbt-typelevel during cross builds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/build.sbt b/build.sbt | |
index ed64964..9ea86ef 100644 | |
--- a/build.sbt | |
+++ b/build.sbt | |
@@ -17,7 +17,7 @@ def dev(ghUser: String, name: String, email: String): Developer = | |
inThisBuild( | |
List( | |
scalaVersion := Scala3, | |
- crossScalaVersions := List(Scala212, Scala213, Scala3), | |
+ crossScalaVersions := Nil, | |
tlBaseVersion := "2.5", | |
startYear := Some(2018), | |
licenses := Seq(("MIT", url("https://github.com/typelevel/fs2-grpc/blob/master/LICENSE"))), | |
@@ -64,7 +64,7 @@ lazy val codegen = (projectMatrix in file("codegen")) | |
"2.12" -> "2.5.3", | |
"2.13" -> "2.5.3", | |
"3" -> "2.5.3" | |
- ) | |
+ ), | |
) | |
.jvmPlatform(scalaVersions = Seq(Scala212, Scala213, Scala3)) | |
@@ -76,7 +76,6 @@ lazy val plugin = project | |
.settings( | |
name := "sbt-fs2-grpc", | |
scalaVersion := Scala212, | |
- crossScalaVersions := List(Scala212), | |
tlVersionIntroduced := Map("2.12" -> "2.5.3"), | |
sbtPlugin := true, | |
buildInfoPackage := "fs2.grpc.buildinfo", | |
@@ -99,10 +98,17 @@ lazy val runtime = (projectMatrix in file("runtime")) | |
.defaultAxes(axesDefault: _*) | |
.settings( | |
name := "fs2-grpc-runtime", | |
- crossScalaVersions := List(Scala212, Scala213, Scala3), | |
tlVersionIntroduced := Map("2.12" -> "2.5.3", "2.13" -> "2.5.3", "3" -> "2.5.3"), | |
libraryDependencies ++= List(fs2, catsEffect, grpcApi) ++ List(grpcNetty, ceTestkit, ceMunit).map(_ % Test), | |
- Test / parallelExecution := false | |
+ Test / parallelExecution := false, | |
+ scalacOptions ++= { | |
+ // https://discord.com/channels/632277896739946517/1070110102650097706/1070110232988090368 | |
+ // emulating https://github.com/typelevel/sbt-typelevel/blob/8b7e77e91bd34038605eb71e8d78fb8a558321d6/settings/src/main/scala/org/typelevel/sbt/TypelevelSettingsPlugin.scala#L155 | |
+ CrossVersion.partialVersion(scalaVersion.value) match { | |
+ case Some((3, _)) => Seq("-language:implicitConversions", "-Ykind-projector", "-source:3.0-migration") | |
+ case _ => Seq.empty | |
+ } | |
+ } | |
) | |
.jvmPlatform(scalaVersions = Seq(Scala212, Scala213, Scala3)) | |
@@ -124,7 +130,6 @@ lazy val e2e = (projectMatrix in file("e2e")) | |
.defaultAxes(axesDefault: _*) | |
.enablePlugins(LocalCodeGenPlugin, BuildInfoPlugin, NoPublishPlugin) | |
.settings( | |
- crossScalaVersions := Seq(Scala212, Scala213, Scala3), | |
codeGenClasspath := (codeGenJVM212 / Compile / fullClasspath).value, | |
libraryDependencies := Nil, | |
libraryDependencies ++= List(scalaPbGrpcRuntime, scalaPbRuntime, scalaPbRuntime % "protobuf", ceMunit % Test), | |
@@ -134,6 +139,14 @@ lazy val e2e = (projectMatrix in file("e2e")) | |
), | |
buildInfoPackage := "fs2.grpc.e2e.buildinfo", | |
buildInfoKeys := Seq[BuildInfoKey]("sourceManaged" -> (Compile / sourceManaged).value / "fs2-grpc"), | |
- githubWorkflowArtifactUpload := false | |
+ githubWorkflowArtifactUpload := false, | |
+ scalacOptions ++= { | |
+ // https://discord.com/channels/632277896739946517/1070110102650097706/1070110232988090368 | |
+ // emulating https://github.com/typelevel/sbt-typelevel/blob/8b7e77e91bd34038605eb71e8d78fb8a558321d6/settings/src/main/scala/org/typelevel/sbt/TypelevelSettingsPlugin.scala#L155 | |
+ CrossVersion.partialVersion(scalaVersion.value) match { | |
+ case Some((3, _)) => Seq("-language:implicitConversions", "-Ykind-projector", "-source:3.0-migration") | |
+ case _ => Seq.empty | |
+ } | |
+ } | |
) | |
.jvmPlatform(scalaVersions = Seq(Scala212, Scala213, Scala3)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment