Skip to content

Commit

Permalink
fix: gradle plugin was missing scalaPB generated files from library p…
Browse files Browse the repository at this point in the history
…rotos
  • Loading branch information
GreyPlane committed Feb 19, 2024
1 parent 1d1d772 commit 63bf370
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 488 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ class AkkaGrpcPlugin implements Plugin<Project> {
// Play conventions:
srcDir 'app/protobuf'
srcDir 'app/proto'
if (akkaGrpcExt.scala) {
// TODO inject this into scalapb-protoc' option, also make sure generated scalapb proto file not depends on java proto file
// library protos
srcDir 'build/extracted-include-protos/main'
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions plugin-tester-scala/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def akkaHttpVersion = "10.6.0"
dependencies {
implementation group: 'ch.megard', name: "akka-http-cors_${scalaBinaryVersion}", version: '1.1.3'
implementation "com.typesafe.akka:akka-pki_${scalaBinaryVersion}:${akkaVersion}"
implementation "com.typesafe.akka:akka-actor-typed_${scalaBinaryVersion}:${akkaVersion}"
testImplementation "com.typesafe.akka:akka-stream-testkit_${scalaBinaryVersion}:${akkaVersion}"
testImplementation "com.typesafe.akka:akka-actor-testkit-typed_${scalaBinaryVersion}:${akkaVersion}"
testImplementation "org.scalatest:scalatest_${scalaBinaryVersion}:3.2.12"
Expand Down
2 changes: 2 additions & 0 deletions plugin-tester-scala/src/main/proto/shelf.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
syntax = "proto3";

//#import-external-proto-files
import "google/api/annotations.proto";
//#import-external-proto-files

option java_multiple_files = true;
option java_package = "example.myapp.shelf.grpc";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.unmarshalling.Unmarshal
import example.myapp.shelf.ShelfServer
import example.myapp.shelf.grpc._
import org.junit.runner.RunWith
import org.scalatest.BeforeAndAfterAll
import org.scalatest.wordspec.AnyWordSpecLike
import org.scalatestplus.junit.JUnitRunner
import spray.json.DefaultJsonProtocol._
import spray.json._

import scala.concurrent.ExecutionContextExecutor

@RunWith(classOf[JUnitRunner])
class ShelfServiceHttpTranscodingSpec
extends ScalaTestWithActorTestKit(config = "akka.http.server.enable-http2 = on")
with AnyWordSpecLike
Expand Down
5 changes: 4 additions & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ object Dependencies {
val akkaHttpBinary = "10.6"

val grpc = "1.60.0" // checked synced by VersionSyncCheckPlugin
val grpcGoogleProto = "2.22.0"

// Even referenced explicitly in the sbt-plugin's sbt-tests
// If changing this, remember to update protoc plugin version to align in
Expand Down Expand Up @@ -108,13 +109,15 @@ object Dependencies {
Compile.scalapbCompilerPlugin,
Protobuf.protobufJava, // or else scalapb pulls older version in transitively
Compile.grpcProtobuf,
GrpcApi.googleApiProtos,
Test.scalaTest)

val runtime = l ++= Seq(
Compile.scalapbRuntime,
Compile.scalapbRuntime % "protobuf",
Protobuf.protobufJava, // or else scalapb pulls older version in transitively
Protobuf.protobufJavaUtil,
Protobuf.googleCommonProtos,
GrpcApi.googleApiProtos.intransitive(),
Compile.grpcProtobuf,
Compile.grpcCore,
Compile.grpcStub % "provided", // comes from the generators
Expand Down
32 changes: 0 additions & 32 deletions runtime/src/main/protobuf/google/api/annotations.proto

This file was deleted.

Loading

0 comments on commit 63bf370

Please sign in to comment.