This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
/
Copy pathbuild.gradle
257 lines (224 loc) · 9.38 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
apply plugin: 'com.android.application'
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License 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.
*/
// Fetch build number from command line arguments (for CI)
ext.build_number = project.hasProperty('BUILD_NUMBER') ? project.getProperty('BUILD_NUMBER') : "1"
ext.build_label = project.hasProperty('BUILD_LABEL') ? project.getProperty('BUILD_LABEL') : "SNAPSHOT"
ext.logsource_id = project.hasProperty('LOGSOURCE_ID') ? project.getProperty('LOGSOURCE_ID') : ""
ext.release_logging = project.hasProperty('RELEASE_LOGGING') && project.getProperty('RELEASE_LOGGING') == "true"
apply from: 'enexpress.gradle'
apply from: 'robolectric_download.gradle'
apply plugin: 'com.google.protobuf'
apply plugin: 'com.mikepenz.aboutlibraries.plugin'
apply plugin: 'dagger.hilt.android.plugin'
apply plugin: 'com.google.gms.google-services'
// Disable unwanted tasks (if any) - see enexpress.gradle
project.tasks.all { task ->
if (project.excludedTasks.contains(task.name)) {
println "Disabling task " + task.name
task.enabled = false
}
}
android {
compileSdkVersion rootProject.ext.compileSdkVersion
ndkVersion rootProject.ext.ndkVersion
defaultConfig {
applicationId 'com.google.android.apps.exposurenotification'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode build_number.toInteger()
versionName build_label
// The value of 'appLinkHost' is placeholder. It is to be replaced with 'appLinkHost' field
// in the config.
manifestPlaceholders = [appLinkHost: "applink.host"]
// This is currently unused, but necessary if we add instrumented tests in the future
testInstrumentationRunner "com.google.android.apps.exposurenotification.CustomTestRunner"
vectorDrawables.useSupportLibrary true
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation":
"$projectDir/schemas".toString()]
}
}
ndk {
debugSymbolLevel = 'FULL'
}
buildConfigField("String", "LOGSOURCE_ID", "\"${logsource_id}\"")
buildConfigField("boolean", "RELEASE_LOGGING", release_logging.toString())
if (project.hasProperty('LOCALE_CONFIG')) {
resConfigs project.getProperty('LOCALE_CONFIG').split(",")
}
}
buildTypes {
debug {
pseudoLocalesEnabled true
versionNameSuffix ".debug"
minifyEnabled false
debuggable true
testCoverageEnabled true
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
viewBinding true
}
sourceSets {
debug {
proto {
srcDirs 'src/main/java/com/google/android/apps/exposurenotification/proto'
}
assets {
srcDirs += files("$projectDir/schemas".toString())
}
}
release {
proto {
srcDir 'src/main/java/com/google/android/apps/exposurenotification/proto'
}
}
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}
testOptions {
unitTests {
includeAndroidResources = true
returnDefaultValues = true
}
unitTests.all {
maxHeapSize = "2g"
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
forkEvery = 100
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
}
}
}
lintOptions {
abortOnError false
}
buildToolsVersion rootProject.ext.buildToolsVersion
}
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.11.4'
}
generateProtoTasks {
all().each { task ->
task.builtins {
java {
option "lite"
}
}
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation project(':privateanalytics')
annotationProcessor 'androidx.hilt:hilt-compiler:1.0.0'
annotationProcessor 'androidx.room:room-compiler:2.2.5'
annotationProcessor 'com.google.auto.value:auto-value:1.7.3'
annotationProcessor 'com.google.dagger:hilt-android-compiler:2.38.1'
debugImplementation ("androidx.fragment:fragment-testing:1.3.6") {
exclude group: "androidx.test", module : "core"
}
implementation 'androidx.appcompat:appcompat:1.4.0-alpha03'
implementation "androidx.biometric:biometric:1.1.0"
implementation "androidx.cardview:cardview:1.0.0"
implementation 'androidx.concurrent:concurrent-futures:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.fragment:fragment:1.3.6'
implementation 'androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03'
implementation 'androidx.hilt:hilt-work:1.0.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.2.0'
implementation 'androidx.lifecycle:lifecycle-process:2.3.0'
implementation 'androidx.navigation:navigation-fragment:2.3.0'
implementation 'androidx.room:room-guava:2.2.5'
implementation 'androidx.room:room-runtime:2.2.5'
implementation 'androidx.slice:slice-builders:1.0.0'
implementation ("androidx.work:work-runtime:2.7.0-rc01") {
transitive = true
}
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.google.android.gms:play-services-base:17.4.0'
implementation 'com.google.android.gms:play-services-basement:17.4.0'
implementation 'com.google.android.gms:play-services-tasks:17.2.0'
implementation 'com.google.android.material:material:1.5.0-beta01'
implementation 'com.google.android.play:core:1.10.2'
implementation 'com.google.auto.value:auto-value-annotations:1.7.3'
implementation 'com.google.dagger:hilt-android:2.38.1'
implementation 'com.google.firebase:firebase-firestore:21.6.0'
implementation 'com.google.firebase:firebase-datatransport:17.0.8'
implementation 'com.google.guava:guava:29.0-android'
implementation 'com.google.protobuf:protobuf-javalite:3.11.1'
implementation 'com.jakewharton.threetenabp:threetenabp:1.2.4'
implementation 'commons-io:commons-io:2.6'
implementation 'org.apache.httpcomponents:httpclient:4.5.12'
implementation "com.mikepenz:aboutlibraries:8.9.4"
implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.33'
// Debug-only libraries
debugImplementation 'com.google.zxing:core:3.3.0'
debugImplementation('com.journeyapps:zxing-android-embedded:4.1.0') {
transitive = false
}
// JVM test dependencies
testImplementation 'org.mockito:mockito-core:3.12.4'
testImplementation 'org.mockito:mockito-inline:3.12.4'
//noinspection FragmentGradleConfiguration
testImplementation 'androidx.lifecycle:lifecycle-runtime-testing:2.3.0'
testImplementation 'androidx.room:room-testing:2.2.5'
testImplementation 'androidx.test.ext:junit:1.1.4-alpha01'
testImplementation 'androidx.test:core:1.4.1-alpha01'
testImplementation "androidx.work:work-testing:2.7.0-rc01"
testImplementation 'androidx.test.espresso:espresso-core:3.4.0'
testImplementation 'androidx.test:runner:1.4.0'
testImplementation 'com.google.guava:guava-testlib:29.0-jre'
testImplementation 'com.google.dagger:hilt-android-testing:2.38.1'
testImplementation 'com.google.truth:truth:1.0.1'
testImplementation 'commons-io:commons-io:2.6'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.8.1'
testImplementation 'androidx.arch.core:core-testing:2.1.0'
testImplementation ('org.threeten:threetenbp:1.2.4'){
exclude group:'com.jakewharton.threetenabp', module:'threetenabp'
}
testAnnotationProcessor 'com.google.dagger:hilt-android-compiler:2.38.1'
// Instrumented test dependencies
androidTestImplementation 'androidx.test.ext:junit:1.1.4-alpha01'
androidTestImplementation 'androidx.test:core:1.4.1-alpha01'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'com.google.dagger:hilt-android-testing:2.38.1'
androidTestAnnotationProcessor 'com.google.dagger:hilt-android-compiler:2.38.1'
}
aboutLibraries {
configPath = "app/aboutlibraries"
}
configurations {
all {
exclude module: 'httpclient'
}
}