This is an automated email from the ASF dual-hosted git repository.
mdedetrich pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko-grpc.git
The following commit(s) were added to refs/heads/main by this push:
new 401aa811 Properly support SBT 1.8.2 and Scala 3
401aa811 is described below
commit 401aa811f39b61643b9d5e5a77151d81e0bfd22a
Author: Matthew de Detrich <[email protected]>
AuthorDate: Tue May 9 12:50:19 2023 +0200
Properly support SBT 1.8.2 and Scala 3
---
.github/workflows/build-test.yml | 2 +-
benchmark-java/project/build.properties | 2 +-
.../scala/org/apache/pekko/grpc/BenchRunner.scala | 2 +-
.../pekko/grpc/GrpcMarshallingBenchmark.scala | 11 ++--
.../pekko/grpc/HandlerProcessingBenchmark.scala | 8 ++-
.../org/apache/pekko/grpc/gen/CodeGenerator.scala | 2 +-
.../pekko/grpc/gen/javadsl/JavaCodeGenerator.scala | 6 +-
.../grpc/gen/scaladsl/ScalaCodeGenerator.scala | 6 +-
.../scaladsl/ScalaMarshallersCodeGenerator.scala | 2 +-
.../pekko/grpc/gen/scaladsl/Serializer.scala | 5 +-
.../apache/pekko/grpc/gen/scaladsl/Service.scala | 2 +-
.../templates/ScalaCommon/Marshallers.scala.txt | 3 +-
.../twirl/templates/ScalaServer/Handler.scala.txt | 4 +-
.../pekko/grpc/interop/PekkoGrpcClientScala.scala | 2 +-
.../pekko/grpc/interop/PekkoGrpcServerScala.scala | 2 +-
.../grpc/interop/PekkoGrpcScalaClientTester.scala | 6 +-
.../interop/PekkoHttpServerProviderScala.scala | 9 +--
.../pekko/grpc/scaladsl/GrpcChannelSpec.scala | 10 +--
.../grpc/scaladsl/GrpcExceptionHandlerSpec.scala | 19 +++---
.../pekko/grpc/scaladsl/GrpcMarshallingSpec.scala | 4 +-
.../scaladsl/LoadBalancingIntegrationSpec.scala | 8 +--
.../scaladsl/NonBalancingIntegrationSpec.scala | 10 +--
.../apache/pekko/grpc/scaladsl/PowerApiSpec.scala | 14 ++---
.../apache/pekko/grpc/scaladsl/TelemetrySpec.scala | 5 +-
plugin-tester-java/build.gradle | 2 +-
.../myapp/helloworld/ErrorReportingSpec.scala | 4 +-
.../myapp/helloworld/JGreeterServiceSpec.scala | 3 +-
plugin-tester-scala/build.gradle | 2 +-
plugin-tester-scala/pom.xml | 2 +-
.../helloworld/AuthenticatedGreeterClient.scala | 2 +-
.../example/myapp/helloworld/GreeterClient.scala | 6 +-
.../myapp/helloworld/LiftedGreeterClient.scala | 5 +-
.../myapp/helloworld/GreeterServiceSpec.scala | 6 +-
project/Common.scala | 73 +++++++++++++++-------
project/Dependencies.scala | 7 ++-
project/build.properties | 2 +-
.../pekko/grpc/internal/AbstractGrpcProtocol.scala | 2 +-
.../pekko/grpc/internal/GrpcProtocolNative.scala | 2 +-
.../apache/pekko/grpc/internal/MetadataImpl.scala | 2 +-
.../internal/PekkoNettyGrpcClientGraphStage.scala | 2 +-
.../pekko/grpc/internal/RequestBuilderImpl.scala | 2 +-
.../pekko/grpc/javadsl/GrpcMarshalling.scala | 2 +-
.../org/apache/pekko/grpc/scaladsl/Grpc.scala | 8 +--
.../pekko/grpc/scaladsl/GrpcMarshalling.scala | 2 +-
.../client/GrpcClientSettingsCompileOnly.scala | 2 +-
.../apache/pekko/grpc/GrpcClientSettingsSpec.scala | 2 +-
.../pekko/grpc/internal/MetadataImplSpec.scala | 8 +--
.../pekko/grpc/internal/NettyClientUtilsSpec.scala | 2 +-
.../internal/PekkoDiscoveryNameResolverSpec.scala | 5 +-
.../grpc/internal/PekkoHttpClientUtilsSpec.scala | 4 +-
.../grpc/scaladsl/GrpcExceptionHandlerSpec.scala | 8 +--
.../pekko/grpc/scaladsl/MetadataBuilderSpec.scala | 4 +-
.../apache/pekko/grpc/sbt/PekkoGrpcPlugin.scala | 21 ++-----
.../01-gen-basic-java/project/build.properties | 1 +
.../02-server-reflection/project/build.properties | 2 +-
.../03-no-java-package/project/build.properties | 1 +
.../04-crash-on-keywords/project/build.properties | 1 +
.../project/build.properties | 1 +
.../00-interop/project/build.properties | 1 +
.../org/apache/pekko/grpc/GrpcInteropSpec.scala | 3 +-
.../01-gen-basic-server/project/build.properties | 1 +
.../02-multiple-services/project/build.properties | 1 +
.../03-test-config/project/build.properties | 1 +
.../04-server-reflection/project/build.properties | 1 +
.../05-no-java-package/project/build.properties | 1 +
.../project/build.properties | 1 +
.../project/build.properties | 1 +
.../project/build.properties | 1 +
.../10-scalapb-validate/project/build.properties | 1 +
.../project/build.properties | 1 +
.../scala3/01-basic-client-server/build.sbt | 2 +-
.../project/build.properties | 2 +-
72 files changed, 205 insertions(+), 155 deletions(-)
diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml
index 4ecb1ce8..0076561b 100644
--- a/.github/workflows/build-test.yml
+++ b/.github/workflows/build-test.yml
@@ -106,7 +106,7 @@ jobs:
- test-set: gen-java
scala-version: 2.12
- test-set: scala3
- scala-version: 2.13
+ scala-version: 3.3
steps:
- name: Checkout
uses: actions/checkout@v3
diff --git a/benchmark-java/project/build.properties
b/benchmark-java/project/build.properties
index 563a014d..72413de1 100644
--- a/benchmark-java/project/build.properties
+++ b/benchmark-java/project/build.properties
@@ -1 +1 @@
-sbt.version=1.7.2
+sbt.version=1.8.3
diff --git a/benchmarks/src/main/scala/org/apache/pekko/grpc/BenchRunner.scala
b/benchmarks/src/main/scala/org/apache/pekko/grpc/BenchRunner.scala
index f13a963a..abedb4ba 100644
--- a/benchmarks/src/main/scala/org/apache/pekko/grpc/BenchRunner.scala
+++ b/benchmarks/src/main/scala/org/apache/pekko/grpc/BenchRunner.scala
@@ -34,7 +34,7 @@ object BenchRunner {
val opts = new CommandLineOptions(args2: _*)
val results = new Runner(opts).run()
- val report = results.asScala.map { result: RunResult =>
+ val report = results.asScala.map { (result: RunResult) =>
val bench = result.getParams.getBenchmark
val params =
result.getParams.getParamsKeys.asScala.map(key =>
s"$key=${result.getParams.getParam(key)}").mkString("_")
diff --git
a/benchmarks/src/main/scala/org/apache/pekko/grpc/GrpcMarshallingBenchmark.scala
b/benchmarks/src/main/scala/org/apache/pekko/grpc/GrpcMarshallingBenchmark.scala
index 76eb0573..9100cf5b 100644
---
a/benchmarks/src/main/scala/org/apache/pekko/grpc/GrpcMarshallingBenchmark.scala
+++
b/benchmarks/src/main/scala/org/apache/pekko/grpc/GrpcMarshallingBenchmark.scala
@@ -16,7 +16,7 @@ package org.apache.pekko.grpc
import org.apache.pekko
import pekko.actor.ActorSystem
import pekko.grpc.internal.{ GrpcProtocolNative, Identity }
-import pekko.grpc.scaladsl.GrpcMarshalling
+import pekko.grpc.scaladsl.{ GrpcMarshalling, ScalapbProtobufSerializer }
import pekko.http.scaladsl.model.HttpResponse
import pekko.stream.scaladsl.Source
import grpc.reflection.v1alpha.reflection._
@@ -25,10 +25,11 @@ import org.openjdk.jmh.annotations._
// Microbenchmarks for GrpcMarshalling.
// Does not actually benchmarks the actual marshalling because we dont consume
the HttpResponse
class GrpcMarshallingBenchmark extends CommonBenchmark {
- implicit val system = ActorSystem("bench")
- implicit val writer = GrpcProtocolNative.newWriter(Identity)
- implicit val reader = GrpcProtocolNative.newReader(Identity)
- implicit val serializer =
ServerReflection.Serializers.ServerReflectionRequestSerializer
+ implicit val system: ActorSystem = ActorSystem("bench")
+ implicit val writer: GrpcProtocol.GrpcProtocolWriter =
GrpcProtocolNative.newWriter(Identity)
+ implicit val reader: GrpcProtocol.GrpcProtocolReader =
GrpcProtocolNative.newReader(Identity)
+ implicit val serializer: ScalapbProtobufSerializer[ServerReflectionRequest] =
+ ServerReflection.Serializers.ServerReflectionRequestSerializer
@Benchmark
def marshall(): HttpResponse = {
diff --git
a/benchmarks/src/main/scala/org/apache/pekko/grpc/HandlerProcessingBenchmark.scala
b/benchmarks/src/main/scala/org/apache/pekko/grpc/HandlerProcessingBenchmark.scala
index d74ea193..924b6b7b 100644
---
a/benchmarks/src/main/scala/org/apache/pekko/grpc/HandlerProcessingBenchmark.scala
+++
b/benchmarks/src/main/scala/org/apache/pekko/grpc/HandlerProcessingBenchmark.scala
@@ -24,6 +24,7 @@ import pekko.actor.ActorSystem
import pekko.grpc.internal.Identity
import pekko.grpc.internal.GrpcRequestHelpers
import pekko.grpc.internal.GrpcProtocolNative
+import pekko.grpc.scaladsl.ScalapbProtobufSerializer
import pekko.http.scaladsl.model.HttpRequest
import pekko.http.scaladsl.model.HttpResponse
@@ -38,12 +39,13 @@ import org.openjdk.jmh.annotations._
import grpc.reflection.v1alpha.reflection._
class HandlerProcessingBenchmark extends CommonBenchmark {
- implicit val system = ActorSystem("bench")
- implicit val writer = GrpcProtocolNative.newWriter(Identity)
+ implicit val system: ActorSystem = ActorSystem("bench")
+ implicit val writer: GrpcProtocol.GrpcProtocolWriter =
GrpcProtocolNative.newWriter(Identity)
val in = Source.repeat(ServerReflectionRequest()).take(10000)
val request: HttpRequest = {
- implicit val serializer =
ServerReflection.Serializers.ServerReflectionRequestSerializer
+ implicit val serializer:
ScalapbProtobufSerializer[ServerReflectionRequest] =
+ ServerReflection.Serializers.ServerReflectionRequestSerializer
GrpcRequestHelpers(Uri("https://unused.example/" + ServerReflection.name +
"/ServerReflectionInfo"), Nil, in)
}
diff --git
a/codegen/src/main/scala/org/apache/pekko/grpc/gen/CodeGenerator.scala
b/codegen/src/main/scala/org/apache/pekko/grpc/gen/CodeGenerator.scala
index 6054b4be..683457d1 100644
--- a/codegen/src/main/scala/org/apache/pekko/grpc/gen/CodeGenerator.scala
+++ b/codegen/src/main/scala/org/apache/pekko/grpc/gen/CodeGenerator.scala
@@ -33,7 +33,7 @@ trait CodeGenerator {
/** Takes Scala binary version and returns suggested dependency Seq */
def suggestedDependencies: ScalaBinaryVersion => Seq[Artifact]
- def registerExtensions(@nowarn("cat=unused-params") registry:
ExtensionRegistry): Unit = {}
+ def registerExtensions(@nowarn("msg=is never used") registry:
ExtensionRegistry): Unit = {}
final def run(request: Array[Byte], logger: Logger): Array[Byte] = {
val registry = ExtensionRegistry.newInstance
diff --git
a/codegen/src/main/scala/org/apache/pekko/grpc/gen/javadsl/JavaCodeGenerator.scala
b/codegen/src/main/scala/org/apache/pekko/grpc/gen/javadsl/JavaCodeGenerator.scala
index 846a6df6..43730d15 100644
---
a/codegen/src/main/scala/org/apache/pekko/grpc/gen/javadsl/JavaCodeGenerator.scala
+++
b/codegen/src/main/scala/org/apache/pekko/grpc/gen/javadsl/JavaCodeGenerator.scala
@@ -29,11 +29,11 @@ abstract class JavaCodeGenerator extends CodeGenerator {
def perServiceContent: Set[(Logger, Service) =>
immutable.Seq[CodeGeneratorResponse.File]] = Set.empty
/** Override these to add service-independent generated files */
- def staticContent(@nowarn("cat=unused-params") logger: Logger):
Set[CodeGeneratorResponse.File] =
+ def staticContent(@nowarn("msg=is never used") logger: Logger):
Set[CodeGeneratorResponse.File] =
Set.empty
def staticContent(
- @nowarn("cat=unused-params") logger: Logger,
- @nowarn("cat=unused-params") allServices: Seq[Service]):
Set[CodeGeneratorResponse.File] =
+ @nowarn("msg=is never used") logger: Logger,
+ @nowarn("msg=is never used") allServices: Seq[Service]):
Set[CodeGeneratorResponse.File] =
Set.empty
override def run(request: CodeGeneratorRequest, logger: Logger):
CodeGeneratorResponse = {
diff --git
a/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCodeGenerator.scala
b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCodeGenerator.scala
index 734932dd..9c67b38a 100644
---
a/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCodeGenerator.scala
+++
b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCodeGenerator.scala
@@ -30,10 +30,10 @@ abstract class ScalaCodeGenerator extends CodeGenerator {
def perServiceContent: Set[(Logger, Service) =>
immutable.Seq[CodeGeneratorResponse.File]] = Set.empty
// Override these to add service-independent generated files
- def staticContent(@nowarn("cat=unused-params") logger: Logger):
Set[CodeGeneratorResponse.File] = Set.empty
+ def staticContent(@nowarn("msg=is never used") logger: Logger):
Set[CodeGeneratorResponse.File] = Set.empty
def staticContent(
- @nowarn("cat=unused-params") logger: Logger,
- @nowarn("cat=unused-params") allServices: Seq[Service]):
Set[CodeGeneratorResponse.File] = Set.empty
+ @nowarn("msg=is never used") logger: Logger,
+ @nowarn("msg=is never used") allServices: Seq[Service]):
Set[CodeGeneratorResponse.File] = Set.empty
override def suggestedDependencies =
(scalaBinaryVersion: CodeGenerator.ScalaBinaryVersion) =>
diff --git
a/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaMarshallersCodeGenerator.scala
b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaMarshallersCodeGenerator.scala
index 43615950..a9f59d1b 100644
---
a/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaMarshallersCodeGenerator.scala
+++
b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaMarshallersCodeGenerator.scala
@@ -35,7 +35,7 @@ trait ScalaMarshallersCodeGenerator extends
ScalaCodeGenerator {
.suggestedDependencies(scalaBinaryVersion)
def generateMarshalling(
- @nowarn("cat=unused-params") logger: Logger,
+ @nowarn("msg=is never used") logger: Logger,
service: Service): immutable.Seq[CodeGeneratorResponse.File] = {
val b = CodeGeneratorResponse.File.newBuilder()
b.setContent(Marshallers(service).body)
diff --git
a/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/Serializer.scala
b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/Serializer.scala
index 45022dbe..9bfcef2b 100644
--- a/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/Serializer.scala
+++ b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/Serializer.scala
@@ -16,7 +16,7 @@ package org.apache.pekko.grpc.gen.scaladsl
import com.google.protobuf.Descriptors.{ Descriptor, MethodDescriptor }
import scalapb.compiler.DescriptorImplicits
-case class Serializer(name: String, init: String)
+case class Serializer(name: String, scalaType: String, init: String)
object Serializer {
def apply(method: MethodDescriptor, messageType: Descriptor)(implicit ops:
DescriptorImplicits): Serializer = {
@@ -25,6 +25,7 @@ object Serializer {
} else {
messageType.getFile.getPackage.replace('.', '_') + "_" +
messageType.getName + "Serializer"
}
- Serializer(name, s"new
ScalapbProtobufSerializer(${Method.messageType(messageType)}.messageCompanion)")
+ Serializer(name, Method.messageType(messageType),
+ s"new
ScalapbProtobufSerializer(${Method.messageType(messageType)}.messageCompanion)")
}
}
diff --git
a/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/Service.scala
b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/Service.scala
index a01d4f7a..eaae97a2 100644
--- a/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/Service.scala
+++ b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/Service.scala
@@ -41,7 +41,7 @@ object Service {
serviceDescriptor: ServiceDescriptor,
serverPowerApi: Boolean,
usePlayActions: Boolean): Service = {
- implicit val ops =
+ implicit val ops: DescriptorImplicits =
DescriptorImplicits.fromCodeGenRequest(generatorParams, request)
import ops._
diff --git a/codegen/src/main/twirl/templates/ScalaCommon/Marshallers.scala.txt
b/codegen/src/main/twirl/templates/ScalaCommon/Marshallers.scala.txt
index 78805ff2..167c4e89 100644
--- a/codegen/src/main/twirl/templates/ScalaCommon/Marshallers.scala.txt
+++ b/codegen/src/main/twirl/templates/ScalaCommon/Marshallers.scala.txt
@@ -24,6 +24,7 @@ import pekko.stream.Materializer
import pekko.grpc.GrpcProtocol.GrpcProtocolWriter
import pekko.grpc.ProtobufSerializer
import pekko.grpc.scaladsl.GrpcMarshalling
+import pekko.grpc.scaladsl.ScalapbProtobufSerializer
import pekko.http.scaladsl.marshalling.Marshaller
import pekko.http.scaladsl.marshalling.ToResponseMarshaller
import pekko.http.scaladsl.model.HttpRequest
@@ -35,7 +36,7 @@ import pekko.grpc.PekkoGrpcGenerated
@@PekkoGrpcGenerated
object @{service.name}Marshallers {
@for(serializer <- service.serializers) {
- implicit val @serializer.name =
@{service.packageName}.@{service.name}.Serializers.@{serializer.name}
+ implicit val @serializer.name:
ScalapbProtobufSerializer[@{serializer.scalaType}] =
@{service.packageName}.@{service.name}.Serializers.@{serializer.name}
}
implicit def unmarshaller[T](implicit serializer: ProtobufSerializer[T],
mat: Materializer): FromRequestUnmarshaller[T] =
diff --git a/codegen/src/main/twirl/templates/ScalaServer/Handler.scala.txt
b/codegen/src/main/twirl/templates/ScalaServer/Handler.scala.txt
index 1266403f..55ce73e1 100644
--- a/codegen/src/main/twirl/templates/ScalaServer/Handler.scala.txt
+++ b/codegen/src/main/twirl/templates/ScalaServer/Handler.scala.txt
@@ -26,7 +26,7 @@ import pekko.actor.ActorSystem
import pekko.actor.ClassicActorSystemProvider
import pekko.annotation.ApiMayChange
import pekko.http.scaladsl.model
-import pekko.stream.SystemMaterializer
+import pekko.stream.{Materializer, SystemMaterializer}
import pekko.grpc.internal.TelemetryExtension
@@ -117,7 +117,7 @@ object @{serviceName}Handler {
* Registering a gRPC service under a custom prefix is not widely
supported and strongly discouraged by the specification.
*/
def partial(implementation: @serviceName, prefix: String =
@{service.name}.name, eHandler: ActorSystem => PartialFunction[Throwable,
Trailers] = GrpcExceptionHandler.defaultMapper)(implicit system:
ClassicActorSystemProvider): PartialFunction[model.HttpRequest,
scala.concurrent.Future[model.HttpResponse]] = {
- implicit val mat = SystemMaterializer(system).materializer
+ implicit val mat: Materializer = SystemMaterializer(system).materializer
implicit val ec: ExecutionContext = mat.executionContext
val spi = TelemetryExtension(system).spi
diff --git
a/interop-tests/src/main/scala/org/apache/pekko/grpc/interop/PekkoGrpcClientScala.scala
b/interop-tests/src/main/scala/org/apache/pekko/grpc/interop/PekkoGrpcClientScala.scala
index d375557e..10e545f3 100644
---
a/interop-tests/src/main/scala/org/apache/pekko/grpc/interop/PekkoGrpcClientScala.scala
+++
b/interop-tests/src/main/scala/org/apache/pekko/grpc/interop/PekkoGrpcClientScala.scala
@@ -26,7 +26,7 @@ final case class PekkoGrpcClientScala(clientTesterFactory:
Settings => ActorSyst
TestUtils.installConscryptIfAvailable()
val settings = Settings.parseArgs(args)
- implicit val sys = ActorSystem()
+ implicit val sys: ActorSystem = ActorSystem()
val client = new TestServiceClient(clientTesterFactory(settings)(sys))
client.setUp()
diff --git
a/interop-tests/src/main/scala/org/apache/pekko/grpc/interop/PekkoGrpcServerScala.scala
b/interop-tests/src/main/scala/org/apache/pekko/grpc/interop/PekkoGrpcServerScala.scala
index ea99a63a..4593963a 100644
---
a/interop-tests/src/main/scala/org/apache/pekko/grpc/interop/PekkoGrpcServerScala.scala
+++
b/interop-tests/src/main/scala/org/apache/pekko/grpc/interop/PekkoGrpcServerScala.scala
@@ -37,7 +37,7 @@ import scala.concurrent.{ Await, Future }
case class PekkoGrpcServerScala(serverHandlerFactory: ActorSystem =>
HttpRequest => Future[HttpResponse])
extends GrpcServer[(ActorSystem, ServerBinding)] {
override def start(args: Array[String]) = {
- implicit val sys = ActorSystem()
+ implicit val sys: ActorSystem = ActorSystem()
val testService = serverHandlerFactory(sys)
diff --git
a/interop-tests/src/test/scala/org/apache/pekko/grpc/interop/PekkoGrpcScalaClientTester.scala
b/interop-tests/src/test/scala/org/apache/pekko/grpc/interop/PekkoGrpcScalaClientTester.scala
index 8256bef6..dc64c4ae 100644
---
a/interop-tests/src/test/scala/org/apache/pekko/grpc/interop/PekkoGrpcScalaClientTester.scala
+++
b/interop-tests/src/test/scala/org/apache/pekko/grpc/interop/PekkoGrpcScalaClientTester.scala
@@ -18,7 +18,7 @@ import java.io.InputStream
import org.apache.pekko
import pekko.actor.ActorSystem
import pekko.grpc.{ GrpcClientSettings, GrpcResponseMetadata, SSLContextUtils }
-import pekko.stream.SystemMaterializer
+import pekko.stream.{ Materializer, SystemMaterializer }
import pekko.stream.scaladsl.{ Keep, Sink, Source }
import com.google.protobuf.ByteString
import io.grpc.testing.integration.empty.Empty
@@ -27,7 +27,7 @@ import io.grpc.testing.integration.test.{ TestServiceClient,
UnimplementedServic
import io.grpc.testing.integration2.{ ClientTester, Settings }
import io.grpc.{ Status, StatusRuntimeException }
import org.junit.Assert._
-import org.scalatest.matchers.should.Matchers.{ a, convertToAnyShouldWrapper }
+import org.scalatest.matchers.should.Matchers._
import scala.concurrent.duration._
import scala.concurrent.{ Await, Future }
@@ -45,7 +45,7 @@ class PekkoGrpcScalaClientTester(val settings: Settings,
backend: String)(implic
extends ClientTester {
private var client: TestServiceClient = null
private var clientUnimplementedService: UnimplementedServiceClient = null
- private implicit val mat = SystemMaterializer(system).materializer
+ private implicit val mat: Materializer =
SystemMaterializer(system).materializer
private val awaitTimeout = 15.seconds
diff --git
a/interop-tests/src/test/scala/org/apache/pekko/grpc/interop/PekkoHttpServerProviderScala.scala
b/interop-tests/src/test/scala/org/apache/pekko/grpc/interop/PekkoHttpServerProviderScala.scala
index ad0ae696..7a05fd48 100644
---
a/interop-tests/src/test/scala/org/apache/pekko/grpc/interop/PekkoHttpServerProviderScala.scala
+++
b/interop-tests/src/test/scala/org/apache/pekko/grpc/interop/PekkoHttpServerProviderScala.scala
@@ -16,6 +16,7 @@ package org.apache.pekko.grpc.interop
import org.apache.pekko
import pekko.NotUsed
import pekko.actor.ActorSystem
+import pekko.grpc.GrpcProtocol
import pekko.grpc.internal.{ GrpcEntityHelpers, GrpcProtocolNative,
GrpcResponseHelpers, Identity }
import pekko.http.scaladsl.model.headers.RawHeader
import pekko.http.scaladsl.model.{ AttributeKeys, HttpEntity, HttpHeader,
Trailer }
@@ -27,14 +28,14 @@ import io.grpc.testing.integration.messages.{
SimpleRequest, StreamingOutputCall
import io.grpc.testing.integration.test.{ TestService, TestServiceHandler,
TestServiceMarshallers }
import scala.collection.immutable
-import scala.concurrent.Promise
+import scala.concurrent.{ ExecutionContext, Promise }
object PekkoHttpServerProviderScala extends PekkoHttpServerProvider with
Directives {
val label: String = "pekko-grpc server scala"
val pendingCases =
Set()
- val server = PekkoGrpcServerScala(implicit sys => {
+ val server: PekkoGrpcServerScala = PekkoGrpcServerScala(implicit sys => {
val testServiceImpl = new TestServiceImpl()
val testServiceHandler = TestServiceHandler(testServiceImpl)
@@ -59,8 +60,8 @@ object PekkoHttpServerProviderScala extends
PekkoHttpServerProvider with Directi
// Route to pass the 'status_code_and_message' test
def customStatusRoute(testServiceImpl: TestServiceImpl)(implicit mat:
Materializer, system: ActorSystem): Route = {
- implicit val ec = mat.executionContext
- implicit val writer = GrpcProtocolNative.newWriter(Identity)
+ implicit val ec: ExecutionContext = mat.executionContext
+ implicit val writer: GrpcProtocol.GrpcProtocolWriter =
GrpcProtocolNative.newWriter(Identity)
import TestServiceMarshallers._
diff --git
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcChannelSpec.scala
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcChannelSpec.scala
index 5925a9c7..6765463f 100644
---
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcChannelSpec.scala
+++
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcChannelSpec.scala
@@ -13,7 +13,7 @@
package org.apache.pekko.grpc.scaladsl
-import scala.concurrent.Await
+import scala.concurrent.{ Await, ExecutionContext }
import scala.concurrent.duration._
import org.apache.pekko
@@ -23,7 +23,7 @@ import pekko.grpc.{ GrpcChannel, GrpcClientCloseException,
GrpcClientSettings }
import pekko.http.scaladsl.Http
import pekko.http.scaladsl.model.RemoteAddress
import pekko.http.scaladsl.server.Directives
-import pekko.stream.SystemMaterializer
+import pekko.stream.{ Materializer, SystemMaterializer }
import com.typesafe.config.{ Config, ConfigFactory }
import example.myapp.helloworld.grpc.helloworld._
import org.scalatest.BeforeAndAfterAll
@@ -39,9 +39,9 @@ class GrpcChannelSpec(config: Config = ConfigFactory.load())
with Matchers
with BeforeAndAfterAll
with ScalaFutures {
- implicit val system = ActorSystem("GrpcChannelSpec", config)
- implicit val mat = SystemMaterializer(system).materializer
- implicit val ec = system.dispatcher
+ implicit val system: ActorSystem = ActorSystem("GrpcChannelSpec", config)
+ implicit val mat: Materializer = SystemMaterializer(system).materializer
+ implicit val ec: ExecutionContext = system.dispatcher
override implicit val patienceConfig: PatienceConfig =
PatienceConfig(5.seconds, Span(10, org.scalatest.time.Millis))
diff --git
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcExceptionHandlerSpec.scala
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcExceptionHandlerSpec.scala
index e2cc2e1d..76228adc 100644
---
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcExceptionHandlerSpec.scala
+++
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcExceptionHandlerSpec.scala
@@ -19,27 +19,30 @@ import pekko.grpc.internal.{ GrpcProtocolNative,
GrpcRequestHelpers, Identity }
import pekko.grpc.scaladsl.headers.`Status`
import pekko.http.scaladsl.model.{ AttributeKeys, HttpEntity, HttpRequest,
HttpResponse }
import pekko.http.scaladsl.model.HttpEntity.{ Chunked, LastChunk, Strict }
+import pekko.grpc.GrpcProtocol
import pekko.stream.scaladsl.{ Sink, Source }
import pekko.testkit.TestKit
import pekko.util.ByteString
import io.grpc.testing.integration.test.TestService
+import io.grpc.testing.integration.messages.SimpleRequest
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpecLike
-import scala.concurrent.Future
+import scala.concurrent.{ ExecutionContext, Future }
class GrpcExceptionHandlerSpec
extends TestKit(ActorSystem("GrpcExceptionHandlerSpec"))
with AnyWordSpecLike
with Matchers
with ScalaFutures {
- implicit val ec = system.dispatcher
+ implicit val ec: ExecutionContext = system.dispatcher
"The default ExceptionHandler" should {
"produce an INVALID_ARGUMENT error when the expected parameter is not
found" in {
- implicit val serializer = TestService.Serializers.SimpleRequestSerializer
- implicit val marshaller = GrpcProtocolNative.newWriter(Identity)
+ implicit val serializer: ScalapbProtobufSerializer[SimpleRequest] =
+ TestService.Serializers.SimpleRequestSerializer
+ implicit val marshaller: GrpcProtocol.GrpcProtocolWriter =
GrpcProtocolNative.newWriter(Identity)
// request that is missing the actual data
val unmarshallableRequest = HttpRequest(entity =
HttpEntity.empty(GrpcProtocolNative.contentType))
@@ -120,9 +123,9 @@ class GrpcExceptionHandlerSpec
}
"return the correct user-supplied status for a unary call" in {
- implicit val serializer =
+ implicit val serializer: ScalapbProtobufSerializer[HelloRequest] =
example.myapp.helloworld.grpc.helloworld.GreeterService.Serializers.HelloRequestSerializer
- implicit val writer = GrpcProtocolNative.newWriter(Identity)
+ implicit val writer: GrpcProtocol.GrpcProtocolWriter =
GrpcProtocolNative.newWriter(Identity)
val request = GrpcRequestHelpers(s"/${GreeterService.name}/SayHello",
List.empty, Source.single(HelloRequest("")))
@@ -141,9 +144,9 @@ class GrpcExceptionHandlerSpec
}
"return the correct user-supplied status for a streaming call" in {
- implicit val serializer =
+ implicit val serializer: ScalapbProtobufSerializer[HelloRequest] =
example.myapp.helloworld.grpc.helloworld.GreeterService.Serializers.HelloRequestSerializer
- implicit val writer = GrpcProtocolNative.newWriter(Identity)
+ implicit val writer: GrpcProtocol.GrpcProtocolWriter =
GrpcProtocolNative.newWriter(Identity)
val request =
GrpcRequestHelpers(s"/${GreeterService.name}/ItKeepsReplying",
List.empty, Source.single(HelloRequest("")))
diff --git
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcMarshallingSpec.scala
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcMarshallingSpec.scala
index 145d3792..9bbbe92c 100644
---
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcMarshallingSpec.scala
+++
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcMarshallingSpec.scala
@@ -36,8 +36,8 @@ import scala.concurrent.duration._
class GrpcMarshallingSpec extends AnyWordSpec with Matchers {
"The scaladsl GrpcMarshalling" should {
val message = SimpleRequest(responseCompressed = Some(BoolValue(true)))
- implicit val serializer = TestService.Serializers.SimpleRequestSerializer
- implicit val system = ActorSystem()
+ implicit val serializer: ScalapbProtobufSerializer[SimpleRequest] =
TestService.Serializers.SimpleRequestSerializer
+ implicit val system: ActorSystem = ActorSystem()
val awaitTimeout = 10.seconds
val zippedBytes =
AbstractGrpcProtocol.encodeFrameData(
diff --git
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/LoadBalancingIntegrationSpec.scala
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/LoadBalancingIntegrationSpec.scala
index 9a7a3378..a7dda5cc 100644
---
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/LoadBalancingIntegrationSpec.scala
+++
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/LoadBalancingIntegrationSpec.scala
@@ -33,7 +33,7 @@ import org.scalatest.matchers.should.Matchers
import org.scalatest.time.Span
import org.scalatest.wordspec.AnyWordSpec
-import scala.concurrent.Await
+import scala.concurrent.{ Await, ExecutionContext }
import scala.concurrent.duration._
class LoadBalancingIntegrationSpecNetty extends LoadBalancingIntegrationSpec()
@@ -50,9 +50,9 @@ class LoadBalancingIntegrationSpec(config: Config =
ConfigFactory.load())
with Matchers
with BeforeAndAfterAll
with ScalaFutures {
- implicit val system = ActorSystem("LoadBalancingIntegrationSpec", config)
- implicit val mat = SystemMaterializer(system).materializer
- implicit val ec = system.dispatcher
+ implicit val system: ActorSystem =
ActorSystem("LoadBalancingIntegrationSpec", config)
+ implicit val mat: Materializer = SystemMaterializer(system).materializer
+ implicit val ec: ExecutionContext = system.dispatcher
override implicit val patienceConfig: PatienceConfig =
PatienceConfig(5.seconds, Span(10, org.scalatest.time.Millis))
diff --git
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/NonBalancingIntegrationSpec.scala
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/NonBalancingIntegrationSpec.scala
index ed634859..cfe73435 100644
---
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/NonBalancingIntegrationSpec.scala
+++
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/NonBalancingIntegrationSpec.scala
@@ -20,7 +20,7 @@ import pekko.grpc.GrpcClientSettings
import pekko.grpc.internal.ClientConnectionException
import pekko.grpc.scaladsl.tools.MutableServiceDiscovery
import pekko.http.scaladsl.Http
-import pekko.stream.SystemMaterializer
+import pekko.stream.{ Materializer, SystemMaterializer }
import com.typesafe.config.ConfigFactory
import example.myapp.helloworld.grpc.helloworld._
import io.grpc.Status.Code
@@ -32,7 +32,7 @@ import org.scalatest.matchers.should.Matchers
import org.scalatest.time.Span
import org.scalatest.wordspec.AnyWordSpec
-import scala.concurrent.{ Await, Future }
+import scala.concurrent.{ Await, ExecutionContext, Future }
import scala.concurrent.duration._
class NonBalancingIntegrationSpecNetty extends
NonBalancingIntegrationSpec("netty")
@@ -43,11 +43,11 @@ class NonBalancingIntegrationSpec(backend: String)
with Matchers
with BeforeAndAfterAll
with ScalaFutures {
- implicit val system = ActorSystem(
+ implicit val system: ActorSystem = ActorSystem(
s"NonBalancingIntegrationSpec-$backend",
ConfigFactory.parseString(s"""pekko.grpc.client."*".backend = "$backend"
""").withFallback(ConfigFactory.load()))
- implicit val mat = SystemMaterializer(system).materializer
- implicit val ec = system.dispatcher
+ implicit val mat: Materializer = SystemMaterializer(system).materializer
+ implicit val ec: ExecutionContext = system.dispatcher
override implicit val patienceConfig: PatienceConfig =
PatienceConfig(10.seconds, Span(10, org.scalatest.time.Millis))
diff --git
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/PowerApiSpec.scala
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/PowerApiSpec.scala
index 9b25069d..9fb4bfcc 100644
---
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/PowerApiSpec.scala
+++
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/PowerApiSpec.scala
@@ -20,7 +20,7 @@ import scala.concurrent.duration._
import org.apache.pekko
import pekko.NotUsed
import pekko.actor.ActorSystem
-import pekko.grpc.GrpcClientSettings
+import pekko.grpc.{ GrpcClientSettings, GrpcProtocol }
import pekko.grpc.GrpcProtocol.TrailerFrame
import pekko.grpc.GrpcResponseMetadata
import pekko.grpc.internal.GrpcEntityHelpers
@@ -62,9 +62,9 @@ abstract class PowerApiSpec(backend: String)
with BeforeAndAfter
with BeforeAndAfterAll {
- override implicit val patienceConfig = PatienceConfig(5.seconds, Span(10,
org.scalatest.time.Millis))
+ override implicit val patienceConfig: PatienceConfig =
PatienceConfig(5.seconds, Span(10, org.scalatest.time.Millis))
- val server =
+ val server: Http.ServerBinding =
Http().newServerAt("localhost", 0).bind(GreeterServicePowerApiHandler(new
PowerGreeterServiceImpl())).futureValue
var client: GreeterServiceClient = _
@@ -96,12 +96,12 @@ abstract class PowerApiSpec(backend: String)
}
"successfully pass metadata from server to client" in {
- implicit val serializer = GreeterService.Serializers.HelloReplySerializer
+ implicit val serializer: ScalapbProtobufSerializer[HelloReply] =
GreeterService.Serializers.HelloReplySerializer
val specialServer =
Http()
.newServerAt("localhost", 0)
.bind(path(GreeterService.name / "SayHello") {
- implicit val writer = GrpcProtocolNative.newWriter(Identity)
+ implicit val writer: GrpcProtocol.GrpcProtocolWriter =
GrpcProtocolNative.newWriter(Identity)
val trailingMetadata = new
HeaderMetadataImpl(List(RawHeader("foo", "bar")))
complete(
GrpcResponseHelpers(
@@ -155,12 +155,12 @@ abstract class PowerApiSpec(backend: String)
"successfully pass metadata from server to client (for client-streaming
calls)" in {
val trailer = Promise[TrailerFrame]() // control the sending of the
trailer
- implicit val serializer = GreeterService.Serializers.HelloReplySerializer
+ implicit val serializer: ScalapbProtobufSerializer[HelloReply] =
GreeterService.Serializers.HelloReplySerializer
val metadataServer =
Http()
.newServerAt("localhost", 0)
.bind(path(GreeterService.name / "ItKeepsTalking") {
- implicit val writer = GrpcProtocolNative.newWriter(Identity)
+ implicit val writer: GrpcProtocol.GrpcProtocolWriter =
GrpcProtocolNative.newWriter(Identity)
complete(
GrpcResponseHelpers(Source.single(HelloReply("Hello there!")),
trail = Source.future(trailer.future))
.addHeader(RawHeader("foo", "bar")))
diff --git
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/TelemetrySpec.scala
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/TelemetrySpec.scala
index 105f65ed..21c8e4a0 100644
---
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/TelemetrySpec.scala
+++
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/TelemetrySpec.scala
@@ -18,6 +18,7 @@ import com.typesafe.config.ConfigFactory
import org.apache.pekko
import pekko.actor.ActorSystem
import pekko.grpc.internal.{ GrpcProtocolNative, GrpcRequestHelpers, Identity,
TelemetryExtension, TelemetrySpi }
+import pekko.grpc.GrpcProtocol
import pekko.http.javadsl.model.HttpRequest
import pekko.stream.scaladsl.Source
import pekko.testkit.TestKit
@@ -41,8 +42,8 @@ class TelemetrySpec
"The client-side telemetry hook" should {
"pick up matched requests" in {
val handler = GreeterServiceHandler(new CountingGreeterServiceImpl)
- implicit val ser = GreeterService.Serializers.HelloRequestSerializer
- implicit val writer = GrpcProtocolNative.newWriter(Identity)
+ implicit val ser: ScalapbProtobufSerializer[HelloRequest] =
GreeterService.Serializers.HelloRequestSerializer
+ implicit val writer: GrpcProtocol.GrpcProtocolWriter =
GrpcProtocolNative.newWriter(Identity)
handler(
GrpcRequestHelpers(
s"https://localhost/${GreeterService.name}/SayHello",
diff --git a/plugin-tester-java/build.gradle b/plugin-tester-java/build.gradle
index bcf592a6..d021437e 100644
--- a/plugin-tester-java/build.gradle
+++ b/plugin-tester-java/build.gradle
@@ -23,7 +23,7 @@ def scalaBinaryVersion =
"${scalaVersion.major}.${scalaVersion.minor}"
dependencies {
implementation group: 'ch.megard', name:
"pekko-http-cors_${scalaBinaryVersion}", version: '0.0.0-SNAPSHOT'
implementation "org.scala-lang:scala-library:${scalaFullVersion}"
- testImplementation
"org.apache.pekko:pekko-stream-testkit_${scalaBinaryVersion}:0.0.0+26656-898c6970-SNAPSHOT"
+ testImplementation
"org.apache.pekko:pekko-stream-testkit_${scalaBinaryVersion}:0.0.0+26669-ec5b6764-SNAPSHOT"
testImplementation "org.scalatest:scalatest_${scalaBinaryVersion}:3.2.15"
testImplementation
"org.scalatestplus:junit-4-13_${scalaBinaryVersion}:3.2.15.0"
}
diff --git
a/plugin-tester-java/src/test/scala/example/myapp/helloworld/ErrorReportingSpec.scala
b/plugin-tester-java/src/test/scala/example/myapp/helloworld/ErrorReportingSpec.scala
index 2e725e06..553b3276 100644
---
a/plugin-tester-java/src/test/scala/example/myapp/helloworld/ErrorReportingSpec.scala
+++
b/plugin-tester-java/src/test/scala/example/myapp/helloworld/ErrorReportingSpec.scala
@@ -37,8 +37,8 @@ import scala.concurrent.Await
import scala.concurrent.duration._
class ErrorReportingSpec extends AnyWordSpec with Matchers with ScalaFutures
with BeforeAndAfterAll {
- implicit val sys = ActorSystem()
- override implicit val patienceConfig = PatienceConfig(5.seconds, Span(100,
org.scalatest.time.Millis))
+ implicit val sys: ActorSystem = ActorSystem()
+ override implicit val patienceConfig: PatienceConfig =
PatienceConfig(5.seconds, Span(100, org.scalatest.time.Millis))
"A gRPC server" should {
val mat = implicitly[Materializer]
diff --git
a/plugin-tester-java/src/test/scala/example/myapp/helloworld/JGreeterServiceSpec.scala
b/plugin-tester-java/src/test/scala/example/myapp/helloworld/JGreeterServiceSpec.scala
index 00bc71d0..3fb9496a 100644
---
a/plugin-tester-java/src/test/scala/example/myapp/helloworld/JGreeterServiceSpec.scala
+++
b/plugin-tester-java/src/test/scala/example/myapp/helloworld/JGreeterServiceSpec.scala
@@ -17,6 +17,7 @@ import scala.concurrent.Await
import org.scalatest.BeforeAndAfterAll
import scala.concurrent.duration._
+import scala.concurrent.ExecutionContext
import org.apache.pekko
import pekko.actor.ActorSystem
@@ -48,7 +49,7 @@ class JGreeterServiceSpec extends Matchers with
AnyWordSpecLike with BeforeAndAf
val clientSystem = ActorSystem("GreeterClient")
- implicit val ec = clientSystem.dispatcher
+ implicit val ec: ExecutionContext = clientSystem.dispatcher
val clients = Seq(8090, 8091).map { port =>
GreeterServiceClient.create(GrpcClientSettings.connectToServiceAt("127.0.0.1",
port).withTls(false), clientSystem)
diff --git a/plugin-tester-scala/build.gradle b/plugin-tester-scala/build.gradle
index 04e35287..c440aeb9 100644
--- a/plugin-tester-scala/build.gradle
+++ b/plugin-tester-scala/build.gradle
@@ -18,7 +18,7 @@ def scalaBinaryVersion =
"${scalaVersion.major}.${scalaVersion.minor}"
dependencies {
implementation group: 'ch.megard', name:
"pekko-http-cors_${scalaBinaryVersion}", version: '0.0.0-SNAPSHOT'
implementation "org.scala-lang:scala-library:${scalaFullVersion}"
- testImplementation
"org.apache.pekko:pekko-stream-testkit_${scalaBinaryVersion}:0.0.0+26656-898c6970-SNAPSHOT"
+ testImplementation
"org.apache.pekko:pekko-stream-testkit_${scalaBinaryVersion}:0.0.0+26669-ec5b6764-SNAPSHOT"
testImplementation "org.scalatest:scalatest_${scalaBinaryVersion}:3.2.15"
testImplementation
"org.scalatestplus:junit-4-13_${scalaBinaryVersion}:3.2.15.0"
}
diff --git a/plugin-tester-scala/pom.xml b/plugin-tester-scala/pom.xml
index a9802b07..2440316a 100644
--- a/plugin-tester-scala/pom.xml
+++ b/plugin-tester-scala/pom.xml
@@ -13,7 +13,7 @@
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
- <pekko.version>0.0.0+26656-898c6970-SNAPSHOT</pekko.version>
+ <pekko.version>0.0.0+26669-ec5b6764-SNAPSHOT</pekko.version>
<pekko.http.cors.version>0.0.0-SNAPSHOT</pekko.http.cors.version>
<grpc.version>1.48.1</grpc.version> <!-- checked synced by
VersionSyncCheckPlugin -->
<project.encoding>UTF-8</project.encoding>
diff --git
a/plugin-tester-scala/src/main/scala/example/myapp/helloworld/AuthenticatedGreeterClient.scala
b/plugin-tester-scala/src/main/scala/example/myapp/helloworld/AuthenticatedGreeterClient.scala
index 9fa3661e..77331d26 100644
---
a/plugin-tester-scala/src/main/scala/example/myapp/helloworld/AuthenticatedGreeterClient.scala
+++
b/plugin-tester-scala/src/main/scala/example/myapp/helloworld/AuthenticatedGreeterClient.scala
@@ -23,7 +23,7 @@ import scala.concurrent.duration._
object AuthenticatedGreeterClient {
def main(args: Array[String]): Unit = {
// Boot akka
- implicit val sys = ActorSystem("HelloWorldClient")
+ implicit val sys: ActorSystem = ActorSystem("HelloWorldClient")
// Take details how to connect to the service from the config.
val clientSettings = GrpcClientSettings.connectToServiceAt("127.0.0.1",
8082).withTls(false)
diff --git
a/plugin-tester-scala/src/main/scala/example/myapp/helloworld/GreeterClient.scala
b/plugin-tester-scala/src/main/scala/example/myapp/helloworld/GreeterClient.scala
index 2361eb04..28a2e30f 100644
---
a/plugin-tester-scala/src/main/scala/example/myapp/helloworld/GreeterClient.scala
+++
b/plugin-tester-scala/src/main/scala/example/myapp/helloworld/GreeterClient.scala
@@ -21,15 +21,15 @@ import pekko.grpc.GrpcClientSettings
import pekko.stream.scaladsl.Source
import example.myapp.helloworld.grpc._
-import scala.concurrent.Future
+import scala.concurrent.{ ExecutionContext, Future }
import scala.concurrent.duration._
import scala.util.{ Failure, Success }
object GreeterClient {
def main(args: Array[String]): Unit = {
// Boot akka
- implicit val sys = ActorSystem("HelloWorldClient")
- implicit val ec = sys.dispatcher
+ implicit val sys: ActorSystem = ActorSystem("HelloWorldClient")
+ implicit val ec: ExecutionContext = sys.dispatcher
// Configure the client by code:
val clientSettings = GrpcClientSettings.connectToServiceAt("127.0.0.1",
8080).withTls(false)
diff --git
a/plugin-tester-scala/src/main/scala/example/myapp/helloworld/LiftedGreeterClient.scala
b/plugin-tester-scala/src/main/scala/example/myapp/helloworld/LiftedGreeterClient.scala
index 37c39bc7..401e08ab 100644
---
a/plugin-tester-scala/src/main/scala/example/myapp/helloworld/LiftedGreeterClient.scala
+++
b/plugin-tester-scala/src/main/scala/example/myapp/helloworld/LiftedGreeterClient.scala
@@ -14,6 +14,7 @@
package example.myapp.helloworld
import scala.concurrent.Await
+import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import scala.concurrent.duration._
import scala.util.Try
@@ -29,8 +30,8 @@ import example.myapp.helloworld.grpc._
object LiftedGreeterClient {
def main(args: Array[String]): Unit = {
- implicit val sys = ActorSystem("HelloWorldClient")
- implicit val ec = sys.dispatcher
+ implicit val sys: ActorSystem = ActorSystem("HelloWorldClient")
+ implicit val ec: ExecutionContext = sys.dispatcher
val clientSettings = GrpcClientSettings.fromConfig(GreeterService.name)
val client = GreeterServiceClient(clientSettings)
diff --git
a/plugin-tester-scala/src/test/scala/example/myapp/helloworld/GreeterServiceSpec.scala
b/plugin-tester-scala/src/test/scala/example/myapp/helloworld/GreeterServiceSpec.scala
index 7958fcb2..0b642d27 100644
---
a/plugin-tester-scala/src/test/scala/example/myapp/helloworld/GreeterServiceSpec.scala
+++
b/plugin-tester-scala/src/test/scala/example/myapp/helloworld/GreeterServiceSpec.scala
@@ -27,13 +27,13 @@ import org.scalatest.time.Span
import org.scalatest.wordspec.AnyWordSpecLike
import org.scalatestplus.junit.JUnitRunner
-import scala.concurrent.Await
+import scala.concurrent.{ Await, ExecutionContext }
import scala.concurrent.duration._
@RunWith(classOf[JUnitRunner])
class GreeterSpec extends Matchers with AnyWordSpecLike with BeforeAndAfterAll
with ScalaFutures {
- implicit val patience = PatienceConfig(10.seconds, Span(100,
org.scalatest.time.Millis))
+ implicit val patience: PatienceConfig = PatienceConfig(10.seconds, Span(100,
org.scalatest.time.Millis))
implicit val serverSystem: ActorSystem = {
// important to enable HTTP/2 in server ActorSystem's config
@@ -49,7 +49,7 @@ class GreeterSpec extends Matchers with AnyWordSpecLike with
BeforeAndAfterAll w
val clientSystem = ActorSystem("GreeterClient")
- implicit val ec = clientSystem.dispatcher
+ implicit val ec: ExecutionContext = clientSystem.dispatcher
val clients = Seq(8080, 8081).map { port =>
GreeterServiceClient(
diff --git a/project/Common.scala b/project/Common.scala
index 9c4f9024..1342d4a9 100644
--- a/project/Common.scala
+++ b/project/Common.scala
@@ -12,7 +12,7 @@ package org.apache.pekko.grpc
import sbt.Keys._
import sbt._
import sbt.plugins.JvmPlugin
-import org.apache.pekko.grpc.Dependencies.Versions.{ scala212, scala213 }
+import org.apache.pekko.grpc.Dependencies.Versions.{ scala212, scala213,
scala3 }
import
com.lightbend.paradox.projectinfo.ParadoxProjectInfoPluginKeys.projectInfoVersion
import com.typesafe.tools.mima.plugin.MimaKeys._
import org.mdedetrich.apache.sonatype.ApacheSonatypePlugin
@@ -26,6 +26,8 @@ object Common extends AutoPlugin {
private val consoleDisabledOptions = Seq("-Xfatal-warnings",
"-Ywarn-unused", "-Ywarn-unused-import")
+ val isScala3 = Def.setting(scalaBinaryVersion.value == "3")
+
override def globalSettings =
Seq(
resolvers ++= Resolver.sonatypeOssRepos("staging"),
@@ -42,22 +44,42 @@ object Common extends AutoPlugin {
override lazy val projectSettings = Seq(
projectInfoVersion := (if (isSnapshot.value) "snapshot" else
version.value),
- scalacOptions ++= List(
- "-unchecked",
- "-deprecation",
- "-language:_",
- "-Xfatal-warnings",
- "-Ywarn-unused",
- "-encoding",
- "UTF-8"),
- Compile / scalacOptions ++= Seq(
- // Generated code for methods/fields marked 'deprecated'
- "-Wconf:msg=Marked as deprecated in proto file:silent",
- // deprecated in 2.13, but used as long as we support 2.12
- "-Wconf:msg=Use `scala.jdk.CollectionConverters` instead:silent",
- "-Wconf:msg=Use LazyList instead of Stream:silent",
- // ignore imports in templates (FIXME why is that trailing .* needed?)
- "-Wconf:src=.*.txt.*:silent"),
+ scalacOptions ++= (if (!isScala3.value)
+ Seq(
+ "-unchecked",
+ "-deprecation",
+ "-language:_",
+ "-Xfatal-warnings",
+ "-Ywarn-unused",
+ "-encoding",
+ "UTF-8")
+ else
+ Seq(
+ "-unchecked",
+ "-deprecation",
+ "-language:_",
+ "-Xfatal-warnings",
+ "-Wunused:imports",
+ "-encoding",
+ "UTF-8")),
+ Compile / scalacOptions ++= (if (!isScala3.value)
+ Seq(
+ // Generated code for methods/fields
marked 'deprecated'
+ "-Wconf:msg=Marked as deprecated in proto
file:silent",
+ // deprecated in 2.13, but used as long
as we support 2.12
+ "-Wconf:msg=Use
`scala.jdk.CollectionConverters` instead:silent",
+ "-Wconf:msg=Use LazyList instead of
Stream:silent",
+ // ignore imports in templates (FIXME why
is that trailing .* needed?)
+ "-Wconf:src=.*.txt.*:silent")
+ else
+ Seq(
+ // Generated code for methods/fields
marked 'deprecated'
+ "-Wconf:msg=Marked as deprecated in proto
file:silent",
+ // deprecated in 2.13, but used as long
as we support 2.12
+ "-Wconf:msg=Use
`scala.jdk.CollectionConverters` instead:silent",
+ "-Wconf:msg=instead of Stream:silent",
+ "-Wconf:msg=unused import:silent",
+ "-Wconf:cat=feature:silent")),
Compile / console / scalacOptions ~=
(_.filterNot(consoleDisabledOptions.contains)),
javacOptions ++= List("-Xlint:unchecked", "-Xlint:deprecation"),
Compile / doc / scalacOptions := scalacOptions.value ++ Seq(
@@ -67,20 +89,27 @@ object Common extends AutoPlugin {
version.value,
"-sourcepath",
(ThisBuild / baseDirectory).value.toString,
- "-skip-packages",
- "org.apache.pekko.pattern:" + // for some reason Scaladoc creates this
- "templates",
"-doc-source-url", {
val branch = if (isSnapshot.value) "main" else s"v${version.value}"
s"https://github.com/apache/incubator-pekko-grpc/tree/${branch}€{FILE_PATH_EXT}#L€{FILE_LINE}"
},
"-doc-canonical-base-url",
- "https://pekko.aoache.org/api/pekko-grpc/current/"),
+ "https://pekko.apache.org/api/pekko-grpc/current/") ++ (
+ if (!isScala3.value) {
+ Seq(
+ "-skip-packages",
+ "org.apache.pekko.pattern:" + // for some reason Scaladoc creates
this
+ "templates")
+ } else {
+ Seq(
+ "-skip-packages:org.apache.pekko.pattern:" + // for some reason
Scaladoc creates this
+ "templates")
+ }),
Compile / doc / scalacOptions -= "-Xfatal-warnings",
apiURL := Some(
url(s"https://pekko.apache.org/api/pekko-grpc/${projectInfoVersion.value}/org/apache/pekko/grpc/index.html")),
(Test / testOptions) += Tests.Argument(TestFrameworks.ScalaTest, "-oDF"),
- crossScalaVersions := Seq(scala212, scala213),
+ crossScalaVersions := Seq(scala212, scala213, scala3),
mimaReportSignatureProblems := true)
override lazy val buildSettings = Seq(
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index dc23fb8c..5e17f268 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -17,17 +17,18 @@ object Dependencies {
object Versions {
val scala212 = "2.12.17"
val scala213 = "2.13.10"
+ val scala3 = "3.3.0"
// the order in the list is important because the head will be considered
the default.
- val CrossScalaForLib = Seq(scala212, scala213)
+ val CrossScalaForLib = Seq(scala212, scala213, scala3)
val CrossScalaForPlugin = Seq(scala212)
// We don't force Pekko updates because downstream projects can upgrade
// themselves. For more information see
//
https://pekko.apache.org//docs/pekko/current/project/downstream-upgrade-strategy.html
- val pekko = "0.0.0+26656-898c6970-SNAPSHOT"
+ val pekko = "0.0.0+26669-ec5b6764-SNAPSHOT"
val pekkoBinary = "current"
- val pekkoHttp = "0.0.0+4345-fa1cb9cb-SNAPSHOT"
+ val pekkoHttp = "0.0.0+4411-6fe04045-SNAPSHOT"
val pekkoHttpBinary = "current"
val grpc = "1.48.1" // checked synced by VersionSyncCheckPlugin
diff --git a/project/build.properties b/project/build.properties
index 46e43a97..72413de1 100644
--- a/project/build.properties
+++ b/project/build.properties
@@ -1 +1 @@
-sbt.version=1.8.2
+sbt.version=1.8.3
diff --git
a/runtime/src/main/scala/org/apache/pekko/grpc/internal/AbstractGrpcProtocol.scala
b/runtime/src/main/scala/org/apache/pekko/grpc/internal/AbstractGrpcProtocol.scala
index 1dc484f9..99472070 100644
---
a/runtime/src/main/scala/org/apache/pekko/grpc/internal/AbstractGrpcProtocol.scala
+++
b/runtime/src/main/scala/org/apache/pekko/grpc/internal/AbstractGrpcProtocol.scala
@@ -174,7 +174,7 @@ object AbstractGrpcProtocol {
}
}
- final case object Failed extends Step {
+ case object Failed extends Step {
override def parse(reader: ByteReader): ParseResult[Frame] =
ParseResult(None, Failed)
}
}
diff --git
a/runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcProtocolNative.scala
b/runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcProtocolNative.scala
index 361742c0..a5ca903d 100644
---
a/runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcProtocolNative.scala
+++
b/runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcProtocolNative.scala
@@ -47,7 +47,7 @@ object GrpcProtocolNative extends
AbstractGrpcProtocol("grpc") {
AbstractGrpcProtocol.reader(codec, decodeFrame)
@inline
- private def decodeFrame(@nowarn("cat=unused-params") frameType: Int, data:
ByteString) = DataFrame(data)
+ private def decodeFrame(@nowarn("msg=is never used") frameType: Int, data:
ByteString) = DataFrame(data)
@inline
private def encodeFrame(codec: Codec, frame: Frame): ChunkStreamPart =
diff --git
a/runtime/src/main/scala/org/apache/pekko/grpc/internal/MetadataImpl.scala
b/runtime/src/main/scala/org/apache/pekko/grpc/internal/MetadataImpl.scala
index 8b605784..61a7a84b 100644
--- a/runtime/src/main/scala/org/apache/pekko/grpc/internal/MetadataImpl.scala
+++ b/runtime/src/main/scala/org/apache/pekko/grpc/internal/MetadataImpl.scala
@@ -126,7 +126,7 @@ class GrpcMetadataImpl(delegate: io.grpc.Metadata) extends
Metadata {
if (key.endsWith(io.grpc.Metadata.BINARY_HEADER_SUFFIX)) {
delegate.getAll(binaryKey(key)).asScala.map(b =>
BytesEntry(ByteString.fromArray(b))).toList
} else {
- delegate.getAll(textKey(key)).asScala.map(StringEntry).toList
+ delegate.getAll(textKey(key)).asScala.map(StringEntry.apply).toList
}
}
diff --git
a/runtime/src/main/scala/org/apache/pekko/grpc/internal/PekkoNettyGrpcClientGraphStage.scala
b/runtime/src/main/scala/org/apache/pekko/grpc/internal/PekkoNettyGrpcClientGraphStage.scala
index 3f531da5..bdde0b5b 100644
---
a/runtime/src/main/scala/org/apache/pekko/grpc/internal/PekkoNettyGrpcClientGraphStage.scala
+++
b/runtime/src/main/scala/org/apache/pekko/grpc/internal/PekkoNettyGrpcClientGraphStage.scala
@@ -107,7 +107,7 @@ private final class PekkoNettyGrpcClientGraphStage[I, O](
.map(MetadataImpl.javaMetadataFromGoogleGrpcMetadata)(ExecutionContexts.parasitic)
.asJava
def trailers = sTrailers
- def getTrailers = jTrailers
+ def getTrailers() = jTrailers
})
override def onMessage(message: O): Unit =
callback.invoke(message)
diff --git
a/runtime/src/main/scala/org/apache/pekko/grpc/internal/RequestBuilderImpl.scala
b/runtime/src/main/scala/org/apache/pekko/grpc/internal/RequestBuilderImpl.scala
index 8103f41c..d2def109 100644
---
a/runtime/src/main/scala/org/apache/pekko/grpc/internal/RequestBuilderImpl.scala
+++
b/runtime/src/main/scala/org/apache/pekko/grpc/internal/RequestBuilderImpl.scala
@@ -153,7 +153,7 @@ final class ScalaClientStreamingRequestBuilder[I, O](
def headers = metadata.headers
def getHeaders() = metadata.getHeaders()
def trailers = metadata.trailers
- def getTrailers = metadata.getTrailers()
+ def getTrailers() = metadata.getTrailers()
}
}(ExecutionContexts.parasitic)
}
diff --git
a/runtime/src/main/scala/org/apache/pekko/grpc/javadsl/GrpcMarshalling.scala
b/runtime/src/main/scala/org/apache/pekko/grpc/javadsl/GrpcMarshalling.scala
index 16573cac..8fc5868d 100644
--- a/runtime/src/main/scala/org/apache/pekko/grpc/javadsl/GrpcMarshalling.scala
+++ b/runtime/src/main/scala/org/apache/pekko/grpc/javadsl/GrpcMarshalling.scala
@@ -59,7 +59,7 @@ object GrpcMarshalling {
def unmarshalStream[T](
data: Source[ByteString, AnyRef],
u: ProtobufSerializer[T],
- @nowarn("cat=unused-params") mat: Materializer,
+ @nowarn("msg=is never used") mat: Materializer,
reader: GrpcProtocolReader): CompletionStage[Source[T, NotUsed]] = {
CompletableFuture.completedFuture[Source[T, NotUsed]](
data
diff --git a/runtime/src/main/scala/org/apache/pekko/grpc/scaladsl/Grpc.scala
b/runtime/src/main/scala/org/apache/pekko/grpc/scaladsl/Grpc.scala
index c62ee12d..05bb1e7f 100644
--- a/runtime/src/main/scala/org/apache/pekko/grpc/scaladsl/Grpc.scala
+++ b/runtime/src/main/scala/org/apache/pekko/grpc/scaladsl/Grpc.scala
@@ -13,7 +13,7 @@
package org.apache.pekko.grpc.scaladsl
-import scala.concurrent.Future
+import scala.concurrent.{ ExecutionContext, Future }
import scala.jdk.CollectionConverters._
import org.apache.pekko
@@ -22,7 +22,7 @@ import pekko.actor.{ CoordinatedShutdown,
ExtendedActorSystem, Extension, Extens
import pekko.annotation.InternalApi
import java.util.concurrent.ConcurrentHashMap
-import pekko.event.Logging
+import pekko.event.{ LogSource, Logging }
import pekko.grpc.GrpcChannel
/** INTERNAL API */
@@ -31,7 +31,7 @@ private[grpc] final class GrpcImpl(system:
ExtendedActorSystem) extends Extensio
private val channels = new ConcurrentHashMap[GrpcChannel, Unit]
CoordinatedShutdown(system).addTask("before-actor-system-terminate",
"close-grpc-channels") { () =>
- implicit val ec = system.dispatcher
+ implicit val ec: ExecutionContext = system.dispatcher
Future
.sequence(
channels
@@ -40,7 +40,7 @@ private[grpc] final class GrpcImpl(system:
ExtendedActorSystem) extends Extensio
.map(channel =>
channel.close().recover {
case e =>
- val log = Logging(system, getClass)
+ val log = Logging(system, getClass)(LogSource.fromClass)
log.warning("Failed to gracefully close {}, proceeding with
shutdown anyway. {}", channel, e)
Done
}))
diff --git
a/runtime/src/main/scala/org/apache/pekko/grpc/scaladsl/GrpcMarshalling.scala
b/runtime/src/main/scala/org/apache/pekko/grpc/scaladsl/GrpcMarshalling.scala
index 5510432d..ec5ff3d2 100644
---
a/runtime/src/main/scala/org/apache/pekko/grpc/scaladsl/GrpcMarshalling.scala
+++
b/runtime/src/main/scala/org/apache/pekko/grpc/scaladsl/GrpcMarshalling.scala
@@ -73,7 +73,7 @@ object GrpcMarshalling {
def unmarshalStream[T](data: Source[ByteString, Any])(
implicit u: ProtobufSerializer[T],
- @nowarn("cat=unused-params") mat: Materializer,
+ @nowarn("msg=is never used") mat: Materializer,
reader: GrpcProtocolReader): Future[Source[T, NotUsed]] = {
Future.successful(
data
diff --git
a/runtime/src/test/scala/docs/org/apache/pekko/grpc/client/GrpcClientSettingsCompileOnly.scala
b/runtime/src/test/scala/docs/org/apache/pekko/grpc/client/GrpcClientSettingsCompileOnly.scala
index 280b6812..7135d3dd 100644
---
a/runtime/src/test/scala/docs/org/apache/pekko/grpc/client/GrpcClientSettingsCompileOnly.scala
+++
b/runtime/src/test/scala/docs/org/apache/pekko/grpc/client/GrpcClientSettingsCompileOnly.scala
@@ -21,7 +21,7 @@ import pekko.grpc.GrpcClientSettings
import scala.concurrent.duration._
object GrpcClientSettingsCompileOnly {
- implicit val actorSystem = ActorSystem()
+ implicit val actorSystem: ActorSystem = ActorSystem()
// #simple
GrpcClientSettings.connectToServiceAt("localhost", 443)
// #simple
diff --git
a/runtime/src/test/scala/org/apache/pekko/grpc/GrpcClientSettingsSpec.scala
b/runtime/src/test/scala/org/apache/pekko/grpc/GrpcClientSettingsSpec.scala
index 281cda67..0a080177 100644
--- a/runtime/src/test/scala/org/apache/pekko/grpc/GrpcClientSettingsSpec.scala
+++ b/runtime/src/test/scala/org/apache/pekko/grpc/GrpcClientSettingsSpec.scala
@@ -77,7 +77,7 @@ class GrpcClientSettingsSpec extends AnyWordSpec with
Matchers with ScalaFutures
}
""")
- implicit val sys = ActorSystem(
+ implicit val sys: ActorSystem = ActorSystem(
"test",
ConfigFactory
.parseString("""
diff --git
a/runtime/src/test/scala/org/apache/pekko/grpc/internal/MetadataImplSpec.scala
b/runtime/src/test/scala/org/apache/pekko/grpc/internal/MetadataImplSpec.scala
index 6e6b0b38..be933c36 100644
---
a/runtime/src/test/scala/org/apache/pekko/grpc/internal/MetadataImplSpec.scala
+++
b/runtime/src/test/scala/org/apache/pekko/grpc/internal/MetadataImplSpec.scala
@@ -109,14 +109,14 @@ class MetadataImplSpec extends AnyWordSpec with Matchers
with ScalaFutures {
"return a list with repeated entries in correct order" in {
val list = m.asList
- list.collect { case (k, v) if k == DUPE_TEXT_KEY => v } shouldEqual
DUPE_TEXT_VALUES.map(StringEntry)
- list.collect { case (k, v) if k == DUPE_BINARY_KEY => v } shouldEqual
DUPE_BINARY_VALUES.map(BytesEntry)
+ list.collect { case (k, v) if k == DUPE_TEXT_KEY => v } shouldEqual
DUPE_TEXT_VALUES.map(StringEntry.apply)
+ list.collect { case (k, v) if k == DUPE_BINARY_KEY => v } shouldEqual
DUPE_BINARY_VALUES.map(BytesEntry.apply)
}
"return a map repeated entries in correct order" in {
val map = m.asMap
- map(DUPE_TEXT_KEY) shouldEqual DUPE_TEXT_VALUES.map(StringEntry)
- map(DUPE_BINARY_KEY) shouldEqual DUPE_BINARY_VALUES.map(BytesEntry)
+ map(DUPE_TEXT_KEY) shouldEqual DUPE_TEXT_VALUES.map(StringEntry.apply)
+ map(DUPE_BINARY_KEY) shouldEqual DUPE_BINARY_VALUES.map(BytesEntry.apply)
}
}
diff --git
a/runtime/src/test/scala/org/apache/pekko/grpc/internal/NettyClientUtilsSpec.scala
b/runtime/src/test/scala/org/apache/pekko/grpc/internal/NettyClientUtilsSpec.scala
index 13ec9ccc..c6fe2a27 100644
---
a/runtime/src/test/scala/org/apache/pekko/grpc/internal/NettyClientUtilsSpec.scala
+++
b/runtime/src/test/scala/org/apache/pekko/grpc/internal/NettyClientUtilsSpec.scala
@@ -21,7 +21,7 @@ import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
class NettyClientUtilsSpec extends AnyWordSpec with Matchers with ScalaFutures
with BeforeAndAfterAll {
- implicit val system = ActorSystem(
+ implicit val system: ActorSystem = ActorSystem(
"test",
ConfigFactory
.parseString("""
diff --git
a/runtime/src/test/scala/org/apache/pekko/grpc/internal/PekkoDiscoveryNameResolverSpec.scala
b/runtime/src/test/scala/org/apache/pekko/grpc/internal/PekkoDiscoveryNameResolverSpec.scala
index 74639046..dffed656 100644
---
a/runtime/src/test/scala/org/apache/pekko/grpc/internal/PekkoDiscoveryNameResolverSpec.scala
+++
b/runtime/src/test/scala/org/apache/pekko/grpc/internal/PekkoDiscoveryNameResolverSpec.scala
@@ -26,14 +26,15 @@ import org.scalatest.time.{ Millis, Seconds, Span }
import org.scalatest.wordspec.AnyWordSpecLike
import scala.collection.JavaConverters._
+import scala.concurrent.ExecutionContext
class PekkoDiscoveryNameResolverSpec
extends TestKit(ActorSystem())
with AnyWordSpecLike
with Matchers
with ScalaFutures {
- implicit val ex = system.dispatcher
- implicit override val patienceConfig =
+ implicit val ex: ExecutionContext = system.dispatcher
+ implicit override val patienceConfig: PatienceConfig =
PatienceConfig(timeout = scaled(Span(2, Seconds)), interval =
scaled(Span(5, Millis)))
"The PekkoDiscovery-backed NameResolver" should {
diff --git
a/runtime/src/test/scala/org/apache/pekko/grpc/internal/PekkoHttpClientUtilsSpec.scala
b/runtime/src/test/scala/org/apache/pekko/grpc/internal/PekkoHttpClientUtilsSpec.scala
index 9d5a78b5..9bcc3768 100644
---
a/runtime/src/test/scala/org/apache/pekko/grpc/internal/PekkoHttpClientUtilsSpec.scala
+++
b/runtime/src/test/scala/org/apache/pekko/grpc/internal/PekkoHttpClientUtilsSpec.scala
@@ -13,7 +13,7 @@
package org.apache.pekko.grpc.internal
-import scala.concurrent.Future
+import scala.concurrent.{ ExecutionContext, Future }
import scala.concurrent.duration._
import org.apache.pekko
@@ -31,7 +31,7 @@ import org.scalatest.time.Span
import org.scalatest.wordspec.AnyWordSpecLike
class PekkoHttpClientUtilsSpec extends TestKit(ActorSystem()) with
AnyWordSpecLike with Matchers with ScalaFutures {
- implicit val ec = system.dispatcher
+ implicit val ec: ExecutionContext = system.dispatcher
implicit val patience: PatienceConfig =
PatienceConfig(5.seconds, Span(100, org.scalatest.time.Millis))
diff --git
a/runtime/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcExceptionHandlerSpec.scala
b/runtime/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcExceptionHandlerSpec.scala
index c1cd0271..83e5d335 100644
---
a/runtime/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcExceptionHandlerSpec.scala
+++
b/runtime/src/test/scala/org/apache/pekko/grpc/scaladsl/GrpcExceptionHandlerSpec.scala
@@ -15,7 +15,7 @@ package org.apache.pekko.grpc.scaladsl
import org.apache.pekko
import pekko.actor.ActorSystem
-import pekko.grpc.GrpcServiceException
+import pekko.grpc.{ GrpcProtocol, GrpcServiceException }
import pekko.grpc.internal.{ GrpcProtocolNative, GrpcResponseHelpers, Identity
}
import pekko.grpc.scaladsl.GrpcExceptionHandler.defaultMapper
import pekko.http.scaladsl.model.HttpEntity._
@@ -30,10 +30,10 @@ import org.scalatest.wordspec.AnyWordSpec
import scala.concurrent.{ ExecutionException, Future }
class GrpcExceptionHandlerSpec extends AnyWordSpec with Matchers with
ScalaFutures with BeforeAndAfterAll {
- implicit val system = ActorSystem("Test")
- implicit override val patienceConfig =
+ implicit val system: ActorSystem = ActorSystem("Test")
+ implicit override val patienceConfig: PatienceConfig =
PatienceConfig(timeout = scaled(Span(2, Seconds)), interval =
scaled(Span(5, Millis)))
- implicit val writer = GrpcProtocolNative.newWriter(Identity)
+ implicit val writer: GrpcProtocol.GrpcProtocolWriter =
GrpcProtocolNative.newWriter(Identity)
val expected: Function[Throwable, Status] = {
case e: ExecutionException =>
diff --git
a/runtime/src/test/scala/org/apache/pekko/grpc/scaladsl/MetadataBuilderSpec.scala
b/runtime/src/test/scala/org/apache/pekko/grpc/scaladsl/MetadataBuilderSpec.scala
index a9a1d545..6e8b4974 100644
---
a/runtime/src/test/scala/org/apache/pekko/grpc/scaladsl/MetadataBuilderSpec.scala
+++
b/runtime/src/test/scala/org/apache/pekko/grpc/scaladsl/MetadataBuilderSpec.scala
@@ -45,7 +45,7 @@ class MetadataBuilderSpec extends AnyWordSpec with Matchers {
m.getText(DUPE_TEXT_KEY) shouldBe Some(DUPE_TEXT_VALUES.last)
- val dupeEntries = DUPE_TEXT_VALUES.map(StringEntry)
+ val dupeEntries = DUPE_TEXT_VALUES.map(StringEntry.apply)
m.asMap(DUPE_TEXT_KEY) shouldBe dupeEntries
m.asList.collect {
case (k, e) if k == DUPE_TEXT_KEY => e
@@ -79,7 +79,7 @@ class MetadataBuilderSpec extends AnyWordSpec with Matchers {
m.getBinary(DUPE_BINARY_KEY) shouldBe Some(DUPE_BINARY_VALUES.last)
- val dupeEntries = DUPE_BINARY_VALUES.map(BytesEntry)
+ val dupeEntries = DUPE_BINARY_VALUES.map(BytesEntry.apply)
m.asMap(DUPE_BINARY_KEY) shouldBe dupeEntries
m.asList.collect {
case (k, e) if k == DUPE_BINARY_KEY => e
diff --git
a/sbt-plugin/src/main/scala/org/apache/pekko/grpc/sbt/PekkoGrpcPlugin.scala
b/sbt-plugin/src/main/scala/org/apache/pekko/grpc/sbt/PekkoGrpcPlugin.scala
index 6533c0df..0a473813 100644
--- a/sbt-plugin/src/main/scala/org/apache/pekko/grpc/sbt/PekkoGrpcPlugin.scala
+++ b/sbt-plugin/src/main/scala/org/apache/pekko/grpc/sbt/PekkoGrpcPlugin.scala
@@ -97,7 +97,8 @@ object PekkoGrpcPlugin extends AutoPlugin {
libraryDependencies ++= {
if (pekkoGrpcGeneratedLanguages.value.contains(PekkoGrpc.Scala))
// Make scalapb.proto available for import in user-defined protos
for file and package-level options
- Seq("com.thesamet.scalapb" %% "scalapb-runtime" %
scalapb.compiler.Version.scalapbVersion % "protobuf")
+ Seq(
+ "com.thesamet.scalapb" %% "scalapb-runtime" %
scalapb.compiler.Version.scalapbVersion % "protobuf")
else Seq()
},
Compile / PB.recompile := {
@@ -126,9 +127,9 @@ object PekkoGrpcPlugin extends AutoPlugin {
generatorsFor(
pekkoGrpcGeneratedSources.value,
pekkoGrpcGeneratedLanguages.value,
- generatorScalaBinaryVersion.value,
+ ScalaBinaryVersion(scalaBinaryVersion.value),
generatorLogger) ++ pekkoGrpcExtraGenerators.value.map(g =>
- GeneratorBridge.plainGenerator(g,
generatorScalaBinaryVersion.value, generatorLogger))
+ GeneratorBridge.plainGenerator(g,
ScalaBinaryVersion(scalaBinaryVersion.value), generatorLogger))
},
// configure the proto gen automatically by adding our codegen:
PB.targets ++=
@@ -208,26 +209,16 @@ object PekkoGrpcPlugin extends AutoPlugin {
else generators
}
- // workaround to allow using Scala 2.13 artifacts in Scala 3 projects
- def generatorScalaBinaryVersion: Def.Initialize[ScalaBinaryVersion] =
Def.setting {
- ScalaBinaryVersion {
- CrossVersion.partialVersion(scalaVersion.value) match {
- case Some((3, _)) => "2.13"
- case _ => scalaBinaryVersion.value
- }
- }
- }
-
/** Sandbox a CodeGenerator, to prepare it to be added to
pekkoGrpcGenerators */
def sandboxedGenerator(
codeGenerator: pekko.grpc.gen.CodeGenerator):
Def.Initialize[protocbridge.Generator] =
Def.setting {
- GeneratorBridge.sandboxedGenerator(codeGenerator,
generatorScalaBinaryVersion.value, generatorLogger)
+ GeneratorBridge.sandboxedGenerator(codeGenerator,
ScalaBinaryVersion(scalaBinaryVersion.value), generatorLogger)
}
/** Convert a CodeGenerator, to prepare it to be added to
pekkoGrpcGenerators without sandboxing */
def plainGenerator(codeGenerator: pekko.grpc.gen.CodeGenerator):
Def.Initialize[protocbridge.Generator] =
Def.setting {
- GeneratorBridge.plainGenerator(codeGenerator,
generatorScalaBinaryVersion.value, generatorLogger)
+ GeneratorBridge.plainGenerator(codeGenerator,
ScalaBinaryVersion(scalaBinaryVersion.value), generatorLogger)
}
}
diff --git
a/sbt-plugin/src/sbt-test/gen-java/01-gen-basic-java/project/build.properties
b/sbt-plugin/src/sbt-test/gen-java/01-gen-basic-java/project/build.properties
new file mode 100644
index 00000000..72413de1
--- /dev/null
+++
b/sbt-plugin/src/sbt-test/gen-java/01-gen-basic-java/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.8.3
diff --git
a/sbt-plugin/src/sbt-test/gen-java/02-server-reflection/project/build.properties
b/sbt-plugin/src/sbt-test/gen-java/02-server-reflection/project/build.properties
index 10fd9eee..72413de1 100644
---
a/sbt-plugin/src/sbt-test/gen-java/02-server-reflection/project/build.properties
+++
b/sbt-plugin/src/sbt-test/gen-java/02-server-reflection/project/build.properties
@@ -1 +1 @@
-sbt.version=1.5.5
+sbt.version=1.8.3
diff --git
a/sbt-plugin/src/sbt-test/gen-java/03-no-java-package/project/build.properties
b/sbt-plugin/src/sbt-test/gen-java/03-no-java-package/project/build.properties
new file mode 100644
index 00000000..72413de1
--- /dev/null
+++
b/sbt-plugin/src/sbt-test/gen-java/03-no-java-package/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.8.3
diff --git
a/sbt-plugin/src/sbt-test/gen-java/04-crash-on-keywords/project/build.properties
b/sbt-plugin/src/sbt-test/gen-java/04-crash-on-keywords/project/build.properties
new file mode 100644
index 00000000..72413de1
--- /dev/null
+++
b/sbt-plugin/src/sbt-test/gen-java/04-crash-on-keywords/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.8.3
diff --git
a/sbt-plugin/src/sbt-test/gen-java/05-duplicate-messages-different-packages/project/build.properties
b/sbt-plugin/src/sbt-test/gen-java/05-duplicate-messages-different-packages/project/build.properties
new file mode 100644
index 00000000..72413de1
--- /dev/null
+++
b/sbt-plugin/src/sbt-test/gen-java/05-duplicate-messages-different-packages/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.8.3
diff --git
a/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/project/build.properties
b/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/project/build.properties
new file mode 100644
index 00000000..72413de1
--- /dev/null
+++
b/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.8.3
diff --git
a/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/src/test/scala/org/apache/pekko/grpc/GrpcInteropSpec.scala
b/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/src/test/scala/org/apache/pekko/grpc/GrpcInteropSpec.scala
index eb2649e3..8eac02df 100644
---
a/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/src/test/scala/org/apache/pekko/grpc/GrpcInteropSpec.scala
+++
b/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/src/test/scala/org/apache/pekko/grpc/GrpcInteropSpec.scala
@@ -11,6 +11,7 @@ import io.grpc.testing.integration.TestServiceHandlerFactory
import io.grpc.testing.integration.test.TestService
import scala.collection.immutable
+import scala.concurrent.ExecutionContext
// Generated by our plugin
import io.grpc.testing.integration.test.TestServiceHandler
@@ -32,7 +33,7 @@ object PekkoHttpServerProviderScala extends
PekkoHttpServerProvider {
val pendingCases = Set()
val server = PekkoGrpcServerScala(implicit sys => {
- implicit val ec = sys.dispatcher
+ implicit val ec: ExecutionContext = sys.dispatcher
val requestHandler = TestServiceHandler(new TestServiceImpl())
diff --git
a/sbt-plugin/src/sbt-test/gen-scala-server/01-gen-basic-server/project/build.properties
b/sbt-plugin/src/sbt-test/gen-scala-server/01-gen-basic-server/project/build.properties
new file mode 100644
index 00000000..72413de1
--- /dev/null
+++
b/sbt-plugin/src/sbt-test/gen-scala-server/01-gen-basic-server/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.8.3
diff --git
a/sbt-plugin/src/sbt-test/gen-scala-server/02-multiple-services/project/build.properties
b/sbt-plugin/src/sbt-test/gen-scala-server/02-multiple-services/project/build.properties
new file mode 100644
index 00000000..72413de1
--- /dev/null
+++
b/sbt-plugin/src/sbt-test/gen-scala-server/02-multiple-services/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.8.3
diff --git
a/sbt-plugin/src/sbt-test/gen-scala-server/03-test-config/project/build.properties
b/sbt-plugin/src/sbt-test/gen-scala-server/03-test-config/project/build.properties
new file mode 100644
index 00000000..72413de1
--- /dev/null
+++
b/sbt-plugin/src/sbt-test/gen-scala-server/03-test-config/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.8.3
diff --git
a/sbt-plugin/src/sbt-test/gen-scala-server/04-server-reflection/project/build.properties
b/sbt-plugin/src/sbt-test/gen-scala-server/04-server-reflection/project/build.properties
new file mode 100644
index 00000000..72413de1
--- /dev/null
+++
b/sbt-plugin/src/sbt-test/gen-scala-server/04-server-reflection/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.8.3
diff --git
a/sbt-plugin/src/sbt-test/gen-scala-server/05-no-java-package/project/build.properties
b/sbt-plugin/src/sbt-test/gen-scala-server/05-no-java-package/project/build.properties
new file mode 100644
index 00000000..72413de1
--- /dev/null
+++
b/sbt-plugin/src/sbt-test/gen-scala-server/05-no-java-package/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.8.3
diff --git
a/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/project/build.properties
b/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/project/build.properties
new file mode 100644
index 00000000..72413de1
--- /dev/null
+++
b/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.8.3
diff --git
a/sbt-plugin/src/sbt-test/gen-scala-server/07-gen-basic-server-with-pekko/project/build.properties
b/sbt-plugin/src/sbt-test/gen-scala-server/07-gen-basic-server-with-pekko/project/build.properties
new file mode 100644
index 00000000..72413de1
--- /dev/null
+++
b/sbt-plugin/src/sbt-test/gen-scala-server/07-gen-basic-server-with-pekko/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.8.3
diff --git
a/sbt-plugin/src/sbt-test/gen-scala-server/09-scalapb-customizations/project/build.properties
b/sbt-plugin/src/sbt-test/gen-scala-server/09-scalapb-customizations/project/build.properties
new file mode 100644
index 00000000..72413de1
--- /dev/null
+++
b/sbt-plugin/src/sbt-test/gen-scala-server/09-scalapb-customizations/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.8.3
diff --git
a/sbt-plugin/src/sbt-test/gen-scala-server/10-scalapb-validate/project/build.properties
b/sbt-plugin/src/sbt-test/gen-scala-server/10-scalapb-validate/project/build.properties
new file mode 100644
index 00000000..72413de1
--- /dev/null
+++
b/sbt-plugin/src/sbt-test/gen-scala-server/10-scalapb-validate/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.8.3
diff --git
a/sbt-plugin/src/sbt-test/gen-scala-server/11-duplicate-messages-different-packages/project/build.properties
b/sbt-plugin/src/sbt-test/gen-scala-server/11-duplicate-messages-different-packages/project/build.properties
new file mode 100644
index 00000000..72413de1
--- /dev/null
+++
b/sbt-plugin/src/sbt-test/gen-scala-server/11-duplicate-messages-different-packages/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.8.3
diff --git a/sbt-plugin/src/sbt-test/scala3/01-basic-client-server/build.sbt
b/sbt-plugin/src/sbt-test/scala3/01-basic-client-server/build.sbt
index 5cec9709..9fb23a47 100644
--- a/sbt-plugin/src/sbt-test/scala3/01-basic-client-server/build.sbt
+++ b/sbt-plugin/src/sbt-test/scala3/01-basic-client-server/build.sbt
@@ -1,4 +1,4 @@
-scalaVersion := "3.1.0"
+scalaVersion := "3.3.0"
resolvers += "Apache
Snapshots".at("https://repository.apache.org/content/repositories/snapshots/")
diff --git
a/sbt-plugin/src/sbt-test/scala3/01-basic-client-server/project/build.properties
b/sbt-plugin/src/sbt-test/scala3/01-basic-client-server/project/build.properties
index 9edb75b7..72413de1 100644
---
a/sbt-plugin/src/sbt-test/scala3/01-basic-client-server/project/build.properties
+++
b/sbt-plugin/src/sbt-test/scala3/01-basic-client-server/project/build.properties
@@ -1 +1 @@
-sbt.version=1.5.4
+sbt.version=1.8.3
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]