-
Notifications
You must be signed in to change notification settings - Fork 108
/
build.gradle
257 lines (232 loc) · 9.52 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
/*
* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
buildscript {
repositories {
google()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10'
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.7.10"
classpath 'org.jlleitschuh.gradle:ktlint-gradle:11.0.0'
classpath "org.gradle:test-retry-gradle-plugin:1.4.1"
}
}
def useAwsSdkReleaseBuild() {
return hasProperty('useAwsSdkReleaseBuild') && project.useAwsSdkReleaseBuild == "true"
}
allprojects {
repositories {
maven {
url = 'https://aws.oss.sonatype.org/content/repositories/snapshots/'
}
google()
mavenCentral()
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-Werror"
}
tasks.withType(Test) {
minHeapSize = '128m'
maxHeapSize = '4g'
}
}
}
apply plugin: 'org.jetbrains.dokka'
dokkaHtmlCollector {
outputDirectory = rootProject.buildDir
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext {
buildToolsVersion = "30.0.2"
compileSdkVersion = 31
minSdkVersion = 24
targetSdkVersion = 30
awsKotlinSdkVersion = '0.17.12-beta'
fragmentVersion = '1.3.1'
navigationVersion = '2.3.4'
dependency = [
android: [
desugartools: 'com.android.tools:desugar_jdk_libs:1.2.0',
],
androidx: [
v4support: 'androidx.legacy:legacy-support-v4:1.0.0',
annotation: 'androidx.annotation:annotation:1.1.0',
appcompat: 'androidx.appcompat:appcompat:1.2.0',
browser: 'androidx.browser:browser:1.4.0',
core: 'androidx.core:core:1.3.2',
core_ktx: 'androidx.core:core-ktx:1.3.2',
workmanager: 'androidx.work:work-runtime-ktx:2.7.1',
security: 'androidx.security:security-crypto:1.0.0',
nav: [
fragment: "androidx.navigation:navigation-fragment:$navigationVersion",
fragmentktx: "androidx.navigation:navigation-fragment-ktx:$navigationVersion",
ui: "androidx.navigation:navigation-ui:$navigationVersion",
uiktx: "androidx.navigation:navigation-ui-ktx:$navigationVersion"
],
multidex: 'androidx.multidex:multidex:2.0.1',
test: [
core: 'androidx.test:core:1.3.0',
core_ktx: 'androidx.test:core-ktx:1.3.0',
runner: 'androidx.test:runner:1.3.0',
junit: 'androidx.test.ext:junit:1.1.2',
espresso: 'androidx.test.espresso:espresso-core:3.3.0',
orchestrator: 'androidx.test:orchestrator:1.3.0',
navigation: "androidx.navigation:navigation-testing:$navigationVersion",
fragment: "androidx.fragment:fragment-testing:$fragmentVersion",
mockito: "org.mockito:mockito-core:3.9.0",
workmanager: "androidx.work:work-testing:2.7.1"
]
],
aws: [
credentials: "aws.smithy.kotlin:aws-credentials:0.12.6",
ktor: "aws.smithy.kotlin:http-client-engine-ktor:0.7.7",
signing: "aws.smithy.kotlin:aws-signing-default:0.12.6",
cognitoidentity: "aws.sdk.kotlin:cognitoidentity:$awsKotlinSdkVersion",
cognitoidentityprovider: "aws.sdk.kotlin:cognitoidentityprovider:$awsKotlinSdkVersion",
comprehend: "aws.sdk.kotlin:comprehend:$awsKotlinSdkVersion",
location: "aws.sdk.kotlin:location:$awsKotlinSdkVersion",
s3: "aws.sdk.kotlin:s3:$awsKotlinSdkVersion",
pinpointKotlin: "aws.sdk.kotlin:pinpoint:$awsKotlinSdkVersion",
polly: "aws.sdk.kotlin:polly:$awsKotlinSdkVersion",
rekognition: "aws.sdk.kotlin:rekognition:$awsKotlinSdkVersion",
textract: "aws.sdk.kotlin:textract:$awsKotlinSdkVersion",
translate: "aws.sdk.kotlin:translate:$awsKotlinSdkVersion",
],
kotlin: [
stdlib: 'org.jetbrains.kotlin:kotlin-stdlib:1.7.10',
coroutines: 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3',
serializationJson: 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3',
ktlint: 'org.jlleitschuh.gradle:ktlint-gradle:7.1.0',
futures: 'androidx.concurrent:concurrent-futures-ktx:1.1.0',
reflection: "org.jetbrains.kotlin:kotlin-reflect:1.7.10",
test: [
junit: 'org.jetbrains.kotlin:kotlin-test-junit:1.5.31',
coroutines: 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.3',
kotlinTest: 'org.jetbrains.kotlin:kotlin-test:1.7.10'
]
],
oauth2: 'com.google.auth:google-auth-library-oauth2-http:0.26.0',
okhttp: 'com.squareup.okhttp3:okhttp:5.0.0-alpha.9',
gson: 'com.google.code.gson:gson:2.8.9',
maplibre: [
sdk: 'org.maplibre.gl:android-sdk:9.5.2',
annotations: 'org.maplibre.gl:android-plugin-annotation-v9:1.0.0'
],
rxandroid: 'io.reactivex.rxjava3:rxandroid:3.0.0',
rxjava: 'io.reactivex.rxjava3:rxjava:3.0.6',
tensorflow: 'org.tensorflow:tensorflow-lite:2.0.0',
uuidgen: 'com.fasterxml.uuid:java-uuid-generator:4.0.1',
junit: 'junit:junit:4.13.2',
mockito: 'org.mockito:mockito-core:3.9.0',
mockk: 'io.mockk:mockk:1.12.3',
mockkandroid: 'io.mockk:mockk-android:1.12.3',
mockwebserver: 'com.squareup.okhttp3:mockwebserver:5.0.0-alpha.9',
mockitoinline: 'org.mockito:mockito-inline:3.11.2',
robolectric: 'org.robolectric:robolectric:4.7',
jsonassert: 'org.skyscreamer:jsonassert:1.5.0'
]
}
subprojects { project ->
apply plugin: 'org.jlleitschuh.gradle.ktlint'
ktlint {
android.set(true)
}
afterEvaluate {
configureAndroidLibrary(project)
project.apply from: '../jacoco.gradle'
}
if (!project.name.contains("test")) {
apply plugin: 'org.jetbrains.dokka'
dokkaHtml {
dokkaSourceSets {
configureEach {
includeNonPublic.set(false)
skipEmptyPackages.set(true)
skipDeprecated.set(true)
reportUndocumented.set(true)
jdkVersion.set(8)
}
}
}
}
apply plugin: 'org.gradle.test-retry'
tasks.withType(Test).configureEach {
retry {
maxRetries = 9
maxFailures = 100
failOnPassedAfterRetry = true
}
}
}
private void configureAndroidLibrary(Project project) {
project.ext.VERSION_NAME = project.hasProperty('VERSION_NAME') ?
project.findProperty('VERSION_NAME') :
rootProject.findProperty('VERSION_NAME')
if (project.hasProperty('signingKeyId')) {
System.out.println("Getting signing info from protected source.")
project.ext.'signing.keyId' = findProperty('signingKeyId')
project.ext.'signing.password' = findProperty('signingPassword')
project.ext.'signing.inMemoryKey' = findProperty('signingInMemoryKey')
}
project.android {
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
multiDexEnabled true
minSdkVersion project.findProperty('minSdkVersion')
targetSdkVersion rootProject.ext.targetSdkVersion
versionName project.ext.VERSION_NAME
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
testInstrumentationRunnerArguments clearPackageData: 'true'
consumerProguardFiles rootProject.file('configuration/consumer-rules.pro')
testOptions {
animationsDisabled = true
unitTests {
includeAndroidResources = true
}
}
buildConfigField "String", "VERSION_NAME", "\"${project.ext.VERSION_NAME}\""
}
lintOptions {
warningsAsErrors true
abortOnError true
enable 'UnusedResources'
enable 'NewerVersionAvailable'
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// Needed when running integration tests. The oauth2 library uses relies on two
// dependencies (Apache's httpcore and httpclient), both of which include
// META-INF/DEPENDENCIES. Tried a couple other options to no avail.
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}
}
project.dependencies {
coreLibraryDesugaring dependency.android.desugartools
}
}
apply from: rootProject.file("configuration/instrumentation-tests.gradle")