From bf390a2bbf5a1f05a1054c0e50167e45614f3600 Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Mon, 12 Aug 2024 18:12:01 +0300 Subject: [PATCH 1/7] Deps: Update dependency analysis to 1.33.0 Release Notes: https://github.com/autonomousapps/ dependency-analysis-gradle-plugin/blob/main/CHANGELOG.md#version-1330 --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index d2d48423c..86c086e56 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,7 +2,7 @@ pluginManagement { gradle.ext.kotlinVersion = '1.9.24' gradle.ext.agpVersion = '8.1.0' gradle.ext.automatticPublishToS3Version = '0.9.0' - gradle.ext.dependencyAnalysisVersion = '1.28.0' + gradle.ext.dependencyAnalysisVersion = '1.33.0' plugins { id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion From d69b478400ed60c40147db21026dbc7c1d6a9cfd Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Tue, 13 Aug 2024 11:50:11 +0300 Subject: [PATCH 2/7] Deps: Remove unused androidx test ext junit dependency on android test This 'androidTest' related dependency got added to this project via this (6c8041980686250370e68303c8495ccce86f8b64) commit, but it is unclear why at this point. ------------------------------------------------------------------------ This removal was suggested by the dependency analysis report, see below: Advice for :WordPressUtils Unused dependencies which should be removed: androidTestImplementation 'androidx.test.ext:junit:1.1.3' ... --- WordPressUtils/build.gradle | 1 - build.gradle | 3 --- 2 files changed, 4 deletions(-) diff --git a/WordPressUtils/build.gradle b/WordPressUtils/build.gradle index b97be05f2..33d3b9bd1 100644 --- a/WordPressUtils/build.gradle +++ b/WordPressUtils/build.gradle @@ -29,7 +29,6 @@ dependencies { androidTestImplementation "androidx.test:runner:$androidxTestCoreVersion" androidTestImplementation "androidx.test:rules:$androidxTestCoreVersion" - androidTestImplementation "androidx.test.ext:junit:$jUnitExtVersion" } android { diff --git a/build.gradle b/build.gradle index 4aa42004d..4aec0eaf7 100644 --- a/build.gradle +++ b/build.gradle @@ -53,7 +53,4 @@ ext { assertjVersion = '3.11.1' junitVersion = '4.12' robolectricVersion = '4.9' - - // android test - jUnitExtVersion = '1.1.3' } From f597b55172c0e01e7630de89018cd50ac1e9d282 Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Tue, 13 Aug 2024 11:54:52 +0300 Subject: [PATCH 3/7] Deps: Remove unused androidx test rule dependency on android test This 'androidTest' related dependency got added to this project via this (6c8041980686250370e68303c8495ccce86f8b64) commit, but it is unclear why at this point. ------------------------------------------------------------------------ This removal was suggested by the dependency analysis report, see below: Advice for :WordPressUtils Unused dependencies which should be removed: androidTestImplementation 'androidx.test:rules:1.4.0' ... --- WordPressUtils/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/WordPressUtils/build.gradle b/WordPressUtils/build.gradle index 33d3b9bd1..068deb0ba 100644 --- a/WordPressUtils/build.gradle +++ b/WordPressUtils/build.gradle @@ -28,7 +28,6 @@ dependencies { lintChecks "org.wordpress:lint:$wordpressLintVersion" androidTestImplementation "androidx.test:runner:$androidxTestCoreVersion" - androidTestImplementation "androidx.test:rules:$androidxTestCoreVersion" } android { From 940ca505cdb01575a84a70dde0ab4d93906157b0 Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Tue, 13 Aug 2024 13:21:50 +0300 Subject: [PATCH 4/7] Deps: Replace androidx core ktx dependency with plain core Removing the 'androidx.core.ktx' dependency wasn't enough by itself as the dependency graph got updated with dependencies pointing to other versions. Adding the transient 'androidx.core:core' dependency was actually necessary in order to keep the dependency graph unaffected. ------------------------------------------------------------------------ This replacement was suggested by the dependency analysis report, see below: Advice for :WordPressUtils Unused dependencies which should be removed: implementation 'androidx.core:core-ktx:1.5.0' ... These transitive dependencies should be declared directly: ... api 'androidx.core:core:1.5.0' ... --- WordPressUtils/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPressUtils/build.gradle b/WordPressUtils/build.gradle index 068deb0ba..0f30b0e8b 100644 --- a/WordPressUtils/build.gradle +++ b/WordPressUtils/build.gradle @@ -18,7 +18,7 @@ dependencies { implementation "androidx.recyclerview:recyclerview:$androidxRecyclerViewVersion" implementation "org.greenrobot:eventbus:$eventBusVersion" - implementation "androidx.core:core-ktx:$androidxCoreVersion" + implementation "androidx.core:core:$androidxCoreVersion" testImplementation "junit:junit:$junitVersion" testImplementation "org.assertj:assertj-core:$assertjVersion" From 709f7a4b2130e05092dcc2c0e12f42a83836acda Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Tue, 13 Aug 2024 13:31:45 +0300 Subject: [PATCH 5/7] Deps: Remove unused volley dependency This unused dependency got added to this project via this (c6d4f4a7e8946175678dd5cf0a5d0660d42007c) commit, which added the 'WPImageGetter' utility to the project. However, later on, this (d85b6dbb16060f4055407ea6e0dfd690ff0f5451) other commit, removed this 'WPImageGetter' utility to the project, but the accompanying dependency wasn't removed as well. ------------------------------------------------------------------------ This removal was suggested by the dependency analysis report, see below: Advice for :WordPressUtils Unused dependencies which should be removed: implementation 'com.android.volley:volley:1.2.0' ... --- WordPressUtils/build.gradle | 1 - build.gradle | 1 - 2 files changed, 2 deletions(-) diff --git a/WordPressUtils/build.gradle b/WordPressUtils/build.gradle index 0f30b0e8b..cc048c1ac 100644 --- a/WordPressUtils/build.gradle +++ b/WordPressUtils/build.gradle @@ -12,7 +12,6 @@ repositories { dependencies { implementation "org.apache.commons:commons-text:$commonsTextVersion" - implementation "com.android.volley:volley:$volleyVersion" implementation "com.google.android.material:material:$materialVersion" implementation "androidx.swiperefreshlayout:swiperefreshlayout:$androidxSwipeRefreshLayoutVersion" implementation "androidx.recyclerview:recyclerview:$androidxRecyclerViewVersion" diff --git a/build.gradle b/build.gradle index 4aec0eaf7..2cd8779e9 100644 --- a/build.gradle +++ b/build.gradle @@ -46,7 +46,6 @@ ext { commonsTextVersion = '1.10.0' eventBusVersion = '3.3.1' materialVersion = '1.2.1' - volleyVersion = '1.2.0' // test androidxTestCoreVersion = '1.4.0' From 95e474994a722a4b3e26592c776441100a44aeed Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Tue, 13 Aug 2024 13:33:20 +0300 Subject: [PATCH 6/7] Refactor: Rename volley error msg to plain error msg for app log e func There is no point to hold a reference to 'volley' anyway in the project and this way to make the implementation to seem to be binding to a specific networking framework, which it isn't. --- .../main/java/org/wordpress/android/util/AppLog.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/WordPressUtils/src/main/java/org/wordpress/android/util/AppLog.java b/WordPressUtils/src/main/java/org/wordpress/android/util/AppLog.java index f8f843862..c331b80ac 100644 --- a/WordPressUtils/src/main/java/org/wordpress/android/util/AppLog.java +++ b/WordPressUtils/src/main/java/org/wordpress/android/util/AppLog.java @@ -205,18 +205,18 @@ public static void e(T tag, Throwable tr) { * Sends a ERROR log message * @param tag Used to identify the source of a log message. It usually identifies the class or activity where the * log call occurs. - * @param volleyErrorMsg + * @param errorMsg * @param statusCode */ - public static void e(T tag, String volleyErrorMsg, int statusCode) { - if (TextUtils.isEmpty(volleyErrorMsg)) { + public static void e(T tag, String errorMsg, int statusCode) { + if (TextUtils.isEmpty(errorMsg)) { return; } String logText; if (statusCode == -1) { - logText = volleyErrorMsg; + logText = errorMsg; } else { - logText = volleyErrorMsg + ", status " + statusCode; + logText = errorMsg + ", status " + statusCode; } Log.e(TAG + "-" + tag.toString(), logText); addEntry(tag, LogLevel.w, logText); From 661d1314f08a97f06754a2737d2ae18a100c9f02 Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Tue, 13 Aug 2024 13:35:40 +0300 Subject: [PATCH 7/7] Deps: Replace eventbus dependency with eventbus java Removing the 'eventbus' dependency wasn't enough by itself as the build was then failing. Adding the transient 'eventbus-java' dependency was actually required in order to make the build successful again. ------------------------------------------------------------------------ This replacement was suggested by the dependency analysis report, see below: Unused dependencies which should be removed: implementation 'org.greenrobot:eventbus:3.3.1' These transitive dependencies should be declared directly: ... implementation 'org.greenrobot:eventbus-java:3.3.1' ... --- WordPressUtils/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPressUtils/build.gradle b/WordPressUtils/build.gradle index cc048c1ac..1d6ed63c8 100644 --- a/WordPressUtils/build.gradle +++ b/WordPressUtils/build.gradle @@ -15,7 +15,7 @@ dependencies { implementation "com.google.android.material:material:$materialVersion" implementation "androidx.swiperefreshlayout:swiperefreshlayout:$androidxSwipeRefreshLayoutVersion" implementation "androidx.recyclerview:recyclerview:$androidxRecyclerViewVersion" - implementation "org.greenrobot:eventbus:$eventBusVersion" + implementation "org.greenrobot:eventbus-java:$eventBusVersion" implementation "androidx.core:core:$androidxCoreVersion"