diff --git a/grpc-example/grpc-example-scala/build.sbt b/grpc-example/grpc-example-scala/build.sbt index 53933fac..cbafb540 100644 --- a/grpc-example/grpc-example-scala/build.sbt +++ b/grpc-example/grpc-example-scala/build.sbt @@ -27,29 +27,32 @@ lazy val `lagom-scala-grpc-example` = (project in file(".")) .aggregate(`hello-api`, `hello-impl`, `hello-proxy-api`, `hello-proxy-impl`) lazy val `hello-api` = (project in file("hello-api")) - .settings( - libraryDependencies += lagomScaladslApi - ) + .enablePlugins(AkkaGrpcPlugin) // enables source generation for gRPC + .enablePlugins(PlayAkkaHttp2Support) // enables serving HTTP/2 and gRPC + .settings( + akkaGrpcGeneratedLanguages := Seq(AkkaGrpc.Scala), + akkaGrpcExtraGenerators := Seq(PlayScalaClientCodeGenerator, PlayScalaServerCodeGenerator), + akkaGrpcGeneratedSources := + Seq( + AkkaGrpc.Server, + AkkaGrpc.Client // the client is only used in tests. See https://github.com/akka/akka-grpc/issues/410 + ), + ) + .settings( + libraryDependencies ++= Seq( + lagomScaladslApi, + playGrpcRuntime, + ) + ) lazy val `hello-impl` = (project in file("hello-impl")) .enablePlugins(LagomScala) - .enablePlugins(AkkaGrpcPlugin) // enables source generation for gRPC - .enablePlugins(PlayAkkaHttp2Support) // enables serving HTTP/2 and gRPC .settings( - akkaGrpcGeneratedLanguages := Seq(AkkaGrpc.Scala), - akkaGrpcGeneratedSources := - Seq( - AkkaGrpc.Server, - AkkaGrpc.Client // the client is only used in tests. See https://github.com/akka/akka-grpc/issues/410 - ), - akkaGrpcExtraGenerators in Compile += PlayScalaServerCodeGenerator, - ).settings( workaroundSettings:_* ).settings( libraryDependencies ++= Seq( lagomScaladslTestKit, macwire, - playGrpcRuntime, scalaTest, lagomGrpcTestkit ) @@ -63,11 +66,7 @@ lazy val `hello-proxy-api` = (project in file("hello-proxy-api")) lazy val `hello-proxy-impl` = (project in file("hello-proxy-impl")) .enablePlugins(LagomScala) - .enablePlugins(AkkaGrpcPlugin) // enables source generation for gRPC .settings( - akkaGrpcGeneratedLanguages := Seq(AkkaGrpc.Scala), - akkaGrpcExtraGenerators += PlayScalaClientCodeGenerator, - ).settings( libraryDependencies ++= Seq( lagomScaladslTestKit, macwire, diff --git a/grpc-example/grpc-example-scala/hello-impl/src/main/protobuf/helloworld.proto b/grpc-example/grpc-example-scala/hello-api/src/main/protobuf/helloworld.proto similarity index 100% rename from grpc-example/grpc-example-scala/hello-impl/src/main/protobuf/helloworld.proto rename to grpc-example/grpc-example-scala/hello-api/src/main/protobuf/helloworld.proto diff --git a/grpc-example/grpc-example-scala/hello-proxy-impl/src/main/protobuf/helloworld.proto b/grpc-example/grpc-example-scala/hello-proxy-impl/src/main/protobuf/helloworld.proto deleted file mode 100644 index e57f1438..00000000 --- a/grpc-example/grpc-example-scala/hello-proxy-impl/src/main/protobuf/helloworld.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "example.myapp.helloworld.grpc"; -option java_outer_classname = "HelloWorldProto"; - -package helloworld; - -service GreeterService { - rpc SayHello (HelloRequest) returns (HelloReply) {} -} - -message HelloRequest { - string name = 1; -} - -message HelloReply { - string message = 1; -}