Skip to content

Commit

Permalink
add Scala 3 support (#158)
Browse files Browse the repository at this point in the history
* add Scala 3 support

* update akka to latest - 2.6.21

---------

Co-authored-by: msmiech <[email protected]>
Co-authored-by: Mareks Rampāns <[email protected]>
  • Loading branch information
3 people authored Jun 10, 2024
1 parent 69d8e8d commit 4d4e9fb
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 28 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ jobs:
strategy:
matrix:
scala:
- 2.13.7
- 2.12.15
- 2.13.14
- 2.12.19
- 3.3.3

steps:
- uses: actions/checkout@v2
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Publish Release

on:
release:
types: [published]
branches: [master]

jobs:
release:
uses: evolution-gaming/scala-github-actions/.github/workflows/release.yml@v1
secrets: inherit
14 changes: 8 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ lazy val commonSettings = Seq(
organizationName := "Evolution",
organizationHomepage := Some(url("http://evolution.com")),
scalaVersion := crossScalaVersions.value.head,
crossScalaVersions := Seq("2.13.7", "2.12.15"),
crossScalaVersions := Seq("2.13.14", "2.12.19", "3.3.3"),
Compile / doc / scalacOptions += "-no-link-warnings",
publishTo := Some(Resolver.evolutionReleases),
licenses := Seq(("MIT", url("https://opensource.org/licenses/MIT"))),
Expand All @@ -25,10 +25,10 @@ lazy val sequentially = (project
settings (name := "sequentially")
settings commonSettings
settings (libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-stream" % "2.6.19",
"com.typesafe.akka" %% "akka-testkit" % "2.6.19" % Test,
"com.evolutiongaming" %% "executor-tools" % "1.0.3",
"com.evolutiongaming" %% "future-helper" % "1.0.6",
"com.typesafe.akka" %% "akka-stream" % "2.6.21",
"com.typesafe.akka" %% "akka-testkit" % "2.6.21" % Test,
"com.evolutiongaming" %% "executor-tools" % "1.0.4",
"com.evolutiongaming" %% "future-helper" % "1.0.7",
"org.scalatest" %% "scalatest" % "3.2.10" % Test)))

lazy val benchmark = (project
Expand All @@ -44,5 +44,7 @@ lazy val `sequentially-metrics` = (project
settings commonSettings
dependsOn sequentially
settings (libraryDependencies ++= Seq(
"com.evolutiongaming" %% "prometheus-tools" % "1.0.7"
"com.evolutiongaming" %% "prometheus-tools" % "1.0.8"
)))

addCommandAlias("check", "show version")
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.6.2
sbt.version=1.10.0
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
addSbtPlugin("com.evolution" % "sbt-artifactory-plugin" % "0.0.2")

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.12")

addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.1")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.11")

addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")

addSbtPlugin("com.evolution" % "sbt-scalac-opts-plugin" % "0.0.9")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import com.evolutiongaming.concurrent.sequentially.Sequentially.{BufferSize, Sub
import com.evolutiongaming.concurrent.sequentially.SourceQueueHelper._
import com.evolutiongaming.concurrent.{AvailableProcessors, CurrentThreadExecutionContext}

import scala.concurrent.{Future, Promise}
import scala.concurrent.{ExecutionContext, Future, Promise}
import scala.util.control.NonFatal
import scala.util.{Failure, Success}

Expand Down Expand Up @@ -97,7 +97,7 @@ object SequentiallyHandler {

private object Now extends SequentiallyHandler[Any] {

private implicit val ec = CurrentThreadExecutionContext
private implicit val ec: ExecutionContext = CurrentThreadExecutionContext

def handler[KK <: Any, T](key: KK)(task: => Future[() => Future[T]]): Future[T] = {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import com.evolutiongaming.concurrent.CurrentThreadExecutionContext
import com.evolutiongaming.concurrent.FutureHelper._

import scala.concurrent.duration._
import scala.concurrent.{Await, Future, Promise}
import scala.concurrent.{Await, ExecutionContext, Future, Promise}
import scala.util.control.NoStackTrace
import scala.util.{Failure, Success}
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec

class AsyncHandlerMapSpec extends AnyWordSpec with Matchers with ActorSpec {

implicit val ec = CurrentThreadExecutionContext
implicit val ec: ExecutionContext = CurrentThreadExecutionContext

type K = Int
type V = Int
Expand Down Expand Up @@ -158,7 +158,7 @@ class AsyncHandlerMapSpec extends AnyWordSpec with Matchers with ActorSpec {
}
}

private implicit val materializer = Materializer(system)
private implicit val materializer: Materializer = Materializer(system)

private trait Scope {
val key: K = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package com.evolutiongaming.concurrent.sequentially
import com.evolutiongaming.concurrent.CurrentThreadExecutionContext
import com.evolutiongaming.concurrent.FutureHelper._

import scala.concurrent.Promise
import scala.concurrent.{ExecutionContext, Promise}
import scala.util.Success
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec

class AsyncMapSpec extends AnyWordSpec with Matchers {

implicit val ec = CurrentThreadExecutionContext
implicit val ec: ExecutionContext = CurrentThreadExecutionContext

"AsyncMap" should {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class SequentiallyAsyncSpec extends AnyWordSpec with ActorSpec with Matchers {
bufferSize: Int = Int.MaxValue,
overflowStrategy: OverflowStrategy = OverflowStrategy.backpressure) {

implicit val materializer = Materializer(system)
implicit val materializer: Materializer = Materializer(system)

val sequentially = SequentiallyAsync[Int](bufferSize = bufferSize, overflowStrategy = overflowStrategy)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.evolutiongaming.concurrent.CurrentThreadExecutionContext
import com.evolutiongaming.concurrent.FutureHelper._

import scala.concurrent.duration._
import scala.concurrent.{Await, Future, Promise, TimeoutException}
import scala.concurrent.{Await, ExecutionContext, Future, Promise, TimeoutException}
import scala.util.control.NoStackTrace
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
Expand Down Expand Up @@ -106,8 +106,8 @@ class SequentiallyHandlerSpec extends AnyWordSpec with ActorSpec with Matchers {
}
}

implicit val materializer = Materializer(system)
implicit val ec = CurrentThreadExecutionContext
implicit val materializer: Materializer = Materializer(system)
implicit val ec: ExecutionContext = CurrentThreadExecutionContext

private trait Scope {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import akka.stream.Materializer
import org.scalatest.concurrent.ScalaFutures

import scala.concurrent.duration._
import scala.concurrent.{Await, Future, Promise}
import scala.concurrent.{Await, ExecutionContext, Future, Promise}
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec

class SequentiallySpec extends AnyWordSpec with ActorSpec with Matchers with ScalaFutures {
import system.dispatcher
implicit val ec: ExecutionContext = system.dispatcher

implicit val defaultPatience = PatienceConfig(5.seconds, 100.millis)
implicit val defaultPatience: PatienceConfig = PatienceConfig(5.seconds, 100.millis)

val n = 5

Expand Down Expand Up @@ -117,7 +117,7 @@ class SequentiallySpec extends AnyWordSpec with ActorSpec with Matchers with Sca
}

private trait StreamScope extends ActorScope {
implicit val materializer = Materializer(system)
implicit val materializer: Materializer = Materializer(system)
val sequentially: Sequentially[Int] = Sequentially[Int]()
}

Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ThisBuild / version := "1.1.5-SNAPSHOT"
ThisBuild / version := "1.1.5"

0 comments on commit 4d4e9fb

Please sign in to comment.