|
1 |
| -// Top-level build file where you can add configuration options common to all sub-projects/modules. |
| 1 | +plugins { |
| 2 | + id "com.android.application" |
| 3 | + id "com.google.protobuf" |
| 4 | +} |
2 | 5 |
|
3 |
| -buildscript { |
4 |
| - repositories { |
5 |
| - google() |
6 |
| - jcenter() |
7 |
| - } |
8 |
| - dependencies { |
9 |
| - classpath 'com.android.tools.build:gradle:3.3.0' |
10 |
| - classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.8" |
| 6 | +description = 'gRPC: Android Integration Testing' |
11 | 7 |
|
12 |
| - // NOTE: Do not place your application dependencies here; they belong |
13 |
| - // in the individual module build.gradle files |
14 |
| - } |
| 8 | +repositories { |
| 9 | + google() |
| 10 | + jcenter() |
15 | 11 | }
|
16 | 12 |
|
17 |
| -allprojects { |
18 |
| - repositories { |
19 |
| - google() |
20 |
| - mavenLocal() |
21 |
| - jcenter() |
| 13 | +android { |
| 14 | + sourceSets { |
| 15 | + main { |
| 16 | + java { |
| 17 | + srcDirs += "${projectDir}/../interop-testing/src/main/java/" |
| 18 | + setIncludes(["io/grpc/android/integrationtest/**", |
| 19 | + "io/grpc/testing/integration/AbstractInteropTest.java", |
| 20 | + "io/grpc/testing/integration/TestServiceImpl.java", |
| 21 | + "io/grpc/testing/integration/Util.java"]) |
| 22 | + } |
| 23 | + proto { |
| 24 | + srcDirs += "${projectDir}/../interop-testing/src/main/proto/" |
| 25 | + } |
| 26 | + } |
22 | 27 | }
|
23 |
| -} |
| 28 | + compileSdkVersion 26 |
24 | 29 |
|
25 |
| -subprojects { |
26 |
| - apply plugin: "checkstyle" |
27 |
| - |
28 |
| - checkstyle { |
29 |
| - configDir = file("$rootDir/../buildscripts") |
30 |
| - toolVersion = "6.17" |
31 |
| - ignoreFailures = false |
32 |
| - if (rootProject.hasProperty("checkstyle.ignoreFailures")) { |
33 |
| - ignoreFailures = rootProject.properties["checkstyle.ignoreFailures"].toBoolean() |
| 30 | + defaultConfig { |
| 31 | + applicationId "io.grpc.android.integrationtest" |
| 32 | + // API level 14+ is required for TLS since Google Play Services v10.2 |
| 33 | + minSdkVersion 14 |
| 34 | + targetSdkVersion 26 |
| 35 | + versionCode 1 |
| 36 | + versionName "1.0" |
| 37 | + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| 38 | + multiDexEnabled true |
| 39 | + } |
| 40 | + buildTypes { |
| 41 | + debug { minifyEnabled false } |
| 42 | + release { |
| 43 | + minifyEnabled true |
| 44 | + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
34 | 45 | }
|
35 | 46 | }
|
| 47 | + lintOptions { disable 'InvalidPackage', 'HardcodedText' } |
| 48 | +} |
36 | 49 |
|
37 |
| - // Checkstyle doesn't run automatically with android |
38 |
| - task checkStyleMain(type: Checkstyle) { |
39 |
| - source 'src/main/java' |
40 |
| - include '**/*.java' |
41 |
| - classpath = files() |
42 |
| - } |
| 50 | +dependencies { |
| 51 | + implementation 'com.android.support:appcompat-v7:26.1.0' |
| 52 | + implementation 'com.android.support:multidex:1.0.3' |
| 53 | + implementation 'com.android.support:support-annotations:27.1.1' |
| 54 | + implementation 'com.google.android.gms:play-services-base:15.0.1' |
43 | 55 |
|
44 |
| - task checkStyleTest(type: Checkstyle) { |
45 |
| - source 'src/test/java' |
46 |
| - include '**/*.java' |
47 |
| - classpath = files() |
48 |
| - } |
| 56 | + implementation project(':grpc-auth'), |
| 57 | + project(':grpc-census'), |
| 58 | + project(':grpc-okhttp'), |
| 59 | + project(':grpc-protobuf-lite'), |
| 60 | + project(':grpc-stub'), |
| 61 | + project(':grpc-testing'), |
| 62 | + libraries.junit, |
| 63 | + libraries.truth |
49 | 64 |
|
50 |
| - afterEvaluate { project -> |
51 |
| - project.tasks['check'].dependsOn checkStyleMain, checkStyleTest |
| 65 | + implementation (libraries.google_auth_oauth2_http) { |
| 66 | + exclude group: 'org.apache.httpcomponents' |
52 | 67 | }
|
| 68 | + |
| 69 | + compileOnly libraries.javax_annotation |
| 70 | + |
| 71 | + androidTestImplementation 'androidx.test:rules:1.1.0-alpha1' |
| 72 | + androidTestImplementation 'androidx.test:runner:1.1.0-alpha1' |
| 73 | +} |
| 74 | + |
| 75 | +// Checkstyle doesn't run automatically with android |
| 76 | +task checkStyleMain(type: Checkstyle) { |
| 77 | + source 'src/main/java' |
| 78 | + include '**/*.java' |
| 79 | + classpath = files() |
53 | 80 | }
|
| 81 | + |
| 82 | +task checkStyleTest(type: Checkstyle) { |
| 83 | + source 'src/androidTest/java' |
| 84 | + include '**/*.java' |
| 85 | + classpath = files() |
| 86 | +} |
| 87 | + |
| 88 | +project.tasks['check'].dependsOn checkStyleMain, checkStyleTest |
| 89 | + |
| 90 | +configureProtoCompilation() |
0 commit comments