Skip to content

Commit

Permalink
test also non-repeated native plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
github-brice-jaglin authored and thesamet committed Jan 31, 2021
1 parent 7358022 commit 15427fa
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/sbt-test/settings/native/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Compile / PB.targets := Seq(
PB.gens.java -> (Compile / sourceManaged).value,
PB.gens.plugin("grpc-java") -> (Compile / sourceManaged).value,
(
PB.gens.plugin("scala"),
Seq()
Expand All @@ -13,6 +15,11 @@ val scalapbcClassifier =
if (protocbridge.SystemDetector.detectedClassifier().startsWith("windows")) "windows"
else "unix"

libraryDependencies += "javax.annotation" % "javax.annotation-api" % "1.3.2"
libraryDependencies += "io.grpc" % "grpc-stub" % "1.35.0"
libraryDependencies += "io.grpc" % "grpc-protobuf" % "1.35.0"
libraryDependencies += "io.grpc" % "protoc-gen-grpc-java" % "1.35.0" asProtocPlugin ()

libraryDependencies += "com.thesamet.scalapb" %% "scalapb-runtime" % "0.10.10"
libraryDependencies += "com.thesamet.scalapb" % "protoc-gen-scala" % "0.10.10" % "protobuf" artifacts (
Artifact(
Expand Down
27 changes: 27 additions & 0 deletions src/sbt-test/settings/native/src/main/protobuf/helloworld.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
syntax = "proto3";

option java_package = "example.myapp.helloworld.grpc";

package helloworld;

// The greeting service definition.
service GreeterService {
// Sends a greeting
rpc SayHello (HelloRequest) returns (HelloReply) {}

rpc ItKeepsTalking (stream HelloRequest) returns (HelloReply) {}

rpc ItKeepsReplying (HelloRequest) returns (stream HelloReply) {}

rpc StreamHellos (stream HelloRequest) returns (stream HelloReply) {}
}

// The request message containing the user's name.
message HelloRequest {
string name = 1;
}

// The response message containing the greetings
message HelloReply {
string message = 1;
}
3 changes: 3 additions & 0 deletions src/sbt-test/settings/native/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
> compile

$ exists target/scala-2.12/src_managed/main/example/myapp/helloworld/grpc/Helloworld.java
$ exists target/scala-2.12/src_managed/main/example/myapp/helloworld/grpc/GreeterServiceGrpc.java

$ exists target/scala-2.12/src_managed/main/test/test1/Test1Proto.scala
$ exists target/scala-2.12/src_managed/main/test/test1/msg.scala
$ exists target/scala-2.12/src_managed/main/test/Test1Proto.scala
Expand Down

0 comments on commit 15427fa

Please sign in to comment.