-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
247 lines (207 loc) · 10.3 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
apply plugin: 'com.google.firebase.appdistribution'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'dagger.hilt.android.plugin'
apply plugin: 'com.getkeepsafe.dexcount'
android {
defaultConfig {
applicationId rootProject.applicationId
versionName rootProject.version
proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
proguardFile 'proguard-rules.pro'
proguardFile 'proguard-rules-crashlytics.pro'
proguardFile 'proguard-rules-eventbus.pro'
proguardFile 'proguard-rules-guava.pro'
proguardFile 'proguard-searchview.pro'
vectorDrawables.useSupportLibrary = true
}
buildFeatures {
dataBinding = true
viewBinding = true
}
packagingOptions {
// XXX: Exclude Kotlin metadata to reduce the size of the APK.
// If we ever start utilizing kotlin reflection this will need to be removed.
exclude '**/*.kotlin_*'
}
kapt {
javacOptions {
option("-Adagger.fastInit=enabled")
}
}
flavorDimensions "env"
productFlavors {
stage {
dimension "env"
buildConfigField "String", "MOBILE_CONTENT_API", "\"${uris.mobileContentApi.stage}\""
buildConfigField "String", "OKTA_CLIENT_ID", "\"0oatqowo16nlzqJRV0h7\""
buildConfigField "String", "OKTA_DISCOVERY_URI", "\"https://cru.oktapreview.com\""
buildConfigField "String", "THEKEY_URI", "\"https://stage.thekey.me/cas/login\""
buildConfigField "String", "THEKEY_CLIENT_ID", "\"5337397229970887848\""
}
production {
dimension "env"
buildConfigField "String", "MOBILE_CONTENT_API", "\"${uris.mobileContentApi.production}\""
buildConfigField "String", "OKTA_CLIENT_ID", "\"0oa1ju0zx08vYGgbB0h8\""
buildConfigField "String", "OKTA_DISCOVERY_URI", "\"https://signon.okta.com\""
buildConfigField "String", "THEKEY_URI", "\"https://thekey.me/cas/login\""
buildConfigField "String", "THEKEY_CLIENT_ID", "\"5337397229970887848\""
}
}
signingConfigs {
firebaseAppDistribution {
storeFile rootProject.file(firebaseAppDistributionKeystorePath)
storePassword firebaseAppDistributionKeystoreStorePassword
keyAlias firebaseAppDistributionKeystoreKeyAlias
keyPassword firebaseAppDistributionKeystoreKeyPassword
}
release {
storeFile rootProject.file(androidKeystorePath)
storePassword androidKeystoreStorePassword
keyAlias androidKeystoreKeyAlias
keyPassword androidKeystoreKeyPassword
}
}
buildTypes {
debug {
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
multiDexEnabled true
minifyEnabled false
shrinkResources false
manifestPlaceholders += ["appAuthRedirectScheme": "org.cru.godtools.debug"]
buildConfigField "String", "OKTA_AUTH_SCHEME", "\"org.cru.godtools.debug\""
resValue "string", "app_name_debug", "GodTools (Dev)"
}
qa {
initWith debug
matchingFallbacks = ['debug']
applicationIdSuffix ".qa"
versionNameSuffix "-qa"
manifestPlaceholders += ["appAuthRedirectScheme": "org.cru.godtools.qa"]
buildConfigField "String", "OKTA_AUTH_SCHEME", "\"org.cru.godtools.qa\""
resValue "string", "app_name_debug", "GodTools (QA)"
// Firebase App Distribution build
if (project.hasProperty('firebaseAppDistributionBuild')) {
signingConfig signingConfigs.firebaseAppDistribution
firebaseAppDistribution {
apkPath = new File(buildDir, 'outputs/universal_apk/productionQa/app-production-qa-universal.apk')
releaseNotes = generateFirebaseAppDistributionReleaseNotes()
serviceCredentialsFile = rootProject.file("firebase/firebase_api_key.json")
groups = 'android-testers'
}
}
}
release {
minifyEnabled true
// TODO: this is disabled until it supports dynamic features in AS 4.2
// shrinkResources true
if (signingConfigs.release.storeFile.exists()) {
signingConfig signingConfigs.release
}
manifestPlaceholders += ["appAuthRedirectScheme": "org.cru.godtools"]
buildConfigField "String", "OKTA_AUTH_SCHEME", "\"org.cru.godtools\""
}
}
bundle {
language.enableSplit = false
}
dynamicFeatures = [
':feature:bundledcontent',
]
sourceSets {
qa {
java.srcDir 'src/debug/java'
res.srcDir 'src/debug/res/values'
manifest.srcFile 'src/debug/AndroidManifest.xml'
}
}
}
kapt {
arguments {
arg('eventBusIndex', 'org.cru.godtools.AppEventBusIndex')
}
}
configurations {
qaImplementation.extendsFrom debugImplementation
}
dependencies {
api project(':library:api')
implementation project(':library:base')
api project(':library:db')
api project(':library:download-manager')
implementation project(':library:model')
implementation project(':library:sync')
implementation project(':ui:article-renderer')
implementation project(':ui:base')
implementation project(':ui:shortcuts')
implementation project(':ui:tract-renderer')
implementation project(':ui:tutorial-renderer')
implementation "androidx.constraintlayout:constraintlayout:${deps.androidX.constraintLayout}"
implementation "androidx.fragment:fragment-ktx:${deps.androidX.fragment}"
implementation "androidx.lifecycle:lifecycle-extensions:${deps.androidX.lifecycle}"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:${deps.androidX.lifecycle}"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:${deps.androidX.swipeRefreshLayout}"
implementation "androidx.work:work-runtime:${deps.androidX.work}"
implementation "org.ccci.gto.android:gto-support-androidx-databinding:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-androidx-fragment:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-androidx-lifecycle:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-androidx-viewpager2:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-androidx-work:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-appcompat:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-base:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-compat:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-dagger:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-firebase-crashlytics:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-eventbus:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-material-components:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-okta:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-picasso:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-recyclerview:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-recyclerview-advrecyclerview:${deps.gtoSupport}"
implementation "org.ccci.gto.android:gto-support-util:${deps.gtoSupport}"
implementation "com.google.firebase:firebase-crashlytics:${deps.firebase.crashlytics}"
implementation "com.google.firebase:firebase-inappmessaging-display:${deps.firebase.inAppMessaging}"
implementation "com.google.firebase:firebase-perf:${deps.firebase.perf}"
implementation 'com.google.android.play:core:1.9.1'
implementation "com.getkeepsafe.taptargetview:taptargetview:${deps.taptargetview}"
implementation "com.github.Karumi:WeakDelegate:${deps.weakdelegate}"
implementation "com.google.android.instantapps:instantapps:${deps.androidInstantApps}"
implementation "com.google.android.material:material:${deps.materialDesign}"
implementation "com.google.dagger:hilt-android:${deps.hilt}"
implementation "com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:${deps.advrecyclerview}"
implementation "com.louiscad.splitties:splitties-fragmentargs:${deps.splitties}"
implementation "com.okta.android:oidc-androidx:${deps.okta}"
implementation "com.pierfrancescosoffritti.androidyoutubeplayer:core:${deps.youtubeplayer}"
implementation "com.sergivonavi:materialbanner:1.2.0"
api "org.greenrobot:eventbus:${deps.eventbus}"
debugImplementation "androidx.multidex:multidex:${deps.androidX.multidex}"
debugImplementation "org.ccci.gto.android:gto-support-facebook-flipper:${deps.gtoSupport}"
debugImplementation "org.ccci.gto.android:gto-support-leakcanary2:${deps.gtoSupport}"
debugImplementation "org.ccci.gto.android:gto-support-okhttp3:${deps.gtoSupport}"
debugImplementation "com.facebook.flipper:flipper:${deps.facebookFlipper}"
debugImplementation "com.facebook.flipper:flipper-network-plugin:${deps.facebookFlipper}"
debugImplementation 'com.facebook.soloader:soloader:0.9.0'
debugImplementation "com.squareup.leakcanary:leakcanary-android:${deps.leakcanary}"
kapt "com.google.dagger:dagger-compiler:${deps.dagger}"
kapt "com.google.dagger:hilt-compiler:${deps.hilt}"
kapt "org.greenrobot:eventbus-annotation-processor:${deps.eventbus}"
}
apply plugin: 'com.google.gms.google-services'
// make crashlytics upload task dependent on the assemble task for all build variants
afterEvaluate {
android.applicationVariants.all { variant ->
def assembleTask = project.tasks.getByName("assemble${variant.name.capitalize()}")
def appDistributionTask = project.tasks.getByName("appDistributionUpload${variant.name.capitalize()}")
appDistributionTask.dependsOn assembleTask
}
}
def generateFirebaseAppDistributionReleaseNotes(size = 10) {
def output = "Recent changes:\n\n"
grgit.log {
maxCommits = size
}.each { commit ->
output = output + "* " + commit.shortMessage + "\n"
}
return output
}