-
Notifications
You must be signed in to change notification settings - Fork 100
/
build.gradle
220 lines (184 loc) · 7.85 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
/*
* Copyright (C) 2020 Luke Klinker
*
* 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
*
* http://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.
*/
def propsFile = project.file('keystore.properties')
def props = new Properties()
props.load(new FileInputStream(propsFile))
propsFile = rootProject.file('api_keys.properties')
def apiKeys = new Properties()
apiKeys.load(new FileInputStream(propsFile))
buildscript {
ext.buildInfo = [
'id' : 'xyz.klinker.messenger',
'name' : '5.4.6',
'number' : System.getenv("BUILD_NUMBER") as Integer ?: 135,
]
ext.versions = [
'gradlePlugin' : '4.1.0',
'targetSdk' : 30,
'minSdk' : 21,
'kotlin' : '1.4.10',
'playServices' : '17.0.0',
'glide' : '4.11.0',
'retrofit' : '2.7.2',
'androidX' : '1.0.0',
'androidXExif' : '1.2.0',
'androidXTester' : '1.1.0',
'androidXEspresso' : '3.1.0',
'firebaseAnalytics' : '17.4.4',
'firebaseMessaging' : '20.2.0',
'firebaseStorage' : '19.1.1',
'firebaseAuth' : '19.3.2',
'mockito' : '3.5.13',
'robolectric' : '4.4',
'testEspresso' : '3.0.1',
'testRunner' : '1.0.1',
]
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:${versions.gradlePlugin}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath 'com.google.gms:google-services:4.3.4'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url "https://dl.bintray.com/drummer-aidan/maven" }
maven { url "https://dl.bintray.com/sensor-tower/android-usage" }
maven { url "https://dl.bintray.com/mockito/maven" }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
flatDir { dirs "$rootProject.projectDir/shared/libs" }
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
// if (requested.group == 'com.google.android.gms' && requested.name == 'play-services-basement') {
// details.useVersion '16.1.0'
// } else if (requested.group == 'com.google.android.gms' && requested.name == 'play-services-tasks') {
// details.useVersion '16.0.1'
// } else if (requested.group == 'com.google.android.gms' && requested.name == 'play-services-base') {
// details.useVersion '16.0.1'
// }
}
}
}
// add the common project properties, to each app variant
subprojects {
afterEvaluate { project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion versions.targetSdk
defaultConfig {
targetSdkVersion versions.targetSdk
buildConfigField("String", "GIPHY_API_KEY", "\"${apiKeys['GIPHY']}\"")
buildConfigField("String", "ARTICLE_API_KEY", "\"${apiKeys['ARTICLE']}\"")
buildConfigField("String", "YOUTUBE_API_KEY", "\"${apiKeys['YOUTUBE']}\"")
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
debug {
storeFile file("debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
release {
storeFile file(props['keystorefile'])
storePassword props['keystorepassword']
keyAlias props['keyalias']
keyPassword props['keypassword']
}
}
buildTypes {
debug {
versionNameSuffix "-DEBUG"
signingConfig signingConfigs.debug
matchingFallbacks = ['release_fast', 'release']
}
staging {
versionNameSuffix "-STAGING"
debuggable true
signingConfig signingConfigs.debug
matchingFallbacks = ['release_fast', 'release']
}
release_fast {
versionNameSuffix "-RELEASE"
minifyEnabled false
shrinkResources false
debuggable true
signingConfig signingConfigs.release
matchingFallbacks = ['release_fast', 'release']
}
release {
signingConfig signingConfigs.release
matchingFallbacks = ['release_fast', 'release']
}
}
aaptOptions {
noCompress "tflite"
}
dexOptions {
jumboMode = true
javaMaxHeapSize "4g"
}
lintOptions {
checkReleaseBuilds false
abortOnError true
disable 'GoogleAppIndexingWarning', 'AllowBackup', 'IconMissingDensityFolder',
'InconsistentLayout', 'InvalidPackage', 'TrustAllX509TrustManager',
'UnusedResources', 'StaticFieldLeak', 'NestedWeights', 'InflateParams',
'MissingTranslation', 'GradleCompatible', 'ApplySharedPref', 'Assert',
'LocaleFolder', 'TypographyEllipsis', 'InconsistentArrays', 'DefaultLocale',
'AppCompatCustomView', 'UnusedQuantity', 'MergeRootFrame', 'NewApi', 'Typos',
'IconDensities', 'IconDuplicates', 'ContentDescription', 'LabelFor'
textOutput 'stdout'
xmlReport false
htmlReport true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/library_release.kotlin_module'
}
}
}
}
}