forked from aws-amplify/amplify-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
188 lines (169 loc) · 6.94 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
/*
* Copyright 2019 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()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31'
classpath 'org.jlleitschuh.gradle:ktlint-gradle:9.4.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-Werror"
}
tasks.withType(Test) {
minHeapSize = '128m'
maxHeapSize = '4g'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext {
buildToolsVersion = "30.0.2"
compileSdkVersion = 30
minSdkVersion = 16
targetSdkVersion = 30
awsSdkVersion = '2.26.0'
fragmentVersion = '1.3.1'
navigationVersion = '2.3.4'
dependency = [
android: [
desugartools: 'com.android.tools:desugar_jdk_libs:1.0.9',
],
androidx: [
v4support: 'androidx.legacy:legacy-support-v4:1.0.0',
annotation: 'androidx.annotation:annotation:1.1.0',
appcompat: 'androidx.appcompat:appcompat:1.2.0',
core: 'androidx.core:core:1.3.2',
core_ktx: 'androidx.core:core-ktx:1.3.2',
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",
dynamicfeatures: "androidx.navigation:navigation-dynamic-features-fragment:$navigationVersion"
],
multidex: 'androidx.multidex:multidex:2.0.1',
test: [
core: 'androidx.test:core: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"
]
],
aws: [
s3: "com.amazonaws:aws-android-sdk-s3:$awsSdkVersion",
comprehend: "com.amazonaws:aws-android-sdk-comprehend:$awsSdkVersion",
authcore: "com.amazonaws:aws-android-sdk-auth-core:$awsSdkVersion",
cognitoauth: "com.amazonaws:aws-android-sdk-cognitoauth:$awsSdkVersion",
pinpoint: "com.amazonaws:aws-android-sdk-pinpoint:$awsSdkVersion",
mobileclient: "com.amazonaws:aws-android-sdk-mobile-client:$awsSdkVersion",
polly: "com.amazonaws:aws-android-sdk-polly:$awsSdkVersion",
rekognition: "com.amazonaws:aws-android-sdk-rekognition:$awsSdkVersion",
textract: "com.amazonaws:aws-android-sdk-textract:$awsSdkVersion",
translate: "com.amazonaws:aws-android-sdk-translate:$awsSdkVersion"
],
kotlin: [
stdlib: 'org.jetbrains.kotlin:kotlin-stdlib:1.4.31',
coroutines: 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2'
],
oauth2: 'com.google.auth:google-auth-library-oauth2-http:0.26.0',
okhttp: 'com.squareup.okhttp3:okhttp:4.9.1',
gson: 'com.google.code.gson:gson:2.8.6',
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.1.0',
mockk: 'io.mockk:mockk:1.10.6',
mockwebserver: 'com.squareup.okhttp3:mockwebserver:4.9.1',
robolectric: 'org.robolectric:robolectric:4.5.1',
jsonassert: 'org.skyscreamer:jsonassert:1.5.0'
]
}
subprojects { project ->
afterEvaluate {
configureAndroidLibrary(project)
}
}
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 rootProject.ext.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
}
}
}
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")