forked from Automattic/pocket-casts-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.gradle
295 lines (255 loc) · 11.4 KB
/
base.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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
/**
* Base configuration for app, automotive, wear, and all modules.
*/
def SERVER_MAIN_URL_PROD = "\"https://refresh.pocketcasts.com\""
def SERVER_API_URL_PROD = "\"https://api.pocketcasts.com\""
def SERVER_CACHE_URL_PROD = "\"https://cache.pocketcasts.com\""
def SERVER_STATIC_URL_PROD = "\"https://static.pocketcasts.com\""
def SERVER_SHARING_URL_PROD = "\"https://sharing.pocketcasts.com\""
def SERVER_LIST_URL_PROD = "\"https://lists.pocketcasts.com\""
def SERVER_LIST_HOST_PROD = "\"lists.pocketcasts.com\""
def SERVER_SHORT_URL_PROD = "\"https://pca.st\""
def WEB_BASE_HOST_PROD = "\"pocketcasts.com\""
android {
compileSdkVersion project.compileSdkVersion
defaultConfig {
minSdkVersion project.minSdkVersion
targetSdkVersion project.targetSdkVersion
versionCode project.versionCode
versionName project.versionName
buildConfigField "int", "VERSION_CODE", "${project.versionCode}"
buildConfigField "String", "VERSION_NAME", "\"${project.versionName}\""
buildConfigField "String", "SETTINGS_ENCRYPT_SECRET", "\"${project.settingsEncryptSecret}\""
buildConfigField "String", "SHARING_SERVER_SECRET", "\"${project.sharingServerSecret}\""
buildConfigField "String", "GOOGLE_SIGN_IN_SERVER_CLIENT_ID", "\"${project.googleSignInServerClientId}\""
buildConfigField "String", "SENTRY_DSN", "\"${project.pocketcastsSentryDsn}\""
buildConfigField "String", "BUILD_PLATFORM", "\"${project.buildPlatform}\""
buildConfigField "String", "ENCRYPTION_KEY", "\"${project.encryptionKey}\""
buildConfigField "String", "APP_SECRET", "\"${project.appSecret}\""
testInstrumentationRunner project.testInstrumentationRunner
testApplicationId "au.com.shiftyjelly.pocketcasts.test" + project.name.replace("-", "_")
vectorDrawables.useSupportLibrary = true
}
lint {
baseline project.file("lint-baseline.xml")
// We do not run Lint on localization project as it doesn't fit our release pipeline.
// Running it there risks potential mistakes when making releases and requiring
// developers to manually update the rules before submitting a release.
def isLocalizationsProject = project.name == "localization"
lintConfig rootProject.file(isLocalizationsProject ? "lint-no-op.xml" : "lint.xml")
xmlReport true
checkAllWarnings false
warningsAsErrors false
checkDependencies false
checkTestSources false
checkGeneratedSources false
// There's no point in slowing down assembling of release builds
// since we execute lint explicitly on CI in a separate action
checkReleaseBuilds false
}
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
}
final javaVersion = JavaVersion.toVersion(libs.versions.java.get())
compileOptions {
sourceCompatibility javaVersion
targetCompatibility javaVersion
}
kotlinOptions {
jvmTarget = javaVersion.toString()
// disable Kotlin warnings for Coroutines, working with the annotation @OptIn(DelicateCoroutinesApi::class)
freeCompilerArgs += [
"-opt-in=kotlin.RequiresOptIn"
]
kotlinOptions.allWarningsAsErrors = true
}
composeOptions {
kotlinCompilerExtensionVersion libs.versions.compose.kotlin.compiler.get()
}
testOptions {
animationsDisabled = true
}
packagingOptions {
resources {
excludes += [
"META-INF/rxjava.properties",
"META-INF/AL2.0",
"META-INF/LGPL2.1",
"META-INF/licenses/ASM",
// Fixes issue running './gradlew connectedDebugAndroidTest' with clashing testing libraries.
"**/attach_hotspot_windows.dll"
]
}
}
ksp {
arg("skipPrivatePreviews", "true")
}
signingConfigs {
debug {
storeFile file("${rootDir.path}/debug.keystore")
storePassword "debugkey"
keyAlias "debugkey"
keyPassword "debugkey"
}
if (project.canSignRelease) {
release {
storeFile = project.storeFile
storePassword = project.storePassword
keyAlias = project.keyAlias
keyPassword = project.keyPassword
}
}
}
buildTypes {
debug {
pseudoLocalesEnabled true
testCoverageEnabled false
ext.alwaysUpdateBuildId = false
buildConfigField "String", "SERVER_MAIN_URL", "\"https://refresh.pocketcasts.net\""
buildConfigField "String", "SERVER_API_URL", "\"https://api.pocketcasts.net\""
buildConfigField "String", "SERVER_CACHE_URL", "\"https://podcast-api.pocketcasts.net\""
buildConfigField "String", "SERVER_STATIC_URL", "\"https://static.pocketcasts.net\""
buildConfigField "String", "SERVER_SHARING_URL", "\"https://sharing.pocketcasts.net\""
buildConfigField "String", "SERVER_SHORT_URL", "\"https://pcast.pocketcasts.net\""
buildConfigField "String", "WEB_BASE_HOST", "\"pocket-casts-main-development.mystagingwebsite.com\""
buildConfigField "String", "SERVER_LIST_URL", "\"https://lists.pocketcasts.net\""
buildConfigField "String", "SERVER_LIST_HOST", "\"lists.pocketcasts.net\""
signingConfig signingConfigs.debug
}
debugProd {
debuggable true
testCoverageEnabled false
ext.alwaysUpdateBuildId = false
buildConfigField "String", "SERVER_MAIN_URL", SERVER_MAIN_URL_PROD
buildConfigField "String", "SERVER_API_URL", SERVER_API_URL_PROD
buildConfigField "String", "SERVER_CACHE_URL", SERVER_CACHE_URL_PROD
buildConfigField "String", "SERVER_STATIC_URL", SERVER_STATIC_URL_PROD
buildConfigField "String", "SERVER_SHARING_URL", SERVER_SHARING_URL_PROD
buildConfigField "String", "SERVER_SHORT_URL", SERVER_SHORT_URL_PROD
buildConfigField "String", "WEB_BASE_HOST", WEB_BASE_HOST_PROD
buildConfigField "String", "SERVER_LIST_URL", SERVER_LIST_URL_PROD
buildConfigField "String", "SERVER_LIST_HOST", SERVER_LIST_HOST_PROD
signingConfig signingConfigs.debug
}
release {
minifyEnabled false
debuggable false
proguardFiles getDefaultProguardFile("proguard-android.txt"), "$rootProject.rootDir.absolutePath/app/proguard-rules.pro"
buildConfigField "String", "SERVER_MAIN_URL", SERVER_MAIN_URL_PROD
buildConfigField "String", "SERVER_API_URL", SERVER_API_URL_PROD
buildConfigField "String", "SERVER_CACHE_URL", SERVER_CACHE_URL_PROD
buildConfigField "String", "SERVER_STATIC_URL", SERVER_STATIC_URL_PROD
buildConfigField "String", "SERVER_SHARING_URL", SERVER_SHARING_URL_PROD
buildConfigField "String", "SERVER_SHORT_URL", SERVER_SHORT_URL_PROD
buildConfigField "String", "WEB_BASE_HOST", WEB_BASE_HOST_PROD
buildConfigField "String", "SERVER_LIST_URL", SERVER_LIST_URL_PROD
buildConfigField "String", "SERVER_LIST_HOST", SERVER_LIST_HOST_PROD
if (project.canSignRelease) {
signingConfig signingConfigs.release
}
}
}
}
dependencies {
// Uncomment if you want to run with leak canary
// debugImplementation libs.leakcanary
// debugProdImplementation libs.leakcanary
implementation libs.bundles.billing
implementation libs.bundles.coroutines
implementation libs.bundles.firebase
implementation libs.bundles.hilt
implementation libs.bundles.lifecycle
implementation libs.bundles.lottie
implementation libs.bundles.media3
implementation libs.bundles.moshi
implementation libs.bundles.navigation
implementation libs.bundles.okhttp
implementation libs.bundles.protobuf
implementation libs.bundles.retrofit
implementation libs.bundles.rxjava
implementation libs.bundles.work
implementation platform(libs.compose.bom)
androidTestImplementation platform(libs.compose.bom)
implementation platform(libs.firebase.bom)
implementation libs.appcompat
implementation libs.auth
implementation libs.browser
implementation libs.browser.helper
implementation libs.car
implementation libs.cardview
implementation libs.cast
implementation libs.coil
implementation libs.coil.compose
implementation libs.bundles.compose
implementation libs.constraintlayout
implementation libs.core.ktx
implementation libs.device.names
implementation libs.flexbox
implementation libs.fragment.ktx
implementation libs.glide
implementation libs.glide.okhttp
implementation libs.guava
implementation libs.material
implementation libs.material.dialogs
implementation libs.material.progressbar
implementation libs.mediarouter
implementation libs.oss.licenses
implementation libs.palette
implementation libs.play.review
implementation libs.play.services.wearable
implementation libs.preference
implementation libs.preference.ktx
implementation libs.recyclerview
implementation(libs.retrofit.protobuf) {
exclude group: "com.google.protobuf", module: "protobuf-java"
}
implementation libs.showkase
implementation libs.swiperefreshlayout
implementation libs.timber
implementation libs.viewpager
ksp libs.moshi.kotlin.codegen
ksp libs.glide.compiler
ksp libs.showkase.processor
ksp libs.hilt.compiler
ksp libs.dagger.hilt.compiler
debugImplementation libs.compose.ui.test.manifest
debugImplementation libs.compose.ui.tooling
debugProdImplementation libs.compose.ui.test.manifest
debugProdImplementation libs.compose.ui.tooling
androidTestImplementation libs.accessibility.test.framework
androidTestImplementation libs.annotation
androidTestImplementation(libs.barista) {
exclude group: "org.jetbrains.kotlin"
}
androidTestImplementation libs.bundles.espresso
androidTestImplementation libs.bundles.test
androidTestImplementation libs.compose.ui.test.junit4
androidTestImplementation libs.jsonassert
androidTestImplementation libs.mockito.android
androidTestImplementation libs.mockito.kotlin
androidTestImplementation libs.navigation.testing
androidTestImplementation libs.okHttp.mockwebserver
androidTestImplementation libs.room.testing
androidTestImplementation libs.uiautomator
androidTestImplementation libs.work.test
androidTestImplementation libs.turbine
testImplementation libs.arch.core
testImplementation libs.coroutines.test
testImplementation libs.jsonassert
testImplementation (libs.junit) {
exclude group: "org.hamcrest"
}
testImplementation libs.mockito.inline
testImplementation libs.mockito.kotlin
testImplementation libs.okHttp.mockwebserver
testImplementation libs.turbine
testImplementation libs.lifecycle.runtime.testing
coreLibraryDesugaring libs.desugar.jdk
}
// Exclude the Timber integration from the Sentry Android SDK temporarily.
// Exclude the NDK from the Sentry Android SDK as we don't use it and Tracks includes it.
configurations.configureEach {
exclude group: "io.sentry", module: "sentry-android-timber"
exclude group: "io.sentry", module: "sentry-android-ndk"
}