Skip to content

Instantly share code, notes, and snippets.

@mackenziestarr
Created June 6, 2023 13:32
Show Gist options
  • Save mackenziestarr/768bad44e7a814cb9172fa9ae7dd4cdc to your computer and use it in GitHub Desktop.
Save mackenziestarr/768bad44e7a814cb9172fa9ae7dd4cdc to your computer and use it in GitHub Desktop.
adds githubWorkflowBuildSbtStepPreamble, removes setting crossScalaVersions
diff --git a/build.sbt b/build.sbt
index ed64964..95294a6 100644
--- a/build.sbt
+++ b/build.sbt
@@ -16,8 +16,8 @@ def dev(ghUser: String, name: String, email: String): Developer =
inThisBuild(
List(
+ githubWorkflowBuildSbtStepPreamble := Seq(),
scalaVersion := Scala3,
- crossScalaVersions := List(Scala212, Scala213, Scala3),
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))
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0e821de..d3ca4b9 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -28,13 +28,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
- scala: [2.12.17, 2.13.10, 3.2.2]
+ scala: [3.2.2]
java: [temurin@8, temurin@17]
- exclude:
- - scala: 2.12.17
- java: temurin@17
- - scala: 2.13.10
- java: temurin@17
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
@@ -91,18 +86,18 @@ jobs:
- name: Check headers and formatting
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest'
- run: sbt '++ ${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck
+ run: sbt headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck
- name: Test
- run: sbt '++ ${{ matrix.scala }}' test
+ run: sbt test
- name: Check binary compatibility
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest'
- run: sbt '++ ${{ matrix.scala }}' mimaReportBinaryIssues
+ run: sbt mimaReportBinaryIssues
- name: Generate API documentation
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest'
- run: sbt '++ ${{ matrix.scala }}' doc
+ run: sbt doc
- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
@@ -179,26 +174,6 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
- - name: Download target directories (2.12.17)
- uses: actions/download-artifact@v3
- with:
- name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17
-
- - name: Inflate target directories (2.12.17)
- run: |
- tar xf targets.tar
- rm targets.tar
-
- - name: Download target directories (2.13.10)
- uses: actions/download-artifact@v3
- with:
- name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.10
-
- - name: Inflate target directories (2.13.10)
- run: |
- tar xf targets.tar
- rm targets.tar
-
- name: Download target directories (3.2.2)
uses: actions/download-artifact@v3
with:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment