Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Scala 3 support #1

Merged
merged 1 commit into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.17, 2.13.10]
scala: [2.12.17, 2.13.10, 3.3.0]
java: [temurin@8, temurin@11, temurin@17]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -158,6 +158,16 @@ jobs:
tar xf targets.tar
rm targets.tar

- name: Download target directories (3.3.0)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-3.3.0-${{ matrix.java }}

- name: Inflate target directories (3.3.0)
run: |
tar xf targets.tar
rm targets.tar

- name: Publish project
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
Expand Down
29 changes: 18 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ name := "pekko-streams-circe"

val scala213Version = "2.13.10"
val scala212Version = "2.12.17"
val scala3Version = "3.3.0"

ThisBuild / resolvers += Resolver.ApacheMavenSnapshotsRepo

Expand All @@ -13,8 +14,8 @@ val pekkoHttpVersion = "0.0.0+4411-6fe04045-SNAPSHOT"
val jawnVersion = "1.5.0"
val scalaTestVersion = "3.2.16"

ThisBuild / crossScalaVersions := Seq(scala212Version, scala213Version)
ThisBuild / scalaVersion := (ThisBuild / crossScalaVersions).value.last
ThisBuild / crossScalaVersions := Seq(scala212Version, scala213Version, scala3Version)
ThisBuild / scalaVersion := scala213Version
ThisBuild / organization := "org.mdedetrich"
ThisBuild / mimaFailOnNoPrevious := false // Set this to true when we start caring about binary compatibility
ThisBuild / versionScheme := Some(VersionScheme.EarlySemVer)
Expand All @@ -24,7 +25,7 @@ lazy val streamJson = project
.settings(
name := "pekko-stream-json",
libraryDependencies ++= Seq(
"org.apache.pekko" %% "pekko-stream" % pekkoVersion % Provided,
"org.apache.pekko" %% "pekko-stream" % pekkoVersion,
"org.typelevel" %% "jawn-parser" % jawnVersion
)
)
Expand All @@ -34,8 +35,8 @@ lazy val httpJson = project
.settings(
name := "pekko-http-json",
libraryDependencies ++= Seq(
"org.apache.pekko" %% "pekko-stream" % pekkoVersion % Provided,
"org.apache.pekko" %% "pekko-http" % pekkoHttpVersion % Provided
"org.apache.pekko" %% "pekko-stream" % pekkoVersion,
"org.apache.pekko" %% "pekko-http" % pekkoHttpVersion
)
)
.dependsOn(streamJson)
Expand All @@ -45,7 +46,7 @@ lazy val streamCirce = project
.settings(
name := "pekko-stream-circe",
libraryDependencies ++= Seq(
"org.apache.pekko" %% "pekko-stream" % pekkoVersion % Provided,
"org.apache.pekko" %% "pekko-stream" % pekkoVersion,
"io.circe" %% "circe-jawn" % circeVersion
)
)
Expand All @@ -56,7 +57,7 @@ lazy val httpCirce = project
.settings(
name := "pekko-http-circe",
libraryDependencies ++= Seq(
"org.apache.pekko" %% "pekko-http" % pekkoHttpVersion % Provided
"org.apache.pekko" %% "pekko-http" % pekkoHttpVersion
)
)
.dependsOn(streamCirce, httpJson)
Expand Down Expand Up @@ -94,10 +95,6 @@ ThisBuild / scalacOptions ++= Seq(
"-deprecation", // warning and location for usages of deprecated APIs
"-feature", // warning and location for usages of features that should be imported explicitly
"-unchecked", // additional warnings where generated code depends on assumptions
"-Xlint", // recommended additional warnings
"-Xcheckinit", // runtime error when a val is not initialized due to trait hierarchies (instead of NPE somewhere else)
"-Ywarn-value-discard", // Warn when non-Unit expression results are unused
"-Ywarn-dead-code",
"-language:postfixOps"
)

Expand Down Expand Up @@ -125,26 +122,36 @@ ThisBuild / pomIncludeRepository := (_ => false)

val flagsFor12 = Seq(
"-Xlint:_",
"-Xcheckinit", // runtime error when a val is not initialized due to trait hierarchies (instead of NPE somewhere else)
"-Ywarn-infer-any",
"-Ywarn-adapted-args", // Warn if an argument list is modified to match the receiver
"-Ywarn-inaccessible",
"-Ywarn-infer-any",
"-Ywarn-value-discard", // Warn when non-Unit expression results are unused
"-Ywarn-dead-code",
"-opt-inline-from:<sources>",
"-opt:l:inline"
)

val flagsFor13 = Seq(
"-Xlint:_",
"-Xcheckinit", // runtime error when a val is not initialized due to trait hierarchies (instead of NPE somewhere else)
"-Ywarn-value-discard", // Warn when non-Unit expression results are unused
"-Ywarn-dead-code",
"-opt-inline-from:<sources>",
"-opt:l:inline"
)

val flagsFor3 = Seq.empty

ThisBuild / scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n == 13 =>
flagsFor13
case Some((2, n)) if n == 12 =>
flagsFor12
case Some((3, _)) =>
Seq.empty
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class JsonSupportSpec
| ]
|}""".stripMargin.trim

implicit val system = ActorSystem()
implicit val system: ActorSystem = ActorSystem()
// implicit val mat = system

"enable marshalling of an A for which an Encoder[A] exists" can {
Expand Down