1apply plugin: 'com.android.application' 2apply plugin: 'com.google.protobuf' 3 4android { 5 sourceSets { 6 main { 7 java { 8 srcDirs += "${projectDir}/../../interop-testing/src/main/java/" 9 setIncludes(["io/grpc/android/integrationtest/**", 10 "io/grpc/testing/integration/AbstractInteropTest.java", 11 "io/grpc/testing/integration/TestServiceImpl.java", 12 "io/grpc/testing/integration/Util.java"]) 13 } 14 proto { 15 srcDirs += "${projectDir}/../../interop-testing/src/main/proto/" 16 } 17 } 18 } 19 compileSdkVersion 26 20 21 defaultConfig { 22 applicationId "io.grpc.android.integrationtest" 23 // API level 14+ is required for TLS since Google Play Services v10.2 24 minSdkVersion 14 25 targetSdkVersion 26 26 versionCode 1 27 versionName "1.0" 28 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 29 multiDexEnabled true 30 } 31 buildTypes { 32 debug { minifyEnabled false } 33 release { 34 minifyEnabled true 35 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 36 } 37 } 38 lintOptions { disable 'InvalidPackage', 'HardcodedText' } 39} 40 41protobuf { 42 protoc { artifact = 'com.google.protobuf:protoc:3.5.1-1' } 43 plugins { 44 javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" } 45 grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.16.0-SNAPSHOT' // CURRENT_GRPC_VERSION 46 } 47 } 48 generateProtoTasks { 49 all().each { task -> 50 task.plugins { 51 javalite {} 52 grpc { 53 // Options added to --grpc_out 54 option 'lite' 55 } 56 } 57 } 58 } 59} 60 61dependencies { 62 implementation 'com.android.support:appcompat-v7:26.1.0' 63 implementation 'com.android.support:multidex:1.0.3' 64 implementation 'com.android.support:support-annotations:27.1.1' 65 implementation 'com.google.android.gms:play-services-base:15.0.1' 66 implementation ('com.google.auth:google-auth-library-oauth2-http:0.9.0') { 67 exclude group: 'org.apache.httpcomponents', module: 'httpclient' 68 } 69 implementation 'com.google.truth:truth:0.36' 70 implementation 'javax.annotation:javax.annotation-api:1.2' 71 implementation 'junit:junit:4.12' 72 73 // You need to build grpc-java to obtain the grpc libraries below. 74 implementation 'io.grpc:grpc-auth:1.16.0-SNAPSHOT' // CURRENT_GRPC_VERSION 75 implementation 'io.grpc:grpc-okhttp:1.16.0-SNAPSHOT' // CURRENT_GRPC_VERSION 76 implementation 'io.grpc:grpc-protobuf-lite:1.16.0-SNAPSHOT' // CURRENT_GRPC_VERSION 77 implementation 'io.grpc:grpc-stub:1.16.0-SNAPSHOT' // CURRENT_GRPC_VERSION 78 implementation 'io.grpc:grpc-testing:1.16.0-SNAPSHOT' // CURRENT_GRPC_VERSION 79 80 // workaround for https://github.com/google/protobuf/issues/1889 81 protobuf 'com.google.protobuf:protobuf-java:3.0.2' 82 83 androidTestImplementation 'androidx.test:rules:1.1.0-alpha1' 84 androidTestImplementation 'androidx.test:runner:1.1.0-alpha1' 85} 86 87gradle.projectsEvaluated { 88 tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:deprecation" } 89} 90