| apply plugin: 'com.android.application' |
| apply plugin: 'com.google.protobuf' |
| |
| android { |
| compileSdkVersion 22 |
| buildToolsVersion "22.0.1" |
| |
| defaultConfig { |
| applicationId "io.grpc.android.helloworldexample" |
| minSdkVersion 9 |
| targetSdkVersion 22 |
| versionCode 1 |
| versionName "1.0" |
| } |
| buildTypes { |
| release { |
| minifyEnabled true |
| proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| } |
| } |
| lintOptions { |
| disable 'InvalidPackage', 'HardcodedText' |
| textReport true |
| textOutput "stdout" |
| } |
| } |
| |
| protobuf { |
| protoc { |
| artifact = 'com.google.protobuf:protoc:3.0.0-beta-3' |
| } |
| plugins { |
| grpc { |
| artifact = 'io.grpc:protoc-gen-grpc-java:0.15.0-SNAPSHOT' // CURRENT_GRPC_VERSION |
| } |
| } |
| generateProtoTasks { |
| all().each { task -> |
| task.builtins { |
| javanano { |
| // Options added to --javanano_out |
| option 'ignore_services=true' |
| } |
| } |
| |
| task.plugins { |
| grpc { |
| // Options added to --grpc_out |
| option 'nano' |
| } |
| } |
| } |
| } |
| } |
| |
| dependencies { |
| compile 'com.android.support:appcompat-v7:22.1.1' |
| compile 'com.google.code.findbugs:jsr305:3.0.0' |
| compile 'com.google.guava:guava:18.0' |
| compile 'com.squareup.okhttp:okhttp:2.2.0' |
| // You need to build grpc-java to obtain these libraries below. |
| compile 'io.grpc:grpc-okhttp:0.15.0-SNAPSHOT' // CURRENT_GRPC_VERSION |
| compile 'io.grpc:grpc-protobuf-nano:0.15.0-SNAPSHOT' // CURRENT_GRPC_VERSION |
| compile 'io.grpc:grpc-stub:0.15.0-SNAPSHOT' // CURRENT_GRPC_VERSION |
| compile 'javax.annotation:javax.annotation-api:1.2' |
| } |