• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1apply plugin: 'com.android.application'
2apply plugin: 'com.google.protobuf'
3
4android {
5    compileSdkVersion 27
6
7    defaultConfig {
8        applicationId "io.grpc.routeguideexample"
9        minSdkVersion 14
10        targetSdkVersion 27
11        versionCode 1
12        versionName "1.0"
13    }
14    buildTypes {
15        debug { minifyEnabled false }
16        release {
17            minifyEnabled true
18            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19        }
20    }
21    lintOptions {
22        disable 'GoogleAppIndexingWarning', 'HardcodedText', 'InvalidPackage'
23        textReport true
24        textOutput "stdout"
25    }
26}
27
28protobuf {
29    protoc { artifact = 'com.google.protobuf:protoc:3.5.1-1' }
30    plugins {
31        javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" }
32        grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.16.0-SNAPSHOT' // CURRENT_GRPC_VERSION
33        }
34    }
35    generateProtoTasks {
36        all().each { task ->
37            task.plugins {
38                javalite {}
39                grpc { // Options added to --grpc_out
40                    option 'lite' }
41            }
42        }
43    }
44}
45
46dependencies {
47    compile 'com.android.support:appcompat-v7:27.0.2'
48
49    // You need to build grpc-java to obtain these libraries below.
50    compile 'io.grpc:grpc-okhttp:1.16.0-SNAPSHOT' // CURRENT_GRPC_VERSION
51    compile 'io.grpc:grpc-protobuf-lite:1.16.0-SNAPSHOT' // CURRENT_GRPC_VERSION
52    compile 'io.grpc:grpc-stub:1.16.0-SNAPSHOT' // CURRENT_GRPC_VERSION
53    compile 'javax.annotation:javax.annotation-api:1.2'
54}
55