-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
build.gradle
655 lines (589 loc) · 31 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
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
import se.bjurr.violations.comments.github.plugin.gradle.ViolationCommentsToGitHubTask
import se.bjurr.violations.lib.model.SEVERITY
plugins {
id "com.android.application"
id "org.jetbrains.kotlin.android"
id "org.jetbrains.kotlin.kapt"
id "org.jetbrains.kotlin.plugin.parcelize"
id "org.jetbrains.kotlin.plugin.allopen"
id "io.sentry.android.gradle"
id "se.bjurr.violations.violation-comments-to-github-gradle-plugin"
id "com.google.gms.google-services"
id 'dagger.hilt.android.plugin'
}
repositories {
maven {
url "https://a8c-libs.s3.amazonaws.com/android"
content {
includeGroup "org.wordpress"
includeGroup "org.wordpress.aztec"
includeGroup "org.wordpress.fluxc"
includeGroup "org.wordpress.wellsql"
includeGroup "org.wordpress-mobile"
includeGroup "org.wordpress-mobile.gutenberg-mobile"
includeGroupByRegex "org.wordpress-mobile.react-native-libraries.*"
includeGroup "com.automattic"
includeGroup "com.automattic.stories"
includeGroup "com.automattic.tracks"
}
}
maven {
url "https://a8c-libs.s3.amazonaws.com/android/react-native-mirror"
content {
includeGroup "com.facebook.react"
}
}
maven {
url 'https://zendesk.jfrog.io/zendesk/repo'
content {
includeGroup "com.zendesk"
includeGroup "com.zendesk.belvedere2"
}
}
google()
mavenCentral()
maven { url "https://www.jitpack.io" }
}
allOpen {
// allows mocking for classes w/o directly opening them for release builds
annotation 'org.wordpress.android.testing.OpenClassAnnotation'
}
android {
useLibrary 'android.test.runner'
useLibrary 'android.test.base'
useLibrary 'android.test.mock'
dexOptions {
jumboMode = true
dexInProcess = true
}
compileSdkVersion rootProject.compileSdkVersion
def versionProperties = loadPropertiesFromFile(file("${rootDir}/version.properties"))
defaultConfig {
applicationId "org.wordpress.android"
archivesBaseName = "$applicationId"
versionName project.findProperty("prototypeBuildVersionName") ?: versionProperties.getProperty("versionName")
versionCode versionProperties.getProperty("versionCode").toInteger()
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
testInstrumentationRunner 'org.wordpress.android.WordPressTestRunner'
buildConfigField "boolean", "OFFER_GUTENBERG", "true"
buildConfigField "long", "REMOTE_CONFIG_FETCH_INTERVAL", "10"
buildConfigField "boolean", "FEATURE_ANNOUNCEMENT_AVAILABLE", "false"
buildConfigField "boolean", "ENABLE_DEBUG_SETTINGS", "true"
buildConfigField "boolean", "SEEN_UNSEEN_WITH_COUNTER", "false"
buildConfigField "boolean", "LIKES_ENHANCEMENTS", "false"
buildConfigField "boolean", "IS_JETPACK_APP", "false"
buildConfigField "String", "TRACKS_EVENT_PREFIX", '"wpandroid_"'
buildConfigField "String", "PUSH_NOTIFICATIONS_APP_KEY", '"org.wordpress.android"'
buildConfigField "boolean", "MP4_COMPOSER_VIDEO_OPTIMIZATION", "false"
buildConfigField "boolean", "BLOGGING_REMINDERS", "false"
buildConfigField "boolean", "MANAGE_CATEGORIES", "false"
buildConfigField "boolean", "GLOBAL_STYLE_SUPPORT", "true"
buildConfigField "boolean", "QUICK_START_DYNAMIC_CARDS", "false"
buildConfigField "boolean", "SITE_DOMAINS", "false"
buildConfigField "boolean", "RECOMMEND_THE_APP", "false"
buildConfigField "boolean", "UNIFIED_COMMENTS_COMMENT_EDIT", "false"
buildConfigField "boolean", "MY_SITE_DASHBOARD_TODAYS_STATS_CARD", "false"
buildConfigField "boolean", "MY_SITE_DASHBOARD_TABS", "false"
buildConfigField "boolean", "UNIFIED_COMMENTS_DETAILS", "false"
buildConfigField "boolean", "COMMENTS_SNIPPET", "false"
buildConfigField "boolean", "READER_COMMENTS_MODERATION", "false"
buildConfigField "boolean", "SITE_INTENT_QUESTION", "true"
buildConfigField "boolean", "SITE_NAME", "false"
buildConfigField "boolean", "LANDING_SCREEN_REVAMP", "true"
buildConfigField "boolean", "LAND_ON_THE_EDITOR", "false"
buildConfigField "boolean", "BLOGGING_PROMPTS", "false"
buildConfigField "boolean", "BLOGGING_PROMPTS_LIST", "false"
buildConfigField "boolean", "BLOGGING_PROMPTS_ENHANCEMENTS", "false"
buildConfigField "boolean", "BLOGGING_PROMPTS_SOCIAL", "false"
buildConfigField "boolean", "QUICK_START_EXISTING_USERS_V2", "false"
buildConfigField "boolean", "QRCODE_AUTH_FLOW", "false"
buildConfigField "boolean", "BETA_SITE_DESIGNS", "false"
buildConfigField "boolean", "JETPACK_POWERED", "true"
buildConfigField "boolean", "JETPACK_POWERED_BOTTOM_SHEET", "true"
buildConfigField "boolean", "JETPACK_SHARED_LOGIN", "true"
buildConfigField "boolean", "JETPACK_LOCAL_USER_FLAGS", "true"
buildConfigField "boolean", "JETPACK_BLOGGING_REMINDERS_SYNC", "true"
buildConfigField "boolean", "JETPACK_READER_SAVED_POSTS", "true"
buildConfigField "boolean", "JETPACK_PROVIDER_SYNC", "true"
buildConfigField "boolean", "JETPACK_MIGRATION_FLOW", "true"
buildConfigField "boolean", "JETPACK_FEATURE_REMOVAL_PHASE_ONE", "false"
buildConfigField "boolean", "JETPACK_FEATURE_REMOVAL_PHASE_TWO", "false"
buildConfigField "boolean", "JETPACK_FEATURE_REMOVAL_PHASE_THREE", "false"
buildConfigField "boolean", "JETPACK_FEATURE_REMOVAL_PHASE_FOUR", "false"
buildConfigField "boolean", "JETPACK_FEATURE_REMOVAL_NEW_USERS", "false"
buildConfigField "boolean", "JETPACK_FEATURE_REMOVAL_STATIC_POSTERS", "false"
buildConfigField "boolean", "JETPACK_FEATURE_REMOVAL_SELF_HOSTED_USERS", "false"
buildConfigField "boolean", "PREVENT_DUPLICATE_NOTIFS_REMOTE_FIELD", "false"
buildConfigField "boolean", "OPEN_WEB_LINKS_WITH_JETPACK_FLOW", "false"
buildConfigField "boolean", "ENABLE_WORDPRESS_SUPPORT_FORUM", "false"
buildConfigField "boolean", "JETPACK_INSTALL_FULL_PLUGIN", "false"
buildConfigField "boolean", "ENABLE_BLAZE_FEATURE", "false"
buildConfigField "boolean", "WP_INDIVIDUAL_PLUGIN_OVERLAY", "false"
buildConfigField "boolean", "DASHBOARD_CARD_PAGES", "false"
buildConfigField "boolean", "DASHBOARD_CARD_ACTIVITY_LOG", "false"
buildConfigField "boolean", "DASHBOARD_CARD_DOMAIN", "false"
// Override these constants in jetpack product flavor to enable/ disable features
buildConfigField "boolean", "ENABLE_SITE_CREATION", "true"
buildConfigField "boolean", "ENABLE_ADD_SELF_HOSTED_SITE", "true"
buildConfigField "boolean", "ENABLE_SIGNUP", "true"
buildConfigField "boolean", "ENABLE_READER", "true"
buildConfigField "boolean", "ENABLE_CREATE_FAB", "true"
buildConfigField "boolean", "ENABLE_QUICK_ACTION", "true"
buildConfigField "boolean", "ENABLE_FOLLOWED_SITES_SETTINGS", "true"
buildConfigField "boolean", "ENABLE_WHATS_NEW_FEATURE", "true"
buildConfigField "boolean", "ENABLE_MY_SITE_DASHBOARD_TABS", "true"
buildConfigField "boolean", "ENABLE_QRCODE_AUTH_FLOW", "true"
buildConfigField "boolean", "ENABLE_OPEN_WEB_LINKS_WITH_JP_FLOW", "true"
buildConfigField "boolean", "ENABLE_SITE_CREATION_DOMAIN_PURCHASING", "false"
manifestPlaceholders = [magicLinkScheme:"wordpress"]
}
// Gutenberg's dependency - react-native-video is using
// Java API 1.8
compileOptions {
// Enables Java 8+ API desugaring support
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
flavorDimensions "app", "buildType"
productFlavors {
wordpress {
isDefault true
dimension "app"
applicationId "org.wordpress.android"
buildConfigField "boolean", "IS_JETPACK_APP", "false"
buildConfigField "String", "TRACKS_EVENT_PREFIX", '"wpandroid_"'
buildConfigField "String", "PUSH_NOTIFICATIONS_APP_KEY", '"org.wordpress.android"'
buildConfigField "boolean", "ENABLE_QRCODE_AUTH_FLOW", "false"
buildConfigField "boolean", "ENABLE_OPEN_WEB_LINKS_WITH_JP_FLOW", "true"
buildConfigField "boolean", "ENABLE_SITE_CREATION_DOMAIN_PURCHASING", "false"
manifestPlaceholders = [magicLinkScheme:"wordpress"]
}
jetpack {
dimension "app"
applicationId "com.jetpack.android"
buildConfigField "boolean", "IS_JETPACK_APP", "true"
buildConfigField "boolean", "ENABLE_SITE_CREATION", "true"
buildConfigField "boolean", "ENABLE_ADD_SELF_HOSTED_SITE", "true"
buildConfigField "boolean", "ENABLE_SIGNUP", "true"
buildConfigField "boolean", "ENABLE_READER", "true"
buildConfigField "boolean", "ENABLE_CREATE_FAB", "true"
buildConfigField "boolean", "ENABLE_QUICK_ACTION", "true"
buildConfigField "boolean", "ENABLE_FOLLOWED_SITES_SETTINGS", "true"
buildConfigField "boolean", "ENABLE_WHATS_NEW_FEATURE", "true"
buildConfigField "boolean", "ENABLE_MY_SITE_DASHBOARD_TABS", "true"
buildConfigField "String", "TRACKS_EVENT_PREFIX", '"jpandroid_"'
buildConfigField "String", "PUSH_NOTIFICATIONS_APP_KEY", '"com.jetpack.android"'
buildConfigField "boolean", "ENABLE_QRCODE_AUTH_FLOW", "true"
buildConfigField "boolean", "ENABLE_OPEN_WEB_LINKS_WITH_JP_FLOW", "false"
buildConfigField "boolean", "ENABLE_SITE_CREATION_DOMAIN_PURCHASING", "false"
manifestPlaceholders = [magicLinkScheme:"jetpack"]
// Limit string resources to Mag16 only for Jetpack
// Note: this only affects included _locales_; variants for `values-night`, `values-land` and other configs are _still_ preserved in Jetpack and not filtered by this.
resourceConfigurations = ["ar", "de", "es", "fr", "he", "id", "it", "ja", "ko", "nl", "pt-rBR", "ru", "sv", "tr", "zh-rCN", "zh-rTW"]
}
// Used for release/beta testing builds. Usually shouldn't be build locally.
// AppName: WordPress/Jetpack
vanilla {
dimension "buildType"
buildConfigField "boolean", "ME_ACTIVITY_AVAILABLE", "false"
buildConfigField "long", "REMOTE_CONFIG_FETCH_INTERVAL", "3600"
buildConfigField "boolean", "ENABLE_DEBUG_SETTINGS", "false"
}
// Used for local development - preferred variant for developers.
// AppName: WordPress Beta/Jetpack Beta
wasabi {
applicationIdSuffix ".beta"
dimension "buildType"
}
// Used for CI builds on PRs (aka "Prototype Builds"). Can be used locally when a developer needs to install multiple versions of the app on the same device.
// AppName: WordPress Pre-Alpha/Jetpack Pre-Alpha
jalapeno {
isDefault true
applicationIdSuffix ".prealpha"
dimension "buildType"
}
// Also dynamically add additional `buildConfigFields` to our app flavors from any `wp.`/`jp.`-prefixed property in `gradle.properties`
def properties = loadPropertiesFromFile(checkGradlePropertiesFile())
addBuildConfigFieldsFromPrefixedProperties(wordpress, properties, ['wp'])
addBuildConfigFieldsFromPrefixedProperties(jetpack, properties, ['wp', 'jp']) // Inherit same properties used from WP first then overwrite with JP-specific ones
}
buildTypes {
release {
// Proguard is used to shrink our apk, and reduce the number of methods in our final apk,
// but we don't obfuscate the bytecode.
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
}
debug {
minifyEnabled false
buildConfigField "String", "APP_PN_KEY", "\"org.wordpress.android.debug.build\""
pseudoLocalesEnabled true
}
}
testOptions {
animationsDisabled = true
unitTests {
includeAndroidResources = true
returnDefaultValues = true
}
}
lintOptions{
warningsAsErrors = true
checkDependencies = true
checkGeneratedSources = true
lintConfig file("${project.rootDir}/config/lint/lint.xml")
baseline file("${project.rootDir}/config/lint/baseline.xml")
}
packagingOptions {
// MPAndroidChart uses androidX - remove this line when we migrate everything to androidX
exclude 'META-INF/proguard/androidx-annotations.pro'
// Exclude React Native's JSC and Fabric JNI
exclude '**/libjscexecutor.so'
exclude '**/libfabricjni.so'
// Avoid React Native's JNI duplicated classes
pickFirst '**/libc++_shared.so'
pickFirst '**/libfbjni.so'
pickFirst 'META-INF/-no-jdk.kotlin_module'
}
bundle {
language {
// Don't split language resources for App Bundles.
// This is required to switch language in app.
enableSplit = false
}
}
buildFeatures {
viewBinding true
compose true
composeOptions {
kotlinCompilerExtensionVersion = androidxComposeCompilerVersion
}
}
}
/// Dynamically add `buildConfigFields` on a given variant/flavor from prefixed properties
/// (This is used to e.g. add every property prefixed `wp.` in `gradle.properties` as a BuildConfigField in the `wordpress` flavor)
///
/// `prefixes` is an array of prefixes to search for, without their `.` dot (e.g. `["wp", "jp"]`).
/// Properties found with prefixes first in that array will be overridden by the ones found with prefixes later in the array.
static def addBuildConfigFieldsFromPrefixedProperties(variant, properties, prefixes) {
// Build a Map of prefixed properties found. Keys in this Map will be lowercased and `.` replaced by `_`
def fields_map = [:]
prefixes.each { prefix ->
properties.each { property ->
if (property.key.toLowerCase().startsWith("${prefix.toLowerCase()}.")) {
def key = property.key.toLowerCase().replace("${prefix.toLowerCase()}.", "").replace(".", "_")
fields_map[key] = property.value
}
}
}
// Then define the found properties as buildConfigFields
fields_map.each {
variant.buildConfigField "String", it.key.toUpperCase(), "\"${it.value}\""
}
}
dependencies {
compileOnly project(path: ':libs:annotations')
kapt project(':libs:processors')
implementation (project(path:':libs:networking')) {
exclude group: "com.android.volley"
exclude group: 'org.wordpress', module: 'utils'
}
implementation (project(path:':libs:analytics')) {
exclude group: 'org.wordpress', module: 'utils'
}
implementation project(path:':libs:image-editor')
implementation (project(path:':libs:editor')) {
exclude group: 'org.wordpress', module: 'utils'
}
implementation("$gradle.ext.fluxCBinaryPath") {
version {
strictly wordPressFluxCVersion
}
exclude group: "com.android.volley"
exclude group: 'org.wordpress', module: 'utils'
exclude group: 'com.android.support', module: 'support-annotations'
}
implementation ("$gradle.ext.wputilsBinaryPath") {
version {
strictly wordPressUtilsVersion
}
}
implementation ("$gradle.ext.loginFlowBinaryPath:$wordPressLoginVersion") {
exclude group: 'com.github.bumptech.glide'
exclude group: 'org.wordpress', module: 'utils'
}
implementation "$gradle.ext.aboutAutomatticBinaryPath:$automatticAboutVersion"
implementation ("$gradle.ext.storiesAndroidPath:$automatticStoriesVersion") {
exclude group: 'androidx.navigation', module: 'navigation-fragment-ktx'
exclude group: 'androidx.navigation', module: 'navigation-ui-ktx'
}
implementation "$gradle.ext.storiesAndroidMp4ComposePath:$automatticStoriesVersion"
implementation "com.automattic:Automattic-Tracks-Android:$automatticTracksVersion"
implementation ("com.automattic:rest:$automatticRestVersion") {
exclude group: 'com.mcxiaoke.volley'
}
implementation "org.wordpress:persistentedittext:$wordPressPersistentEditTextVersion"
// To enable Android Studio specific features for Jetpack Compose.
debugImplementation "androidx.compose.ui:ui-test-manifest:$androidxComposeVersion"
debugImplementation "androidx.compose.ui:ui-tooling:$androidxComposeVersion"
implementation "androidx.compose.ui:ui-tooling-preview:$androidxComposeVersion"
// To enable Stetho, a debug bridge that enables the Chrome Developer Tools for debug purposes.
debugImplementation "com.facebook.stetho:stetho:$stethoVersion"
debugImplementation "com.facebook.stetho:stetho-okhttp3:$stethoVersion"
implementation "androidx.arch.core:core-common:$androidxArchCoreVersion"
implementation "androidx.arch.core:core-runtime:$androidxArchCoreVersion"
implementation "com.google.code.gson:gson:$googleGsonVersion"
implementation "androidx.core:core:$androidxCoreVersion"
implementation "androidx.core:core-ktx:$androidxCoreVersion"
implementation "androidx.lifecycle:lifecycle-common:$androidxLifecycleVersion"
implementation "androidx.lifecycle:lifecycle-runtime:$androidxLifecycleVersion"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$androidxLifecycleVersion"
implementation "androidx.activity:activity:$androidxActivityVersion"
implementation "androidx.activity:activity-ktx:$androidxActivityVersion"
implementation "androidx.fragment:fragment:$androidxFragmentVersion"
implementation "androidx.fragment:fragment-ktx:$androidxFragmentVersion"
implementation "androidx.appcompat:appcompat:$androidxAppcompatVersion"
implementation "androidx.appcompat:appcompat-resources:$androidxAppcompatVersion"
implementation "androidx.cardview:cardview:$androidxCardviewVersion"
implementation "androidx.recyclerview:recyclerview:$androidxRecyclerviewVersion"
implementation "com.google.android.material:material:$googleMaterialVersion"
implementation "com.google.android.flexbox:flexbox:$googleFlexboxlayoutVersion"
implementation "androidx.percentlayout:percentlayout:$androidxPercentlayoutVersion"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:$androidxSwipeToRefreshVersion"
implementation "androidx.preference:preference:$androidxPreferenceVersion"
implementation "androidx.work:work-runtime:$androidxWorkManagerVersion"
implementation "androidx.work:work-runtime-ktx:$androidxWorkManagerVersion"
implementation "androidx.constraintlayout:constraintlayout:$androidxConstraintlayoutVersion"
implementation "androidx.constraintlayout:constraintlayout-compose:$androidxConstraintlayoutComposeVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel:$androidxLifecycleVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$androidxLifecycleVersion"
implementation "androidx.lifecycle:lifecycle-livedata-core:$androidxLifecycleVersion"
implementation "androidx.lifecycle:lifecycle-livedata:$androidxLifecycleVersion"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$androidxLifecycleVersion"
implementation "androidx.lifecycle:lifecycle-process:$androidxLifecycleVersion"
implementation "com.android.volley:volley:$androidVolleyVersion"
implementation "com.google.firebase:firebase-messaging:$firebaseMessagingVersion"
implementation "com.google.firebase:firebase-config:$firebaseConfigVersion"
implementation "com.google.android.gms:play-services-auth:$googlePlayServicesAuthVersion"
implementation "com.google.android.gms:play-services-code-scanner:$googlePlayServicesCodeScannerVersion"
implementation "com.google.mlkit:barcode-scanning-common:$googleMLKitBarcodeScanningVersion"
implementation "com.android.installreferrer:installreferrer:$androidInstallReferrerVersion"
implementation "com.github.chrisbanes:PhotoView:$chrisbanesPhotoviewVersion"
implementation "org.greenrobot:eventbus:$eventBusVersion"
implementation "org.greenrobot:eventbus-java:$eventBusVersion"
implementation "com.squareup.okio:okio:$squareupOkioVersion"
implementation "com.squareup.retrofit2:retrofit:$squareupRetrofitVersion"
implementation "org.apache.commons:commons-text:$apacheCommonsTextVersion"
implementation "com.airbnb.android:lottie:$lottieVersion"
implementation "com.airbnb.android:lottie-compose:$lottieVersion"
implementation "com.facebook.shimmer:shimmer:$facebookShimmerVersion"
implementation ("com.github.yalantis:ucrop:$uCropVersion") {
exclude group: 'androidx.core', module: 'core'
exclude group: 'androidx.constraintlayout', module: 'constraintlayout'
exclude group: 'androidx.appcompat', module: 'appcompat'
}
implementation "com.github.bumptech.glide:glide:$glideVersion"
kapt "com.github.bumptech.glide:compiler:$glideVersion"
implementation "com.github.bumptech.glide:volley-integration:$glideVolleyVersion"
implementation "androidx.compose.runtime:runtime:$androidxComposeVersion"
implementation "androidx.compose.runtime:runtime-livedata:$androidxComposeVersion"
implementation "androidx.compose.foundation:foundation:$androidxComposeVersion"
implementation "androidx.compose.foundation:foundation-layout:$androidxComposeVersion"
implementation "androidx.compose.ui:ui:$androidxComposeVersion"
implementation "androidx.compose.ui:ui-graphics:$androidxComposeVersion"
implementation "androidx.compose.ui:ui-text:$androidxComposeVersion"
implementation "androidx.compose.ui:ui-unit:$androidxComposeVersion"
implementation "androidx.compose.material:material:$androidxComposeVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$androidxComposeLifecycleVersion"
implementation "io.coil-kt:coil-compose:$coilComposeVersion"
implementation "com.github.indexos.media-for-mobile:domain:$indexosMediaForMobileVersion"
implementation "com.github.indexos.media-for-mobile:android:$indexosMediaForMobileVersion"
implementation "com.zendesk:support:$zendeskVersion"
implementation (name:'tenor-android-core-jetified', ext:'aar') // Jetified Tenor Gif library
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinxCoroutinesVersion"
implementation "com.github.PhilJay:MPAndroidChart:$philjayMpAndroidChartVersion"
implementation "org.jsoup:jsoup:$jsoupVersion"
implementation ("com.google.android.exoplayer:exoplayer:$googleExoPlayerVersion") {
exclude group: 'com.android.support', module: 'support-annotations'
}
implementation "com.google.dagger:dagger-android-support:$gradle.ext.daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$gradle.ext.daggerVersion"
implementation "com.google.dagger:hilt-android:$gradle.ext.daggerVersion"
kapt "com.google.dagger:hilt-compiler:$gradle.ext.daggerVersion"
testImplementation "$gradle.ext.storiesAndroidPhotoEditorPath:$automatticStoriesVersion"
testImplementation("androidx.arch.core:core-testing:$androidxArchCoreVersion", {
exclude group: 'com.android.support', module: 'support-compat'
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.android.support', module: 'support-core-utils'
})
testImplementation "junit:junit:$junitVersion"
testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$gradle.ext.kotlinVersion"
testImplementation "org.assertj:assertj-core:$assertjVersion"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinxCoroutinesVersion"
androidTestImplementation project(path:':libs:mocks')
androidTestImplementation "org.mockito:mockito-android:$mockitoVersion"
androidTestImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion"
androidTestImplementation "com.squareup.okhttp3:mockwebserver:$squareupMockWebServerVersion"
androidTestImplementation "androidx.test.uiautomator:uiautomator:$androidxTestUiAutomatorVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxTestEspressoVersion", {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation("androidx.test.espresso:espresso-contrib:$androidxTestEspressoVersion") {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
}
androidTestImplementation "androidx.test.espresso:espresso-accessibility:$androidxTestEspressoVersion"
androidTestImplementation("com.github.tomakehurst:wiremock:$wiremockVersion") {
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude group: 'org.apache.commons', module: 'commons-lang3'
exclude group: 'asm', module: 'asm'
exclude group: 'org.json', module: 'json'
}
androidTestImplementation "org.apache.httpcomponents:httpclient-android:$wiremockHttpClientVersion"
androidTestImplementation "androidx.test:runner:$androidxTestCoreVersion"
androidTestImplementation "androidx.test:rules:$androidxTestCoreVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxTestExtJunitVersion"
androidTestImplementation "tools.fastlane:screengrab:$screengrabVersion", {
exclude group: 'com.android.support.test.uiautomator', module: 'uiautomator-v18'
}
androidTestImplementation (name:'cloudtestingscreenshotter_lib', ext:'aar') // Screenshots on Firebase Cloud Testing
androidTestImplementation "androidx.work:work-testing:$androidxWorkManagerVersion"
androidTestImplementation "com.google.dagger:hilt-android-testing:$gradle.ext.daggerVersion"
kaptAndroidTest "com.google.dagger:hilt-android-compiler:$gradle.ext.daggerVersion"
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$androidxComposeVersion"
// Enables Java 8+ API desugaring support
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$androidDesugarVersion"
lintChecks "org.wordpress:lint:$wordPressLintVersion"
}
configurations.all {
// Exclude packaged wordpress sub projects, force the use of the source project
// (eg. use :libs:utils:WordPressUtils instead of 'org.wordpress:utils')
exclude group: 'org.wordpress', module: 'analytics'
}
// If Google services file doesn't exist, copy example file
if (!file("google-services.json").exists()) {
copy {
from(".")
into(".")
include("google-services.json-example")
rename('google-services.json-example', 'google-services.json')
}
}
// Print warning message if example Google services file is used.
if ((file('google-services.json').text) == (file('google-services.json-example').text)) {
println("WARNING: You're using the example google-services.json file. Google login will fail.")
}
tasks.register("violationCommentsToGitHub", ViolationCommentsToGitHubTask) {
repositoryOwner = "wordpress-mobile"
repositoryName = "WordPress-Android"
pullRequestId = System.properties['GITHUB_PULLREQUESTID']
username = System.properties['GITHUB_USERNAME']
password = System.properties['GITHUB_PASSWORD']
oAuth2Token = System.properties['GITHUB_OAUTH2TOKEN']
gitHubUrl = "https://api.github.com/"
createCommentWithAllSingleFileComments = false
createSingleFileComments = true
commentOnlyChangedContent = true
minSeverity = SEVERITY.INFO //ERROR, INFO, WARN
commentTemplate = """
**Reporter**: {{violation.reporter}}{{#violation.rule}}\n
**Rule**: {{violation.rule}}{{/violation.rule}}
**Severity**: {{violation.severity}}
**File**: {{violation.file}}:{{violation.startLine}}{{#violation.source}}
**Source**: {{violation.source}}{{/violation.source}}
{{violation.message}}
"""
violations = [
["CHECKSTYLE", ".", ".*/build/.*/checkstyle/.*\\.xml\$", "CheckStyle"],
["CHECKSTYLE", ".", ".*/build/.*/detekt/.*\\.xml\$", "Detekt"]
]
}
tasks.register("dependencyTreeDiffCommentToGitHub", ViolationCommentsToGitHubTask) {
repositoryOwner = "wordpress-mobile"
repositoryName = "WordPress-Android"
pullRequestId = System.properties['GITHUB_PULLREQUESTID']
oAuth2Token = System.properties['GITHUB_OAUTH2TOKEN']
gitHubUrl = "https://api.github.com/"
createCommentWithAllSingleFileComments = true
createSingleFileComments = false
commentOnlyChangedContent = true
commentOnlyChangedFiles = false
minSeverity = SEVERITY.INFO
commentTemplate = """
### The PR caused the following dependency changes:
```diff
{{{violation.message}}}
```
*Please review and act accordingly*
"""
violations = [
["GENERIC", ".", ".*/build/.*/diff/.*\\.txt\$", "DependenciesDiffChecker"],
]
}
tasks.register("printVersionName") {
doLast {
println android.defaultConfig.versionName
}
}
tasks.register("printAllVersions") {
doLast {
android.applicationVariants.all { variant ->
println "${variant.name}: ${variant.versionName} (${variant.versionCode})"
}
}
}
tasks.register("printResourceConfigurations") {
doLast {
android.productFlavors.each { flavor ->
if (flavor.dimension == "app") {
println "${flavor.name}: ${flavor.resourceConfigurations}"
}
}
}
}
def checkGradlePropertiesFile() {
def inputFile = file("${rootDir}/gradle.properties")
if (!inputFile.exists()) {
throw new StopActionException("Build configuration file gradle.properties doesn't exist, follow README instructions")
}
return inputFile
}
static def loadPropertiesFromFile(inputFile) {
def properties = new Properties()
inputFile.withInputStream { stream ->
properties.load(stream)
}
return properties
}
// For app signing
if (["uploadStoreFile", "uploadStorePassword", "uploadKeyAlias", "uploadKeyPassword"].count { !project.hasProperty(it) } == 0) {
android {
signingConfigs {
release {
storeFile = rootProject.file(project.uploadStoreFile)
storePassword = project.uploadStorePassword
keyAlias = project.uploadKeyAlias
keyPassword = project.uploadKeyPassword
}
}
}
android.buildTypes.release.signingConfig = android.signingConfigs.release
}
if (project.hasProperty("debugStoreFile")) {
def sharedDebugStore = file(project.debugStoreFile.replaceFirst("^~", System.getProperty("user.home")))
if (sharedDebugStore.exists()) {
android {
signingConfigs {
debug {
storeFile sharedDebugStore
}
}
}
}
}