Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating Build.Gradle to Version Catlog #21029

Conversation

neeldoshii
Copy link
Contributor

@neeldoshii neeldoshii commented Jul 3, 2024

Description

This PR focuses currently on migrating our gradle files to newly introduced version catlog. Currently this PR is WIP the plugin are yet to be migrated as well some dependency.

I have relied on and trusting everything working fine by performing unit test. Trusting CI ATM.

Checklist [TODO]

  • Reorder the versions in alphabetical order.
  • Ensure every version is defined in camel-case format.
  • Drop the “Version” suffix from every version definition.
  • Reorder the libraries in alphabetical order.
  • Change the libraries from camel-case format to dash-case.
  • Keep the versions and libraries ordered alphabetically without any logical grouping. Optimize later.

@neeldoshii neeldoshii changed the title Migrated Dependency to Version Catlog (WIP) -- Migrated Dependency to Version Catlog Jul 3, 2024
build.gradle Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
@@ -390,143 +390,146 @@ dependencies {
}
}

implementation ("com.automattic:rest:$automatticRestVersion") {
implementation (libs.automatticRest) {
exclude group: 'com.mcxiaoke.volley'
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what exclude type of dependency working is it over here?

For this I have used version catlog declaration as usual group , name, version no

automatticRest = { group = "com.automattic", name = "rest", version.ref = "automatticRestVersion" }

But at some place its requiring Module Declaration and why is that so I didnt found much of it online.

For example at Line No 458, for using ucrop normal version catlog declaration it was giving error it required me to used module. So my main question is when to use modules?

ucrop = { module = "com.github.yalantis:ucrop", version.ref = "uCropVersion" }
    implementation (libs.ucrop) {
        exclude group: 'androidx.core', module: 'core'
        exclude group: 'androidx.constraintlayout', module: 'constraintlayout'
        exclude group: 'androidx.appcompat', module: 'appcompat'
    }
    

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 @neeldoshii , please don't worry about these, all this dependency configuration shouldn't affect your work with version catalogs. As such, just like you did with libs.ucrop, I suggest updating the dependency to version catalogs but keeping the extra configuration unchanged.

FYI: The exclude group vs. group + module diff is just that:

  • When using exclude group only, then you instruct the dependency to exclude all dependencies from the specified group, regardless of the module name. Think multiple dependencies with the same group name.
  • When using exclude group + module, then you instruct the dependency to exclude only the specific module of that specific group.

I hope that helps? 🙏

@neeldoshii neeldoshii marked this pull request as draft July 3, 2024 14:45
@neeldoshii neeldoshii changed the title (WIP) -- Migrated Dependency to Version Catlog (WIP) -- Migrating Build.Gradle to Version Catlog Jul 3, 2024
@AliSoftware AliSoftware requested review from ParaskP7 and wzieba July 3, 2024 16:54
@neeldoshii
Copy link
Contributor Author

Patch

Subject: [PATCH] Plugin Migration Throws Error
---
Index: gradle/libs.versions.toml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
--- a/gradle/libs.versions.toml	(revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/gradle/libs.versions.toml	(date 1720040180034)
@@ -68,6 +68,7 @@
 androidxViewpager2Version = '1.0.0'
 squareupKotlinPoetVersion = '1.16.0'
 
+agpVersion = '8.1.0'
 
 [libraries]
 androidxWebkit = { group = "androidx.webkit", name = "webkit", version.ref = "webkit" }
@@ -217,4 +218,6 @@
 
 
 [plugins]
+androidApplication = { id = "com.android.application", version.ref = "agpVersion"}
+androidLibrary = { id = "com.android.library", version.ref = "agpVersion"}
 
Index: settings.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/settings.gradle b/settings.gradle
--- a/settings.gradle	(revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/settings.gradle	(date 1720037125923)
@@ -1,7 +1,7 @@
 pluginManagement {
     gradle.ext.kotlinVersion = '1.9.22'
     gradle.ext.kspVersion = '1.9.22-1.0.17'
-    gradle.ext.agpVersion = '8.1.0'
+    //gradle.ext.agpVersion = '8.1.0'
     gradle.ext.googleServicesVersion = '4.3.15'
     gradle.ext.navigationVersion = '2.7.7'
     gradle.ext.sentryVersion = '4.3.1'
@@ -18,8 +18,8 @@
         id "org.jetbrains.kotlin.plugin.serialization" version gradle.ext.kotlinVersion
         id "org.jetbrains.kotlin.plugin.parcelize" version gradle.ext.kotlinVersion
         id "org.jetbrains.kotlin.plugin.allopen" version gradle.ext.kotlinVersion
-        id "com.android.application" version gradle.ext.agpVersion
-        id "com.android.library" version gradle.ext.agpVersion
+        alias(libs.plugins.androidApplication)
+        alias(libs.plugins.androidLibrary)
         id 'com.google.gms.google-services' version gradle.ext.googleServicesVersion
         id "androidx.navigation.safeargs.kotlin" version gradle.ext.navigationVersion
         id "io.sentry.android.gradle" version gradle.ext.sentryVersion

Error :

A problem occurred evaluating settings 'WordPress-Android'.

Could not get unknown property 'libs' for object of type org.gradle.plugin.management.internal.DefaultPluginManagementSpec$PluginDependenciesSpecImpl.

I am little confused over why is plugins throwing error. Its my first time working on module gradle builds.

Copy link
Contributor

@ParaskP7 ParaskP7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 @neeldoshii and thanks for this contribution!

I have reviewed this draft and also tried to make the plugins libs working, timeboxing my efforts for now, here my advise to you:

  1. Suggestion (💡): Let's focus on introducing Version Catalogs for libraries only. I think that migrating plugins to Version Catalogs might require some additional effort and extra Gradle build knowledge as this repo and its Gradle configuration is not that straightforward*.
  2. Warning (⚠️): First, try and study first this nowinandroid and other such open-source repositories, that is, their Version Catalogs configuration. You will notice a few patterns there. I want us to bring these patterns into this repo as well. For example:
    • Notice that every version there is defined in an alphabetical order, you need to reorder ours.
    • Notice that every version there is defined in camel-case format, you did that, great! ✅
    • Notice that every version there is defined without the Version suffix, you can drop it too.
    • Notice that every library these is defined in an alphabetical order, you need to reorder ours.
    • Notice that every library these is defined in dash-case, you need to change the camel-case format to dash-case.
    • Finally, there is no need to group version or libraries in some kind of logical way, let's keep it simple for now and optimize later, just order them alphabetical.
  3. Suggestion (💡): You did it all in a single commit, this makes it a bit difficult for a reviewer to verify that everything was done appropriately and nothing got slipped in or out. As such, please consider moving each dependency into Version Catalogs on a separate commit. Take this work here as an example, you should probably try a similar strategy. I am suggesting that because looking at diffs like this doesn't make it easy for a reviewer, each line doesn't correspond to a specific migration change, thus it is quite easy to make mistakes, both during development and while reviewing.

I hope the above will help guide you with this migration effort, one step at a time. I am here to support you all the way! 🙏

(*): I quickly tried migrating plugins too but got stuck on this exception below and couldn't progress any further:

Error resolving plugin [id: 'com.android.application', version: '8.1.0']
> The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.

@ParaskP7
Copy link
Contributor

ParaskP7 commented Jul 4, 2024

I am little confused over why is plugins throwing error. Its my first time working on module gradle builds.

Btw @neeldoshii , this patch that you shared wouldn't work. With Version Catalogs you don't need this pluginManagement { plugins { ... } } block anymore and can instead use alias(libs.plugins.android.application) directly where needed. Also, you should probably utilize the dependencyResolutionManagement { ... } block too.

As per my review comment above please try looking at how other projects have dealt with this migration and see if you can move forward. 🤞

@ParaskP7
Copy link
Contributor

ParaskP7 commented Jul 4, 2024

@neeldoshii btw, with help from @wzieba (🙇) I managed to make plugins compile, see patch below:

Expand to Patch
Subject: [PATCH] Working Plugins Migration
---
Index: libs/processors/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/processors/build.gradle b/libs/processors/build.gradle
--- a/libs/processors/build.gradle	(revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/libs/processors/build.gradle	(date 1720098732780)
@@ -1,6 +1,6 @@
 plugins {
-    id "org.jetbrains.kotlin.jvm"
-    id "org.jetbrains.kotlinx.kover"
+    alias(libs.plugins.kotlin.jvm)
+    alias(libs.plugins.kover)
 }
 
 sourceCompatibility = JavaVersion.VERSION_1_8
@@ -11,12 +11,12 @@
 
     implementation libs.squareupKotlinPoet
     implementation libs.squareupKotlinPoetKsp
-    implementation "com.google.devtools.ksp:symbol-processing-api:$gradle.ext.kspVersion"
+    implementation libs.ksp.sympol.processing.api
 
     def kctVersion = "1.5.0"
     testImplementation "com.github.tschuchortdev:kotlin-compile-testing:$kctVersion"
     testImplementation "com.github.tschuchortdev:kotlin-compile-testing-ksp:$kctVersion"
     testImplementation libs.junit
     testImplementation libs.assertj
-    testImplementation "org.jetbrains.kotlin:kotlin-reflect:$gradle.ext.kotlinVersion"
+    testImplementation libs.kotlin.reflect
 }
Index: libs/networking/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/networking/build.gradle b/libs/networking/build.gradle
--- a/libs/networking/build.gradle	(revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/libs/networking/build.gradle	(date 1720097537135)
@@ -1,5 +1,5 @@
 plugins {
-    id "com.android.library"
+    alias(libs.plugins.android.library)
 }
 
 android {
Index: settings.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/settings.gradle b/settings.gradle
--- a/settings.gradle	(revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/settings.gradle	(date 1720098074784)
@@ -1,36 +1,4 @@
 pluginManagement {
-    gradle.ext.kotlinVersion = '1.9.22'
-    gradle.ext.kspVersion = '1.9.22-1.0.17'
-    gradle.ext.agpVersion = '8.1.0'
-    gradle.ext.googleServicesVersion = '4.3.15'
-    gradle.ext.navigationVersion = '2.7.7'
-    gradle.ext.sentryVersion = '4.3.1'
-    gradle.ext.daggerVersion = "2.50"
-    gradle.ext.detektVersion = '1.23.0'
-    gradle.ext.violationCommentsVersion = '1.70.0'
-    gradle.ext.measureBuildsVersion = '2.1.2'
-    gradle.ext.koverVersion = '0.7.5'
-    gradle.ext.dependencyAnalysisVersion = '1.28.0'
-
-    plugins {
-        id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion
-        id "org.jetbrains.kotlin.jvm" version gradle.ext.kotlinVersion
-        id "org.jetbrains.kotlin.plugin.serialization" version gradle.ext.kotlinVersion
-        id "org.jetbrains.kotlin.plugin.parcelize" version gradle.ext.kotlinVersion
-        id "org.jetbrains.kotlin.plugin.allopen" version gradle.ext.kotlinVersion
-        id "com.android.application" version gradle.ext.agpVersion
-        id "com.android.library" version gradle.ext.agpVersion
-        id 'com.google.gms.google-services' version gradle.ext.googleServicesVersion
-        id "androidx.navigation.safeargs.kotlin" version gradle.ext.navigationVersion
-        id "io.sentry.android.gradle" version gradle.ext.sentryVersion
-        id "io.gitlab.arturbosch.detekt" version gradle.ext.detektVersion
-        id "se.bjurr.violations.violation-comments-to-github-gradle-plugin" version gradle.ext.violationCommentsVersion
-        id 'com.automattic.android.measure-builds' version gradle.ext.measureBuildsVersion
-        id "org.jetbrains.kotlinx.kover" version gradle.ext.koverVersion
-        id "com.google.dagger.hilt.android" version gradle.ext.daggerVersion
-        id "com.google.devtools.ksp" version gradle.ext.kspVersion
-        id "com.autonomousapps.dependency-analysis" version gradle.ext.dependencyAnalysisVersion
-    }
     repositories {
         maven {
             url 'https://a8c-libs.s3.amazonaws.com/android'
Index: WordPress/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/WordPress/build.gradle b/WordPress/build.gradle
--- a/WordPress/build.gradle	(revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/WordPress/build.gradle	(date 1720098452773)
@@ -3,16 +3,16 @@
 import se.bjurr.violations.lib.model.SEVERITY
 
 plugins {
-    id "com.android.application"
-    id "org.jetbrains.kotlin.android"
-    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"
-    id "com.google.devtools.ksp"
+    alias(libs.plugins.android.application)
+    alias(libs.plugins.kotlin.android)
+    alias(libs.plugins.kotlin.parcelize)
+    alias(libs.plugins.kotlin.allopen)
+    alias(libs.plugins.sentry)
+    alias(libs.plugins.violation.comments)
+    alias(libs.plugins.google.services)
+    alias(libs.plugins.dagger)
+    alias(libs.plugins.kover)
+    alias(libs.plugins.ksp)
 }
 
 sentry {
@@ -474,10 +474,10 @@
     implementation (libs.googleExoPlayer) {
         exclude group: 'com.android.support', module: 'support-annotations'
     }
-    implementation "com.google.dagger:dagger-android-support:$gradle.ext.daggerVersion"
-    ksp "com.google.dagger:dagger-android-processor:$gradle.ext.daggerVersion"
-    implementation "com.google.dagger:hilt-android:$gradle.ext.daggerVersion"
-    ksp "com.google.dagger:hilt-compiler:$gradle.ext.daggerVersion"
+    implementation libs.dagger.android.support
+    ksp libs.dagger.android.processor
+    implementation libs.dagger.hilt.android
+    ksp libs.dagger.hilt.compiler
 
     testImplementation(libs.androidxCoreTesting, {
         exclude group: 'com.android.support', module: 'support-compat'
@@ -486,7 +486,7 @@
     })
     testImplementation libs.junit
     testImplementation libs.mockitoKotlin
-    testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$gradle.ext.kotlinVersion"
+    testImplementation libs.kotlin.test.junit
     testImplementation libs.assertj
     testImplementation libs.kotlinxCoroutinesTest
 
@@ -530,8 +530,8 @@
     }
     androidTestImplementation (name:'cloudtestingscreenshotter_lib', ext:'aar') // Screenshots on Firebase Cloud Testing
     androidTestImplementation libs.androidxWorkManagerTesting
-    androidTestImplementation "com.google.dagger:hilt-android-testing:$gradle.ext.daggerVersion"
-    kspAndroidTest "com.google.dagger:hilt-android-compiler:$gradle.ext.daggerVersion"
+    androidTestImplementation libs.dagger.hilt.android.testing
+    kspAndroidTest libs.dagger.hilt.android.compiler
     // Enables Java 8+ API desugaring support
     coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$androidDesugarVersion"
     lintChecks "org.wordpress:lint:$wordPressLintVersion"
Index: libs/annotations/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/annotations/build.gradle b/libs/annotations/build.gradle
--- a/libs/annotations/build.gradle	(revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/libs/annotations/build.gradle	(date 1720097537133)
@@ -1,5 +1,5 @@
 plugins {
-    id "org.jetbrains.kotlin.jvm"
+    alias(libs.plugins.kotlin.jvm)
 }
 
 sourceCompatibility = JavaVersion.VERSION_1_8
Index: build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build.gradle b/build.gradle
--- a/build.gradle	(revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/build.gradle	(date 1720099117001)
@@ -2,15 +2,18 @@
 import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
 
 plugins {
-    id "io.gitlab.arturbosch.detekt"
-    id 'com.automattic.android.measure-builds'
-    id "org.jetbrains.kotlinx.kover"
-    id "com.autonomousapps.dependency-analysis"
-    id "androidx.navigation.safeargs.kotlin" apply false
-    id "com.android.library" apply false
-    id 'com.google.gms.google-services' apply false
-    id "org.jetbrains.kotlin.plugin.parcelize" apply false
-    id "com.google.devtools.ksp" apply false
+    alias(libs.plugins.detekt)
+    alias(libs.plugins.measure.builds)
+    alias(libs.plugins.kover)
+    alias(libs.plugins.dependency.analysis)
+    alias(libs.plugins.navigation.safeargs).apply(false)
+    alias(libs.plugins.android.application).apply(false)
+    alias(libs.plugins.android.library).apply(false)
+    alias(libs.plugins.google.services).apply(false)
+    alias(libs.plugins.kotlin.android).apply(false)
+    alias(libs.plugins.kotlin.jvm).apply(false)
+    alias(libs.plugins.kotlin.parcelize).apply(false)
+    alias(libs.plugins.ksp).apply(false)
 }
 
 ext {
@@ -95,7 +98,7 @@
     }
 
     detekt {
-        toolVersion = gradle.ext.detektVersion
+//        toolVersion = gradle.ext.detektVersion
         baseline = file("${project.rootDir}/config/detekt/baseline.xml")
         config = files("${project.rootDir}/config/detekt/detekt.yml")
         autoCorrect = false
@@ -185,7 +188,7 @@
 }
 
 dependencies {
-    detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:$gradle.ext.detektVersion"
+    detektPlugins libs.detekt.formatting
 }
 
 apply from: './config/gradle/code_coverage.gradle'
Index: libs/analytics/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/analytics/build.gradle b/libs/analytics/build.gradle
--- a/libs/analytics/build.gradle	(revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/libs/analytics/build.gradle	(date 1720097537133)
@@ -1,5 +1,5 @@
 plugins {
-    id "com.android.library"
+    alias(libs.plugins.android.library)
 }
 
 repositories {
Index: libs/image-editor/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/image-editor/build.gradle b/libs/image-editor/build.gradle
--- a/libs/image-editor/build.gradle	(revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/libs/image-editor/build.gradle	(date 1720098586091)
@@ -1,9 +1,9 @@
 plugins {
-    id "com.android.library"
-    id "org.jetbrains.kotlin.android"
-    id "org.jetbrains.kotlin.plugin.parcelize"
-    id "androidx.navigation.safeargs.kotlin"
-    id "org.jetbrains.kotlinx.kover"
+    alias(libs.plugins.android.library)
+    alias(libs.plugins.kotlin.android)
+    alias(libs.plugins.kotlin.parcelize)
+    alias(libs.plugins.navigation.safeargs)
+    alias(libs.plugins.kover)
 }
 
 android {
@@ -56,8 +56,8 @@
     implementation libs.androidxConstraintLayout
     implementation libs.androidxViewpager2
     implementation libs.googleMaterial
-    implementation "androidx.navigation:navigation-fragment:$gradle.ext.navigationVersion"
-    implementation "androidx.navigation:navigation-ui:$gradle.ext.navigationVersion"
+    implementation libs.navigation.fragment
+    implementation libs.navigation.ui
     implementation libs.lifecycleCommon
     implementation libs.lifecycleRuntime
     implementation libs.lifecycleViewmodel
Index: gradle/libs.versions.toml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
--- a/gradle/libs.versions.toml	(revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/gradle/libs.versions.toml	(date 1720099054787)
@@ -1,4 +1,17 @@
 [versions]
+agp = "8.1.0"
+dagger = "2.50"
+dependencyAnalysis = "1.28.0"
+detekt = "1.23.0"
+googleServices = "4.3.15"
+kotlin = "1.9.22"
+kover = "0.7.5"
+ksp = "1.9.22-1.0.17"
+measureBuilds = "2.1.2"
+navigation = "2.7.7"
+sentry = "4.3.1"
+violationComments = "1.70.0"
+
 #libs
 webkit = '1.11.0'
 androidxComposeNavigationVersion = '2.7.6'
@@ -70,6 +83,19 @@
 
 
 [libraries]
+dagger-android-support = { group = "com.google.dagger", name = "dagger-android-support", version.ref = "dagger" }
+dagger-android-processor = { group = "com.google.dagger", name = "dagger-android-processor", version.ref = "dagger" }
+dagger-hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "dagger" }
+dagger-hilt-android-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "dagger" }
+dagger-hilt-android-testing = { group = "com.google.dagger", name = "hilt-android-testing", version.ref = "dagger" }
+dagger-hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "dagger" }
+detekt-formatting = { group = "io.gitlab.arturbosch.detekt", name = "detekt-formatting", version.ref = "detekt" }
+kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin" }
+kotlin-test-junit = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit", version.ref = "kotlin" }
+ksp-sympol-processing-api = { group = "com.google.devtools.ksp", name = "symbol-processing-api", version.ref = "ksp" }
+navigation-fragment = { group = "androidx.navigation", name = "navigation-fragment", version.ref = "navigation" }
+navigation-ui = { group = "androidx.navigation", name = "navigation-ui", version.ref = "navigation" }
+
 androidxWebkit = { group = "androidx.webkit", name = "webkit", version.ref = "webkit" }
 androidxNavigation = { group = "androidx.navigation", name = "navigation-compose", version.ref = "androidxComposeNavigationVersion" }
 automatticRest = { group = "com.automattic", name = "rest", version.ref = "automatticRestVersion" }
@@ -203,18 +229,20 @@
 squareupKotlinPoet = { group = "com.squareup", name = "kotlinpoet", version.ref ="squareupKotlinPoetVersion" }
 squareupKotlinPoetKsp = { group = "com.squareup", name = "kotlinpoet-ksp", version.ref ="squareupKotlinPoetVersion" }
 
-
-
-
-
-
-
-
-
-
-
-
-
-
 [plugins]
-
+android-application = { id = "com.android.application", version.ref = "agp" }
+android-library = { id = "com.android.library", version.ref = "agp" }
+dagger = { id = "com.google.dagger.hilt.android", version.ref = "dagger" }
+dependency-analysis = { id = "com.autonomousapps.dependency-analysis", version.ref = "dependencyAnalysis" }
+detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
+google-services = { id = "com.google.gms.google-services", version.ref = "googleServices" }
+kotlin-allopen = { id = "org.jetbrains.kotlin.plugin.allopen", version.ref = "kotlin" }
+kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
+kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
+kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
+kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
+ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
+measure-builds = { id = "com.automattic.android.measure-builds", version.ref = "measureBuilds" }
+navigation-safeargs = { id = "androidx.navigation.safeargs.kotlin", version.ref = "navigation" }
+sentry = { id = "io.sentry.android.gradle", version.ref = "sentry" }
+violation-comments = { id = "se.bjurr.violations.violation-comments-to-github-gradle-plugin", version.ref = "violationComments" }
Index: libs/editor/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/editor/build.gradle b/libs/editor/build.gradle
--- a/libs/editor/build.gradle	(revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/libs/editor/build.gradle	(date 1720097537134)
@@ -1,8 +1,8 @@
 plugins {
-    id "com.android.library"
-    id "org.jetbrains.kotlin.android"
-    id "org.jetbrains.kotlin.plugin.parcelize"
-    id "org.jetbrains.kotlinx.kover"
+    alias(libs.plugins.android.library)
+    alias(libs.plugins.kotlin.android)
+    alias(libs.plugins.kotlin.parcelize)
+    alias(libs.plugins.kover)
 }
 
 repositories {
Index: libs/mocks/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/mocks/build.gradle b/libs/mocks/build.gradle
--- a/libs/mocks/build.gradle	(revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/libs/mocks/build.gradle	(date 1720097537134)
@@ -1,5 +1,5 @@
 plugins {
-    id "com.android.library"
+    alias(libs.plugins.android.library)
 }
 
 android {

FYI: This is just as an FYI on how you can make this work and maybe help you unblock.

PS: It seems that the org.jetbrains.kotlin.plugin.serialization plugin is actually unused too.

@neeldoshii
Copy link
Contributor Author

Hi @ParaskP7 👋

Suggestion (💡): You did it all in a single commit, this makes it a bit difficult for a reviewer to verify that everything was done appropriately and nothing got slipped in or out. As such, please consider moving each dependency into Version Catalogs on a separate commit.

  1. Thank for the suggestion! I know this was more for suggestion (💡) but I think it would be more ideal to restructure commit strategy and convert the commits to single commit as either way I need to restructure naming convention. Though, it will take a little rework to me but it will be much better for code review and unwanted mistake and thus save developer code review time.

Notice that every version there is defined in an alphabetical order, you need to reorder ours.
Notice that every version there is defined in camel-case format, you did that, great! ✅
Notice that every version there is defined without the Version suffix, you can drop it too.
Notice that every library these is defined in an alphabetical order, you need to reorder ours.
Notice that every library these is defined in dash-case, you need to change the camel-case format to dash-case.
Finally, there is no need to group version or libraries in some kind of logical way, let's keep it simple for now and optimize later, just order them alphabetical.

  1. Adding this into the description as a task list for myself as a TODO.

@neeldoshii btw, with help from @wzieba (🙇) I managed to make plugins compile, see patch below:

  1. Thank you Petreos & Wojciech for the patch! Should I implement the patch in a single commit as its already review or single one plugin one commit? Wdyt?

@ParaskP7
Copy link
Contributor

ParaskP7 commented Jul 5, 2024

👋 @neeldoshii !

  1. Thank for the suggestion! I know this was more for suggestion (💡) but I think it would be more ideal to restructure commit strategy and convert the commits to single commit as either way I need to restructure naming convention. Though, it will take a little rework to me but it will be much better for code review and unwanted mistake and thus save developer code review time.

Awesome, thanks! 🙇

  1. Adding this into the description as a task list for myself as a TODO.

Good, although, I would recommend that with each commit you do you just make sure you adhere to all these "rules", it might be easier this way, that is, instead of having to redo this work later on when everything is done. 🤔

  1. Thank you Petreos & Wojciech for the patch! Should I implement the patch in a single commit as its already review or single one plugin one commit? Wdyt?

I think it is better to do those as multiple commits as well. 🙏

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinxCoroutinesVersion"
implementation libs.kotlinx.coroutines.core
implementation libs.kotlinx.coroutines.android
implementation "com.github.PhilJay:MPAndroidChart:$philjayMpAndroidChartVersion"
Copy link
Contributor Author

@neeldoshii neeldoshii Jul 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any imports for this dependency anywhere in the codebase! Seems like its no longer used. Can you verify it for safe removal?

    implementation "com.github.indexos.media-for-mobile:domain:$indexosMediaForMobileVersion"
    implementation "com.github.indexos.media-for-mobile:android:$indexosMediaForMobileVersion"
    implementation "com.github.PhilJay:MPAndroidChart:$philjayMpAndroidChartVersion"
    implementation "org.jsoup:jsoup:$jsoupVersion"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 @neeldoshii and thanks for taking a closer look into that! 🥇

I recommend not removing any dependencies as part of your PR and instead create another issue describing the problem, for it to be then dealt with in isolation. This way this PR will also get reviewed faster.

FYI: Removing a dependency version is an easier problem than removing the dependency itself.

PS: Sometime a dependency might seems unused but is actually somehow used, on some configuration or a specific context. Thus, I cannot tell for sure if it is actually unused or not, not without going a bit deeper to first understand where that was introduced in the first place, how its usage was removed (in code) and why it wasn't removed as a dependency as well. I hope that all makes sense.

@neeldoshii neeldoshii force-pushed the converting-build.gradle-to-version-catlog branch from dd635da to 69ca4aa Compare July 6, 2024 06:09
@neeldoshii
Copy link
Contributor Author

neeldoshii commented Jul 7, 2024

Almost done with the migration. Same error which you mentioned above is blocking the plugin migration of kotlin and AFP to be completed.

Kotlin Plugin Error

Kotlin Error Log
Error resolving plugin [id: 'org.jetbrains.kotlin.android', version: '1.9.22']
> The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, 
so compatibility cannot be checked.

Patch:

Kotlin Patch
Subject: [PATCH] Kotlin Plugin Error
---
Index: WordPress/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/WordPress/build.gradle b/WordPress/build.gradle
--- a/WordPress/build.gradle	(revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/WordPress/build.gradle	(date 1720295395127)
@@ -4,9 +4,9 @@
 
 plugins {
     id "com.android.application"
-    id "org.jetbrains.kotlin.android"
-    id "org.jetbrains.kotlin.plugin.parcelize"
-    id "org.jetbrains.kotlin.plugin.allopen"
+    alias(libs.plugins.kotlin.android)
+    alias(libs.plugins.kotlin.parcelize)
+    alias(libs.plugins.kotlin.allopen)
     alias(libs.plugins.sentry)
     alias(libs.plugins.violation.comments)
     id "com.google.gms.google-services"
@@ -482,7 +482,7 @@
     })
     testImplementation libs.junit
     testImplementation libs.mockito.kotlin
-    testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$gradle.ext.kotlinVersion"
+    testImplementation libs.kotlin.test
     testImplementation libs.assertj.core
     testImplementation libs.kotlinx.coroutines.test
 
Index: gradle/libs.versions.toml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
--- a/gradle/libs.versions.toml	(revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/gradle/libs.versions.toml	(date 1720295095545)
@@ -53,6 +53,7 @@
 indexosMediaForMobile = '43a9026f0973a2f0a74fa813132f6a16f7499c3a'
 jsoup = '1.16.2'
 junit = '4.13.2'
+kotlin = '1.9.22'
 kotlinxCoroutines = '1.7.3'
 kover = "0.7.5"
 ksp = "1.9.22-1.0.17"
@@ -205,11 +206,18 @@
 wiremock-httpclient-android = { group = "org.apache.httpcomponents", name = "httpclient-android", version.ref ="wiremockHttpClient" }
 wordPress-persistentEditText = { group = "org.wordpress", name = "persistentedittext", version.ref = "wordPressPersistentEditText" }
 zendesk = { group = "com.zendesk", name = "support", version.ref ="zendesk" }
+kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin" }
+kotlin-test-junit = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit", version.ref = "kotlin" }
+
 
 [plugins]
 dagger = { id = "com.google.dagger.hilt.android", version.ref = "dagger" }
 dependency-analysis = { id = "com.autonomousapps.dependency-analysis", version.ref = "dependencyAnalysis" }
 detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
+kotlin-allopen = { id = "org.jetbrains.kotlin.plugin.allopen", version.ref = "kotlin" }
+kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
+kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
+kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
 kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
 ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
 measure-builds = { id = "com.automattic.android.measure-builds", version.ref = "measureBuilds" }
Index: libs/processors/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/processors/build.gradle b/libs/processors/build.gradle
--- a/libs/processors/build.gradle	(revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/libs/processors/build.gradle	(date 1720294963020)
@@ -1,5 +1,5 @@
 plugins {
-    id "org.jetbrains.kotlin.jvm"
+    alias(libs.plugins.kotlin.jvm)
     alias(libs.plugins.kover)
 }
 
@@ -18,5 +18,5 @@
     testImplementation "com.github.tschuchortdev:kotlin-compile-testing-ksp:$kctVersion"
     testImplementation libs.junit
     testImplementation libs.assertj.core
-    testImplementation "org.jetbrains.kotlin:kotlin-reflect:$gradle.ext.kotlinVersion"
+    testImplementation libs.kotlin.reflect
 }
Index: build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build.gradle b/build.gradle
--- a/build.gradle	(revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/build.gradle	(date 1720295440359)
@@ -9,7 +9,7 @@
     alias(libs.plugins.navigation.safeargs).apply(false)
     id "com.android.library" apply false
     id 'com.google.gms.google-services' apply false
-    id "org.jetbrains.kotlin.plugin.parcelize" apply false
+    alias(libs.plugins.kotlin.parcelize).apply(false)
     alias(libs.plugins.ksp).apply(false)
 }
 
Index: libs/annotations/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/annotations/build.gradle b/libs/annotations/build.gradle
--- a/libs/annotations/build.gradle	(revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/libs/annotations/build.gradle	(date 1720294724011)
@@ -1,5 +1,5 @@
 plugins {
-    id "org.jetbrains.kotlin.jvm"
+    alias(libs.plugins.kotlin.jvm)
 }
 
 sourceCompatibility = JavaVersion.VERSION_1_8
Index: settings.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/settings.gradle b/settings.gradle
--- a/settings.gradle	(revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/settings.gradle	(date 1720294724007)
@@ -1,14 +1,8 @@
 pluginManagement {
-    gradle.ext.kotlinVersion = '1.9.22'
     gradle.ext.agpVersion = '8.1.0'
     gradle.ext.googleServicesVersion = '4.3.15'
 
     plugins {
-        id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion
-        id "org.jetbrains.kotlin.jvm" version gradle.ext.kotlinVersion
-        id "org.jetbrains.kotlin.plugin.serialization" version gradle.ext.kotlinVersion
-        id "org.jetbrains.kotlin.plugin.parcelize" version gradle.ext.kotlinVersion
-        id "org.jetbrains.kotlin.plugin.allopen" version gradle.ext.kotlinVersion
         id "com.android.application" version gradle.ext.agpVersion
         id "com.android.library" version gradle.ext.agpVersion
         id 'com.google.gms.google-services' version gradle.ext.googleServicesVersion
Index: libs/image-editor/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/image-editor/build.gradle b/libs/image-editor/build.gradle
--- a/libs/image-editor/build.gradle	(revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/libs/image-editor/build.gradle	(date 1720294724009)
@@ -1,7 +1,7 @@
 plugins {
     id "com.android.library"
-    id "org.jetbrains.kotlin.android"
-    id "org.jetbrains.kotlin.plugin.parcelize"
+    alias(libs.plugins.kotlin.android)
+    alias(libs.plugins.kotlin.parcelize)
     alias(libs.plugins.navigation.safeargs)
     alias(libs.plugins.kover)
 }
Index: libs/editor/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/editor/build.gradle b/libs/editor/build.gradle
--- a/libs/editor/build.gradle	(revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/libs/editor/build.gradle	(date 1720294724002)
@@ -1,7 +1,7 @@
 plugins {
     id "com.android.library"
-    id "org.jetbrains.kotlin.android"
-    id "org.jetbrains.kotlin.plugin.parcelize"
+    alias(libs.plugins.kotlin.android)
+    alias(libs.plugins.kotlin.parcelize)
     alias(libs.plugins.kover)
 }

AGP Error

AGP Error Log
Error resolving plugin [id: 'com.android.application', version: '8.1.0']
> The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.

Patch

Agp Patch
Subject: [PATCH] AGP Plugin Error
---
Index: WordPress/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/WordPress/build.gradle b/WordPress/build.gradle
--- a/WordPress/build.gradle	(revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/WordPress/build.gradle	(date 1720295975159)
@@ -3,7 +3,7 @@
 import se.bjurr.violations.lib.model.SEVERITY
 
 plugins {
-    id "com.android.application"
+    alias(libs.plugins.android.application)
     id "org.jetbrains.kotlin.android"
     id "org.jetbrains.kotlin.plugin.parcelize"
     id "org.jetbrains.kotlin.plugin.allopen"
Index: gradle/libs.versions.toml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
--- a/gradle/libs.versions.toml	(revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/gradle/libs.versions.toml	(date 1720295975161)
@@ -1,4 +1,5 @@
 [versions]
+agp = '8.1.0'
 androidInstallReferrer = '2.2'
 androidxActivity = '1.8.0'
 androidxAppcompat = '1.6.1'
@@ -208,6 +209,8 @@
 zendesk = { group = "com.zendesk", name = "support", version.ref ="zendesk" }
 
 [plugins]
+android-application = { id = "com.android.application", version.ref = "agp" }
+android-library = { id = "com.android.library", version.ref = "agp" }
 dagger = { id = "com.google.dagger.hilt.android", version.ref = "dagger" }
 dependency-analysis = { id = "com.autonomousapps.dependency-analysis", version.ref = "dependencyAnalysis" }
 detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
Index: build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build.gradle b/build.gradle
--- a/build.gradle	(revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/build.gradle	(date 1720296082286)
@@ -7,7 +7,7 @@
     alias(libs.plugins.kover)
     alias(libs.plugins.dependency.analysis)
     alias(libs.plugins.navigation.safeargs).apply(false)
-    id "com.android.library" apply false
+    alias(libs.plugins.android.library).apply(false)
     alias(libs.plugins.google.services).apply(false)
     id "org.jetbrains.kotlin.plugin.parcelize" apply false
     alias(libs.plugins.ksp).apply(false)
Index: libs/analytics/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/analytics/build.gradle b/libs/analytics/build.gradle
--- a/libs/analytics/build.gradle	(revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/libs/analytics/build.gradle	(date 1720296082280)
@@ -1,5 +1,5 @@
 plugins {
-    id "com.android.library"
+    alias(libs.plugins.android.library)
 }
 
 repositories {
Index: settings.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/settings.gradle b/settings.gradle
--- a/settings.gradle	(revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/settings.gradle	(date 1720296082287)
@@ -1,6 +1,6 @@
 pluginManagement {
     gradle.ext.kotlinVersion = '1.9.22'
-    gradle.ext.agpVersion = '8.1.0'
+//    gradle.ext.agpVersion = '8.1.0'
 
     plugins {
         id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion
@@ -8,8 +8,6 @@
         id "org.jetbrains.kotlin.plugin.serialization" version gradle.ext.kotlinVersion
         id "org.jetbrains.kotlin.plugin.parcelize" version gradle.ext.kotlinVersion
         id "org.jetbrains.kotlin.plugin.allopen" version gradle.ext.kotlinVersion
-        id "com.android.application" version gradle.ext.agpVersion
-        id "com.android.library" version gradle.ext.agpVersion
     }
     repositories {
         maven {
Index: libs/image-editor/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/image-editor/build.gradle b/libs/image-editor/build.gradle
--- a/libs/image-editor/build.gradle	(revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/libs/image-editor/build.gradle	(date 1720296082288)
@@ -1,5 +1,5 @@
 plugins {
-    id "com.android.library"
+    alias(libs.plugins.android.library)
     id "org.jetbrains.kotlin.android"
     id "org.jetbrains.kotlin.plugin.parcelize"
     alias(libs.plugins.navigation.safeargs)
Index: libs/editor/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/editor/build.gradle b/libs/editor/build.gradle
--- a/libs/editor/build.gradle	(revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/libs/editor/build.gradle	(date 1720296082282)
@@ -1,5 +1,5 @@
 plugins {
-    id "com.android.library"
+    alias(libs.plugins.android.library)
     id "org.jetbrains.kotlin.android"
     id "org.jetbrains.kotlin.plugin.parcelize"
     alias(libs.plugins.kover)
Index: libs/networking/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/networking/build.gradle b/libs/networking/build.gradle
--- a/libs/networking/build.gradle	(revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/libs/networking/build.gradle	(date 1720296082284)
@@ -1,5 +1,5 @@
 plugins {
-    id "com.android.library"
+    alias(libs.plugins.android.library)
 }
 
 android {
Index: libs/mocks/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/mocks/build.gradle b/libs/mocks/build.gradle
--- a/libs/mocks/build.gradle	(revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/libs/mocks/build.gradle	(date 1720296082283)
@@ -1,5 +1,5 @@
 plugins {
-    id "com.android.library"
+    alias(libs.plugins.android.library)
 }
 
 android {

@neeldoshii
Copy link
Contributor Author

neeldoshii commented Jul 7, 2024

FollowUp TODO once the version catalog gets migrated.

  1. (💡) Now that the dependencies and plugins is migrated to version catalog from the android lint it seems we have around 46 outdated versions. something like this Dependency Updates #17551
  2. Android recommends to migrate from groovy to kts. It would be nice if we migrate to kts.
  3. (💡) These are the list of probability of unused dependencies, these will need a thorough lookup in the code as this might be used somewhere so we need to safely remove if not used without breaking the app. This will eventually make the app size smaller if they are unused.
    implementation "com.github.indexos.media-for-mobile:domain:$indexosMediaForMobileVersion"
    implementation "com.github.indexos.media-for-mobile:android:$indexosMediaForMobileVersion"
    implementation "com.github.PhilJay:MPAndroidChart:$philjayMpAndroidChartVersion"
    implementation "com.android.installreferrer:installreferrer:$androidInstallReferrerVersion"
    implementation "org.jsoup:jsoup:$jsoupVersion"
    
    // Firebase - Deprecated
    implementation "com.google.firebase:firebase-iid:$firebaseIidVersion"
  1. Ig we should deprecate our exo player usage and create a tech debt issue regarding migrating to media3. Google has officially deprecated exoplayer.

exoplayer library says

This project is deprecated. All users should migrate to AndroidX Media3. Please refer to our migration guide and script to move your codebase to the Media3 package names.

Wdyt?

@neeldoshii neeldoshii requested a review from ParaskP7 July 7, 2024 11:20
@ParaskP7
Copy link
Contributor

ParaskP7 commented Jul 8, 2024

👋 @neeldoshii !

  1. (💡) Now that the dependencies and plugins is migrated to version catalog from the android lint it seems we have around 46 outdated versions. something like this Dependency Updates #17551

Yea, we have been using Dependabot to keep our dependencies up-to-date but we are quickly falling behind on it. So, efforts like #17551 might indeed help here, but, unfortunately, it is not a priority for us atm.

  1. Android recommends to migrate from groovy to kts. It would be nice if we migrate to kts.

Yes, this migration would be good to happen at some point. However, this is mostly a nice-to-have in terms of build language evolution (from Groovy to Kotlin), rather than something that will impact our builds considerably. 👍

  1. (💡) These are the list of probability of unused dependencies, these will need a thorough lookup in the code as this might be used somewhere so we need to safely remove if not used without breaking the app. This will eventually make the app size smaller if they are unused.

Thanks for coming up with the list. For some, it might be as straightforward to remove as it seems, however, for others, it might not. As such, each of those dependencies should be dealt with and tested in isolation.

For example, although com.google.firebase:firebase-iid might seem unused, it is actually used via transitive dependency. It added as part of #18552 for it's own reasons (see commit).

We should be really careful with any such transitive dependency and understand the implications of adding or removing them.

Ig we should deprecate our exo player usage and create a tech debt issue regarding migrating to media3. Google has officially deprecated exoplayer.

ExoPlayer is a whole beast of itself and we tried to deal with it in #17936. Unfortunately, we decided to stop this effort for the time being.

Let me know if all the above helps you. 🙏

@ParaskP7
Copy link
Contributor

ParaskP7 commented Jul 8, 2024

👋 @neeldoshii !

Almost done with the migration. Same error which you mentioned above is blocking the plugin migration of kotlin and AFP to be completed.

Yea, this is a trick one, but the solution did exist in the patch we shared with you. 😊

You just need to add the relevant kotlin plugins with .apply(false) on the root level build.gradle file to make all that work as expected.

So, for example, for the Kotlin plugin patch you provided, you need to also add the below to that root level build.gradle:

    alias(libs.plugins.kotlin.android).apply(false)
    alias(libs.plugins.kotlin.jvm).apply(false)

Now, for the Android plugin patch you provided, you need to also add the application plugin as false. The library one is already there for you. Then, everything should be working as expected.

I hope this helps unblock you Neel! 🙏

PS: Note that in the Kotlin plugin patch you provided there exist a misconfiguration, it is testImplementation libs.kotlin.test.junit instead of testImplementation libs.kotlin.test. I also had to fix that to get this working... 😅

@neeldoshii neeldoshii marked this pull request as ready for review July 8, 2024 13:41
@neeldoshii
Copy link
Contributor Author

Hi @ParaskP7 👋,

You just need to add the relevant kotlin plugins with .apply(false) on the root level build.gradle file to make all that work as expected.

Yes, you are correct. That was the only issue which blocking the migration. Now that this is fixed Migrations work is completed! The build is now running properly. However (⚠️) , there seems to be issue now that our unit test are failing. Now I am taking the next step in investing what's causing the test case to fail and fixing it.

PS: Note that in the Kotlin plugin patch you provided there exist a misconfiguration, it is testImplementation libs.kotlin.test.junit instead of testImplementation libs.kotlin.test. I also had to fix that to get this working... 😅

Nice catch 😅!

@neeldoshii
Copy link
Contributor Author

Hi @ParaskP7 👋,
Investigated & found the case what's causing the test case to fail.

Here's the step I followed :-

  1. Reverted the kotlin plugin in this commit 3fc4863 fixed the test case failing.
  2. Converted id "org.jetbrains.kotlin.android" to version catalog, resulted in test case failed, so reverted it.
  3. Migrated in sequence and checked each of them are they resulting in breaking/ test case failure for identifying what's breaking.
    a) id "org.jetbrains.kotlin.plugin.parcelize" version gradle.ext.kotlinVersion -- test case passed
    b) id "org.jetbrains.kotlin.plugin.allopen" version gradle.ext.kotlinVersion -- test case passed
    c) id "org.jetbrains.kotlin.jvm" version gradle.ext.kotlinVersion -- test case passed
  4. Next Step I followed migrating the kotlin-reflect & kotlin-test-junit dependency -- test case passed and didn't break our code.
  5. Now that I knew id "org.jetbrains.kotlin.android" this is failing then I digged into it and found the cause.
Error Log
 Task :WordPress:compileJetpackJalapenoDebugJavaWithJavac
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_debug_preferences_DebugSharedPreferenceFlagsViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_debug_preferences_DebugSharedPreferenceFlagsViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_debug_preferences_DebugSharedPreferenceFlagsViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_sitemonitor_SiteMonitorParentActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_sitemonitor_SiteMonitorParentActivity_GeneratedInjector
public class _org_wordpress_android_ui_sitemonitor_SiteMonitorParentActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_detail_TotalFollowersDetailViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_detail_TotalFollowersDetailViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_stats_refresh_lists_detail_TotalFollowersDetailViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_jetpackplugininstall_remoteplugin_JetpackRemoteInstallViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_jetpackplugininstall_remoteplugin_JetpackRemoteInstallViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_jetpackplugininstall_remoteplugin_JetpackRemoteInstallViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_jetpackoverlay_individualplugin_WPJetpackIndividualPluginViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_jetpackoverlay_individualplugin_WPJetpackIndividualPluginViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_jetpackoverlay_individualplugin_WPJetpackIndividualPluginViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_notifications_NotificationsListViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_notifications_NotificationsListViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_notifications_NotificationsListViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_WPMainActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_WPMainActivity_GeneratedInjector
public class _org_wordpress_android_ui_main_WPMainActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_notifications_NotificationsListFragmentPage_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_notifications_NotificationsListFragmentPage_GeneratedInjector
public class _org_wordpress_android_ui_notifications_NotificationsListFragmentPage_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_StatsFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_StatsFragment_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_StatsFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_jetpack_staticposter_JetpackStaticPosterViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_jetpack_staticposter_JetpackStaticPosterViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_main_jetpack_staticposter_JetpackStaticPosterViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_sections_insights_management_InsightsManagementActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_sections_insights_management_InsightsManagementActivity_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_sections_insights_management_InsightsManagementActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_widget_minified_StatsMinifiedWidgetConfigureActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_widget_minified_StatsMinifiedWidgetConfigureActivity_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_widget_minified_StatsMinifiedWidgetConfigureActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_widget_today_StatsTodayWidgetConfigureActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_widget_today_StatsTodayWidgetConfigureActivity_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_widget_today_StatsTodayWidgetConfigureActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_debug_DebugSettingsFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_debug_DebugSettingsFragment_GeneratedInjector
public class _org_wordpress_android_ui_debug_DebugSettingsFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_deeplinks_DeepLinkingIntentReceiverActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_deeplinks_DeepLinkingIntentReceiverActivity_GeneratedInjector
public class _org_wordpress_android_ui_deeplinks_DeepLinkingIntentReceiverActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_detail_TotalLikesDetailViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_detail_TotalLikesDetailViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_stats_refresh_lists_detail_TotalLikesDetailViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_themes_ThemeBrowserActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_themes_ThemeBrowserActivity_GeneratedInjector
public class _org_wordpress_android_ui_themes_ThemeBrowserActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_MeFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_MeFragment_GeneratedInjector
public class _org_wordpress_android_ui_main_MeFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_deeplinks_DeepLinkingIntentReceiverViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_deeplinks_DeepLinkingIntentReceiverViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_deeplinks_DeepLinkingIntentReceiverViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_jetpackoverlay_individualplugin_WPJetpackIndividualPluginFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_jetpackoverlay_individualplugin_WPJetpackIndividualPluginFragment_GeneratedInjector
public class _org_wordpress_android_ui_jetpackoverlay_individualplugin_WPJetpackIndividualPluginFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_notifications_NotificationsListViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_notifications_NotificationsListViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_notifications_NotificationsListViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_detail_ViewsVisitorsDetailViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_detail_ViewsVisitorsDetailViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_stats_refresh_lists_detail_ViewsVisitorsDetailViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_ChooseSiteActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_ChooseSiteActivity_GeneratedInjector
public class _org_wordpress_android_ui_main_ChooseSiteActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_jetpackoverlay_JetpackFeatureFullScreenOverlayFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_jetpackoverlay_JetpackFeatureFullScreenOverlayFragment_GeneratedInjector
public class _org_wordpress_android_ui_jetpackoverlay_JetpackFeatureFullScreenOverlayFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_jetpackplugininstall_fullplugin_install_JetpackFullPluginInstallViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_jetpackplugininstall_fullplugin_install_JetpackFullPluginInstallViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_jetpackplugininstall_fullplugin_install_JetpackFullPluginInstallViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_jetpack_staticposter_JetpackStaticPosterFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_jetpack_staticposter_JetpackStaticPosterFragment_GeneratedInjector
public class _org_wordpress_android_ui_main_jetpack_staticposter_JetpackStaticPosterFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_detail_ViewsVisitorsDetailViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_detail_ViewsVisitorsDetailViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_stats_refresh_lists_detail_ViewsVisitorsDetailViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_widget_configuration_StatsWidgetDataTypeSelectionDialogFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_widget_configuration_StatsWidgetDataTypeSelectionDialogFragment_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_widget_configuration_StatsWidgetDataTypeSelectionDialogFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_jetpack_staticposter_JetpackStaticPosterViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_jetpack_staticposter_JetpackStaticPosterViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_main_jetpack_staticposter_JetpackStaticPosterViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_support_SupportWebViewActivityViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_support_SupportWebViewActivityViewModel_HiltModules_KeyModule
public class _org_wordpress_android_support_SupportWebViewActivityViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_detail_TotalFollowersDetailViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_detail_TotalFollowersDetailViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_stats_refresh_lists_detail_TotalFollowersDetailViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_media_services_MediaDeleteService_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_media_services_MediaDeleteService_GeneratedInjector
public class _org_wordpress_android_ui_media_services_MediaDeleteService_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_StatsActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_StatsActivity_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_StatsActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_deeplinks_DeepLinkingIntentReceiverViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_deeplinks_DeepLinkingIntentReceiverViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_deeplinks_DeepLinkingIntentReceiverViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_jetpackplugininstall_fullplugin_onboarding_JetpackFullPluginInstallOnboardingViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_jetpackplugininstall_fullplugin_onboarding_JetpackFullPluginInstallOnboardingViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_jetpackplugininstall_fullplugin_onboarding_JetpackFullPluginInstallOnboardingViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_jetpackplugininstall_remoteplugin_JetpackRemoteInstallActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_jetpackplugininstall_remoteplugin_JetpackRemoteInstallActivity_GeneratedInjector
public class _org_wordpress_android_ui_jetpackplugininstall_remoteplugin_JetpackRemoteInstallActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_debug_DebugSettingsActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_debug_DebugSettingsActivity_GeneratedInjector
public class _org_wordpress_android_ui_debug_DebugSettingsActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_widget_configuration_StatsWidgetSiteSelectionDialogFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_widget_configuration_StatsWidgetSiteSelectionDialogFragment_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_widget_configuration_StatsWidgetSiteSelectionDialogFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_jetpackplugininstall_fullplugin_onboarding_JetpackFullPluginInstallOnboardingDialogFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_jetpackplugininstall_fullplugin_onboarding_JetpackFullPluginInstallOnboardingDialogFragment_GeneratedInjector
public class _org_wordpress_android_ui_jetpackplugininstall_fullplugin_onboarding_JetpackFullPluginInstallOnboardingDialogFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_widget_minified_StatsMinifiedWidgetConfigureFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_widget_minified_StatsMinifiedWidgetConfigureFragment_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_widget_minified_StatsMinifiedWidgetConfigureFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_sections_insights_management_InsightsManagementFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_sections_insights_management_InsightsManagementFragment_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_sections_insights_management_InsightsManagementFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_MeViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_MeViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_main_MeViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_jetpackoverlay_JetpackFeatureFullScreenOverlayViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_jetpackoverlay_JetpackFeatureFullScreenOverlayViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_jetpackoverlay_JetpackFeatureFullScreenOverlayViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_SiteViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_SiteViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_main_SiteViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_MeActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_MeActivity_GeneratedInjector
public class _org_wordpress_android_ui_main_MeActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_jetpackoverlay_JetpackFeatureFullScreenOverlayViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_jetpackoverlay_JetpackFeatureFullScreenOverlayViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_jetpackoverlay_JetpackFeatureFullScreenOverlayViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_detail_TotalCommentsDetailViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_detail_TotalCommentsDetailViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_stats_refresh_lists_detail_TotalCommentsDetailViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_MeViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_MeViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_main_MeViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_jetpackplugininstall_fullplugin_onboarding_JetpackFullPluginInstallOnboardingViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_jetpackplugininstall_fullplugin_onboarding_JetpackFullPluginInstallOnboardingViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_jetpackplugininstall_fullplugin_onboarding_JetpackFullPluginInstallOnboardingViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_notifications_NotificationsDetailActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_notifications_NotificationsDetailActivity_GeneratedInjector
public class _org_wordpress_android_ui_notifications_NotificationsDetailActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_StatsViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_StatsViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_stats_refresh_StatsViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_widget_views_StatsViewsWidgetConfigureActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_widget_views_StatsViewsWidgetConfigureActivity_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_widget_views_StatsViewsWidgetConfigureActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_push_NotificationsProcessingService_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_push_NotificationsProcessingService_GeneratedInjector
public class _org_wordpress_android_push_NotificationsProcessingService_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_LineChartMarkerView_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_LineChartMarkerView_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_LineChartMarkerView_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_jetpack_migration_JetpackMigrationViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_jetpack_migration_JetpackMigrationViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_main_jetpack_migration_JetpackMigrationViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_debug_preferences_DebugSharedPreferenceFlagsViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_debug_preferences_DebugSharedPreferenceFlagsViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_debug_preferences_DebugSharedPreferenceFlagsViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_jetpack_migration_JetpackMigrationViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_jetpack_migration_JetpackMigrationViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_main_jetpack_migration_JetpackMigrationViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_jetpackplugininstall_fullplugin_install_JetpackFullPluginInstallViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_jetpackplugininstall_fullplugin_install_JetpackFullPluginInstallViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_jetpackplugininstall_fullplugin_install_JetpackFullPluginInstallViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_jetpackplugininstall_fullplugin_install_JetpackFullPluginInstallActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_jetpackplugininstall_fullplugin_install_JetpackFullPluginInstallActivity_GeneratedInjector
public class _org_wordpress_android_ui_jetpackplugininstall_fullplugin_install_JetpackFullPluginInstallActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_sitemonitor_SiteMonitorParentViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_sitemonitor_SiteMonitorParentViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_sitemonitor_SiteMonitorParentViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_detail_StatsDetailFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_detail_StatsDetailFragment_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_detail_StatsDetailFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_StatsViewAllFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_StatsViewAllFragment_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_StatsViewAllFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_jetpack_migration_JetpackMigrationFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_jetpack_migration_JetpackMigrationFragment_GeneratedInjector
public class _org_wordpress_android_ui_main_jetpack_migration_JetpackMigrationFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_SiteViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_SiteViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_main_SiteViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_detail_TotalCommentsDetailViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_detail_TotalCommentsDetailViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_stats_refresh_lists_detail_TotalCommentsDetailViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_jetpackplugininstall_remoteplugin_JetpackRemoteInstallViewModel_HiltModules_KeyModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_jetpackplugininstall_remoteplugin_JetpackRemoteInstallViewModel_HiltModules_KeyModule
public class _org_wordpress_android_ui_jetpackplugininstall_remoteplugin_JetpackRemoteInstallViewModel_HiltModules_KeyModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_publicize_PublicizeListActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_publicize_PublicizeListActivity_GeneratedInjector
public class _org_wordpress_android_ui_publicize_PublicizeListActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_push_GCMMessageService_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_push_GCMMessageService_GeneratedInjector
public class _org_wordpress_android_push_GCMMessageService_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_widget_alltime_StatsAllTimeWidgetConfigureActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_widget_alltime_StatsAllTimeWidgetConfigureActivity_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_widget_alltime_StatsAllTimeWidgetConfigureActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_SubscribersChartMarkerView_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_SubscribersChartMarkerView_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_SubscribersChartMarkerView_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_StatsViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_StatsViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_stats_refresh_StatsViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_widget_configuration_StatsWidgetConfigureFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_widget_configuration_StatsWidgetConfigureFragment_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_widget_configuration_StatsWidgetConfigureFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_notifications_NotificationsListFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_notifications_NotificationsListFragment_GeneratedInjector
public class _org_wordpress_android_ui_notifications_NotificationsListFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_detail_TotalLikesDetailViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_detail_TotalLikesDetailViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_stats_refresh_lists_detail_TotalLikesDetailViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_widget_configuration_StatsWidgetColorSelectionDialogFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_widget_configuration_StatsWidgetColorSelectionDialogFragment_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_widget_configuration_StatsWidgetColorSelectionDialogFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_jetpackoverlay_individualplugin_WPJetpackIndividualPluginViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_jetpackoverlay_individualplugin_WPJetpackIndividualPluginViewModel_HiltModules_BindsModule
public class _org_wordpress_android_ui_jetpackoverlay_individualplugin_WPJetpackIndividualPluginViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_debug_previews_PreviewFragmentActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_debug_previews_PreviewFragmentActivity_GeneratedInjector
public class _org_wordpress_android_ui_debug_previews_PreviewFragmentActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_debug_preferences_DebugSharedPreferenceFlagsActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_debug_preferences_DebugSharedPreferenceFlagsActivity_GeneratedInjector
public class _org_wordpress_android_ui_debug_preferences_DebugSharedPreferenceFlagsActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_WordPressDebug_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_WordPressDebug_GeneratedInjector
public class _org_wordpress_android_WordPressDebug_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_support_SupportWebViewActivityViewModel_HiltModules_BindsModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_support_SupportWebViewActivityViewModel_HiltModules_BindsModule
public class _org_wordpress_android_support_SupportWebViewActivityViewModel_HiltModules_BindsModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_support_SupportWebViewActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_support_SupportWebViewActivity_GeneratedInjector
public class _org_wordpress_android_support_SupportWebViewActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_StatsListFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_StatsListFragment_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_StatsListFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_modules_HiltWrapper_ViewModelModule.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_modules_HiltWrapper_ViewModelModule
public class _org_wordpress_android_modules_HiltWrapper_ViewModelModule {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_publicize_PublicizeListFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_publicize_PublicizeListFragment_GeneratedInjector
public class _org_wordpress_android_ui_publicize_PublicizeListFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_WPMainNavigationView_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_WPMainNavigationView_GeneratedInjector
public class _org_wordpress_android_ui_main_WPMainNavigationView_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_detail_InsightsDetailFragment_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_detail_InsightsDetailFragment_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_detail_InsightsDetailFragment_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_widget_weeks_StatsWeekWidgetConfigureActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_widget_weeks_StatsWeekWidgetConfigureActivity_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_widget_weeks_StatsWeekWidgetConfigureActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_main_jetpack_migration_JetpackMigrationActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_main_jetpack_migration_JetpackMigrationActivity_GeneratedInjector
public class _org_wordpress_android_ui_main_jetpack_migration_JetpackMigrationActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_StatsViewAllActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_StatsViewAllActivity_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_StatsViewAllActivity_GeneratedInjector {
       ^
/Users/sarveshdoshi/Desktop/Neel_Android_OpenSource/WordPress-Android/WordPress/build/generated/ksp/jetpackJalapenoDebug/java/hilt_aggregated_deps/_org_wordpress_android_ui_stats_refresh_lists_detail_StatsDetailActivity_GeneratedInjector.java:14: error: duplicate class: hilt_aggregated_deps._org_wordpress_android_ui_stats_refresh_lists_detail_StatsDetailActivity_GeneratedInjector
public class _org_wordpress_android_ui_stats_refresh_lists_detail_StatsDetailActivity_GeneratedInjector {
       ^

Seems like kotlin-serialization was indeed needed. As per stackoverflow I found that this duplication was caused due to missing transitive dependency. Adding kotlin-serialization fixed the test case. Can you create a draft PR to check it on CLI now. 😊

Copy link
Contributor

@ParaskP7 ParaskP7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 @neeldoshii , kudos and 🎉 for (almost) reaching the finish line with this one, it is indeed not the easiest of tasks!

Seems like kotlin-serialization was indeed needed. As per stackoverflow I found that this duplication was caused due to missing transitive dependency. Adding kotlin-serialization fixed the test case. Can you create a draft PR to check it on CLI now. 😊

This is interesting but great that you figured it out by yourself, kudos! ❤️


Btw, additional to my review comments, I also have the following for you:

  1. Blocker (🚫): As per my only blocker comment, let me know if you need support with that.
  2. Warning (⚠️): Now that the custom versions have been migrated to Version Catalogs please update any documentation reference to those versions. For example, take a look at Test Instructions per Dependency Update and update it accordingly.

gradle/libs.versions.toml Outdated Show resolved Hide resolved
gradle/libs.versions.toml Outdated Show resolved Hide resolved
gradle/libs.versions.toml Outdated Show resolved Hide resolved
gradle/libs.versions.toml Outdated Show resolved Hide resolved
gradle/libs.versions.toml Outdated Show resolved Hide resolved
gradle/libs.versions.toml Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
build.gradle Show resolved Hide resolved
libs/image-editor/build.gradle Show resolved Hide resolved
WordPress/build.gradle Show resolved Hide resolved
@neeldoshii neeldoshii changed the title (WIP) -- Migrating Build.Gradle to Version Catlog Migrating Build.Gradle to Version Catlog Jul 10, 2024
WordPress/build.gradle Outdated Show resolved Hide resolved
@neeldoshii
Copy link
Contributor Author

neeldoshii commented Jul 10, 2024

Remaining tasks :-

  1. implementation ("$rootProject.gradle.ext.gutenbergMobileBinaryPath:$rootProject.ext.gutenbergMobileVersion") left for migration.
    2. Unit test failing will need to reiterate over to find which commit caused to fail. Edit : Strange re ran all the test they passed 🤷
  2. Merge Conflict 😬 will resolve it.

@neeldoshii neeldoshii force-pushed the converting-build.gradle-to-version-catlog branch from 81a56c6 to f8a40fe Compare July 11, 2024 14:39
@neeldoshii
Copy link
Contributor Author

@ParaskP7 👋,

I also suggest you fetching and using the latest trunk on your PR here, go through each dependency version again, just in case, and see if everything is correct, nothing missing and no more dependencies are updated to a newer version.

I hope this analysis and guideline above helps you a bit with the conflicts. 🙏

Thanks a lot for a details analysis. 🙏

Summarized changes occured on upstream

flipperVersion = '0.247.0'
gutenbergMobileVersion = 'v1.121.0-alpha1'
wordPressFluxCVersion = 'trunk-c670e916346bdaa2379936dd8dbb6750766ca319'

Seems like I missed onBuildMetricsReadyListener { report -> adding it while fixing the merge conflict so I fixed it in this commit f8a40fe .

Why is that left for migration, just because of the conflict with the newest version of Gutenberg, repo's v1.120.1 version vs. newest v1.121.0-alpha1 on trunk, is it? 🤔

Fixed it in 1cd22bc

Also hatsoff 🤠 to you for reviewing 117+ commits.

@neeldoshii neeldoshii requested a review from ParaskP7 July 11, 2024 15:31
@ParaskP7
Copy link
Contributor

👋 @neeldoshii !

Not sure what happened but I can no longer update this PR with my local branch, maybe you just forced pushed? 🤔 Btw, how did you got those conflicts resolved? 🤔

FYI: Don't forget about the automatticMeasureBuilds = '3.1.0' change. Plus, we now have the kotlinxCoroutines = '1.8.1' change as well.

Also hatsoff 🤠 to you for reviewing 117+ commits.

Hats-off 🤠 to you for creating those and dealing with my comments, you rock! 🤟


IDEA

Now that we know what a complete solution looks like, would you consider closing this PR and redoing it from start? I fear that with all those changes/reverts/conflicts, we might be missing something important, causing some kind of a problem, either a compile or runtime problem of some sorts. 😊

implementation ("$rootProject.gradle.ext.gutenbergMobileBinaryPath:$rootProject.ext.gutenbergMobileVersion") {
// TODO: Migrate from composite build path modules to version catalogs (libs.version.toml).
// noinspection UseTomlInstead
implementation ("$rootProject.gradle.ext.gutenbergMobileBinaryPath:${libs.versions.gutenbergMobile.get()}") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor (🔍): Consider removing this extra rootProject. from there.

@neeldoshii
Copy link
Contributor Author

Hi @ParaskP7 👋

Not sure what happened but I can no longer update this PR with my local branch, maybe you just forced pushed? 🤔

I guess this is due to me force pushed/or due to some of my old commits also has change in version due to conflicts from upstream.

Btw, how did you got those conflicts resolved? 🤔

Here's the step I did.

  1. Synced my working branch with upstream/trunk using '''git rebase upstream/trunk'''
  2. Step 2, usually I use vscode but for this merge conflict I used fork(github gui.
  3. On each conflict I choosed either left(my commit) or right(the conflicting commit from upstream) based on the requirements and also manually edited the version on my commit from upstream depending on changes done from time of release of my branch to the upstream.
  4. Once all done, I used the github desktop to push which said push force.

I think for local if you could take new clone of it might do the work.

Apologies, but when performing rebase upstream I only had one option force push. As you can't push normally on rebase.


FYI: Don't forget about the automatticMeasureBuilds = '3.1.0' change. Plus, we now have the kotlinxCoroutines = '1.8.1' change as well.

Will update it once I will back after the break.

Note : When I was logging out I just tested it by compile & run which worked fine. but test had fail. I didn't got much time to investigate but its probably related to 1cd22bc this commit I will test it linear & binary revert locally to test from which change its breaking.

IDEA

Now that we know what a complete solution looks like, would you consider closing this PR and redoing it from start? I fear that with all those changes/reverts/conflicts, we might be missing something important, causing some kind of a problem, either a compile or runtime problem of some sorts. 😊

Won't this cost more development time as we will need to move again with 100+ new commits for each dependency and by then more new version update dump might come by dependabot which might cause conflict again and same cycle again? wdyt? What if we perform squash merge commits in some strategy for better review in atomic which will remove revert/change requested/redundant commits/? Wdyt

@ParaskP7
Copy link
Contributor

👋 @neeldoshii !

As you can't push normally on rebase.

Yea, you can't, you should have used merge instead of rebase. When you use rebase on an open PR, then force push is the only option.

The problem here is that me as a reviewer will now need to review all the commit again. I can't be sure that nothing has changed in the between. I can trust that the developer making this change did everything correctly, but sometimes thing slip, and then, unfortunately, you end-up with unwanted surprises, worse, you get surprised during release time and then everything just goes sideways... 😞

Won't this cost more development time as we will need to move again with 100+ new commits for each dependency and by then more new version update dump might come by dependabot which might cause conflict again and same cycle again? wdyt? What if we perform squash merge commits in some strategy for better review in atomic which will remove revert/change requested/redundant commits/? Wdyt

Due to what I wrote above, and because I would anyway have to do another full review of this PR, I think it is best to start fresh here. Yes, that will cost more development for you, but less review time for me (I won't need to double check everything).

This is the safest choice we have now. Also, you will take this opportunity and redo your work, but now, to do it much more cleaner, without the extra revert, fix or linter commits here-and-there.

So, when you are ready and back from the break, you can get the latest trunk and start working from there. If you manage to complete this work in 1-2 days tops, I'll then review it straight away and we merge this. If we do that in a window of 1-3 days tops, then I am sure we won't get any new version updates. And in the unlucky event that e do, we will use merge instead of rebase and do the conflict resolution appropriately this time.

I think we better be safe here (than sorry). We wouldn't want to cause any suffering to the product teams. 🤷

@ParaskP7
Copy link
Contributor

👋 @neeldoshii this is just an FYI that I am closing this over #21262. Your work helped me to actually do that myself, as I transferred all the knowledge from all our discussions into it, once more, great job and thanks for contributing to JP/WPAndroid! ❤️ 🚀 💯

@ParaskP7 ParaskP7 closed this Sep 27, 2024
@neeldoshii
Copy link
Contributor Author

👋 @neeldoshii this is just an FYI that I am closing this over #21262. Your work helped me to actually do that myself, as I transferred all the knowledge from all our discussions into it, once more, great job and thanks for contributing to JP/WPAndroid! ❤️ 🚀 💯

Wow 🤩 🫡! Glad to be part of the contribution and migration of JP/WPAndroid. I was unable to contribute over this issue recently due to the time constraints but am glad to be part of the journey 🙏🏻.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants