如何在.proto文件中导入firestore的RPC api /定义?

时间:2018-12-03 09:34:43

标签: scala sbt google-cloud-firestore scalapb akka-grpc

使用Scala应用程序与Firestore的RPC api进行交互,并使用scalapb proto编译器/ akka-grpc中间件,如何在.proto文件中导入firestore的RPC API定义?例如。如何导入Document定义?

简单地说import "google.firestore.v1beta1.Document";会出错。

1 个答案:

答案 0 :(得分:0)

  

看看   https://github.com/thesamet/sbt-protoc/blob/master/examples/multi-with-external-jar/build.sbt
  您需要添加libraryDependencies += "com.google.api.grpc" % "proto-google-cloud-firestore-v1beta1" % "0.37.0" % "protobuf",   将使sbt-protoc将原型提取到以下子目录中   target/protobuf_external如果您希望ScalaPB生成Scala类   给他们,然后还添加PB.protoSources in Compile += target.value / "protobuf_external" / "com" / "google"