-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
build.gradle
738 lines (662 loc) · 32.9 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
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
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 "com.google.dagger.hilt.android"
id "org.jetbrains.kotlinx.kover"
}
sentry {
tracingInstrumentation {
enabled = true
features = [io.sentry.android.gradle.extensions.InstrumentationFeature.DATABASE]
logcat {
enabled = false
}
}
autoInstallation {
enabled = false
}
}
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.gutenberg-mobile"
includeGroupByRegex "org.wordpress.react-native-libraries.*"
includeGroup "com.automattic"
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
}
namespace "org.wordpress.android"
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", "MANAGE_CATEGORIES", "false"
buildConfigField "boolean", "GLOBAL_STYLE_SUPPORT", "true"
buildConfigField "boolean", "QUICK_START_DYNAMIC_CARDS", "false"
buildConfigField "boolean", "RECOMMEND_THE_APP", "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", "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_BLAZE_FEATURE", "false"
buildConfigField "boolean", "WP_INDIVIDUAL_PLUGIN_OVERLAY", "false"
buildConfigField "boolean", "SITE_EDITOR_MVP", "false"
buildConfigField "boolean", "CONTACT_SUPPORT_CHATBOT", "false"
buildConfigField "boolean", "ENABLE_DOMAIN_MANAGEMENT_FEATURE", "false"
buildConfigField "boolean", "PLANS_IN_SITE_CREATION", "false"
buildConfigField "boolean", "READER_IMPROVEMENTS", "false"
buildConfigField "boolean", "BLOGANUARY_DASHBOARD_NUDGE", "false"
buildConfigField "boolean", "IN_APP_REVIEWS", "false"
buildConfigField "boolean", "DYNAMIC_DASHBOARD_CARDS", "false"
buildConfigField "boolean", "STATS_TRAFFIC_TAB", "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_FOLLOWED_SITES_SETTINGS", "true"
buildConfigField "boolean", "ENABLE_WHATS_NEW_FEATURE", "true"
buildConfigField "boolean", "ENABLE_QRCODE_AUTH_FLOW", "true"
buildConfigField "boolean", "ENABLE_OPEN_WEB_LINKS_WITH_JP_FLOW", "true"
buildConfigField "boolean", "BLAZE_MANAGE_CAMPAIGNS", "false"
buildConfigField "boolean", "DASHBOARD_PERSONALIZATION", "false"
buildConfigField "boolean", "ENABLE_SITE_MONITORING", "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"
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_FOLLOWED_SITES_SETTINGS", "true"
buildConfigField "boolean", "ENABLE_WHATS_NEW_FEATURE", "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"
manifestPlaceholders = [magicLinkScheme:"jetpack"]
// Limit string resources to Mag16 only for Jetpack
// Note 1: 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"]
// Note 2: `in` is the legacy locale code for `id` and `iw` is the legacy locale code for `he`.
// We need to include those to make sure users with older Android versions and still using those legacy codes still have those translations show up at runtime.
resourceConfigurations += ["in", "iw"]
}
// 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
}
}
lint {
warningsAsErrors = true
checkDependencies = true
checkGeneratedSources = true
lintConfig file("${project.rootDir}/config/lint/lint.xml")
baseline file("${project.rootDir}/config/lint/baseline.xml")
enable += 'UnknownNullness'
}
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 {
buildConfig true
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}\""
}
}
kapt {
// Enable to infer error types in stubs (see: https://kotlinlang.org/docs/kapt.html#non-existent-type-correction)
correctErrorTypes true
}
dependencies {
implementation 'androidx.webkit:webkit:1.10.0'
implementation "androidx.navigation:navigation-compose:$androidxComposeNavigationVersion"
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.tracksBinaryPath") {
version {
strictly automatticTracksVersion
}
}
implementation ("com.automattic:rest:$automatticRestVersion") {
exclude group: 'com.mcxiaoke.volley'
}
implementation "org.wordpress:persistentedittext:$wordPressPersistentEditTextVersion"
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.activity:activity-compose:$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.webkit:webkit:$androidxWebkitVersion"
implementation "androidx.constraintlayout:constraintlayout:$androidxConstraintlayoutVersion"
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.android.play:review:$googlePlayReviewVersion"
implementation "com.google.android.play:review-ktx:$googlePlayReviewVersion"
implementation "com.google.android.gms:play-services-auth:$googlePlayServicesAuthVersion"
implementation "com.google.mlkit:barcode-scanning-common:$googleMLKitBarcodeScanningCommonVersion"
implementation "com.google.mlkit:text-recognition:$googleMLKitTextRecognitionVersion"
implementation "com.google.mlkit:barcode-scanning:$googleMLKitBarcodeScanningVersion"
// CameraX
implementation "androidx.camera:camera-camera2:$androidxCameraVersion"
implementation "androidx.camera:camera-lifecycle:$androidxCameraVersion"
implementation "androidx.camera:camera-view:$androidxCameraVersion"
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.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:$glideVersion"
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("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", {
version {
strictly androidxTestEspressoVersion
}
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation("androidx.test.espresso:espresso-contrib:$androidxTestEspressoVersion") {
version {
strictly 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") {
version {
strictly 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"
// Enables Java 8+ API desugaring support
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$androidDesugarVersion"
lintChecks "org.wordpress:lint:$wordPressLintVersion"
// Firebase
def firebaseBom = platform("com.google.firebase:firebase-bom:$firebaseBomVersion")
implementation(firebaseBom)
// Firebase - Main
implementation "com.google.firebase:firebase-messaging"
// Firebase - Deprecated
implementation "com.google.firebase:firebase-iid:$firebaseIidVersion"
// Jetpack Compose
def composeBom = platform("androidx.compose:compose-bom:$androidxComposeBomVersion")
implementation(composeBom)
androidTestImplementation(composeBom)
// - Jetpack Compose - Android Studio
debugImplementation "androidx.compose.ui:ui-test-manifest"
debugImplementation "androidx.compose.ui:ui-tooling"
// - Jetpack Compose - Main
implementation "androidx.compose.runtime:runtime"
implementation "androidx.compose.runtime:runtime-livedata"
implementation "androidx.compose.foundation:foundation"
implementation "androidx.compose.foundation:foundation-layout"
implementation "androidx.compose.ui:ui"
implementation "androidx.compose.ui:ui-graphics"
implementation "androidx.compose.ui:ui-text"
implementation "androidx.compose.ui:ui-unit"
implementation "androidx.compose.ui:ui-tooling-preview"
implementation "androidx.compose.material:material"
// - Jetpack Compose - AndroidX
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$androidxLifecycleVersion"
implementation "androidx.constraintlayout:constraintlayout-compose:$androidxConstraintlayoutComposeVersion"
// - Jetpack Compose - Other
implementation "io.coil-kt:coil-compose:$coilComposeVersion"
implementation "com.airbnb.android:lottie-compose:$lottieVersion"
// - Jetpack Compose - UI Tests
androidTestImplementation "androidx.compose.ui:ui-test-junit4"
implementation "androidx.compose.material3:material3:$androidxComposeMaterial3Version"
// Cascade - Compose nested menu
implementation "me.saket.cascade:cascade-compose:2.3.0"
// - Flipper
debugImplementation ("com.facebook.flipper:flipper:$flipperVersion") {
exclude group:'org.jetbrains.kotlinx', module:'kotlinx-serialization-json-jvm'
}
debugImplementation "com.facebook.soloader:soloader:$soLoaderVersion"
debugImplementation ("com.facebook.flipper:flipper-network-plugin:$flipperVersion"){
exclude group:'org.jetbrains.kotlinx', module:'kotlinx-serialization-json-jvm'
}
releaseImplementation "com.facebook.flipper:flipper-noop:$flipperVersion"
}
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 = """
<details><summary>The PR caused some dependency changes (expand to see details)</summary>
<p>
```diff
{{{violation.message}}}
```
</p>
</details>
*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
}
}
}
}
}
// Copy React Native JavaScript bundle and source map so they can be upload it to the Crash logging
// service during the build process.
android {
applicationVariants.all { variant ->
variant.mergeAssetsProvider.configure {
doLast {
// Copy bundle and source map files
copy {
from(outputDir)
into("${buildDir}/react-native-bundle-source-map")
include("*.bundle", "*.bundle.map")
}
// Delete source maps
delete(fileTree(dir: outputDir, includes: ['**/*.bundle.map']))
}
}
}
}