[关闭]
@Bitliker 2018-12-17T01:57:21.000000Z 字数 747 阅读 1252

Android 引入gRPC

教程

官网

grpc-java

Gradle 引入步骤

  1. classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.5"
  1. protobuf {
  2. protoc { artifact = 'com.google.protobuf:protoc:3.5.1-1' }
  3. plugins {
  4. javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" }
  5. grpc {
  6. artifact = 'io.grpc:protoc-gen-grpc-java:1.17.1' // CURRENT_GRPC_VERSION
  7. }
  8. }
  9. generateProtoTasks {
  10. all().each { task ->
  11. task.plugins {
  12. javalite {}
  13. grpc { // Options added to --grpc_out
  14. option 'lite'
  15. }
  16. }
  17. }
  18. }
  19. }
  1. apply plugin: 'com.google.protobuf'
  1. api 'javax.annotation:javax.annotation-api:1.2'
  2. api 'io.grpc:grpc-core:1.17.1'
  3. api 'io.grpc:grpc-protobuf-lite:1.17.1'
  4. api 'io.grpc:grpc-stub:1.17.1'
  5. api 'io.grpc:grpc-okhttp:1.17.1'
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注