From 465ccb4546c20aecd13a3b47ca1dc64ce9a473e2 Mon Sep 17 00:00:00 2001
From: Neel Doshi <neeldoshi147@gmail.com>
Date: Wed, 10 Jul 2024 17:17:06 +0530
Subject: [PATCH] Deps : Migrated `androidDesugar` to version catalog

---
 WordPress/build.gradle    | 2 +-
 build.gradle              | 1 -
 gradle/libs.versions.toml | 2 ++
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/WordPress/build.gradle b/WordPress/build.gradle
index 323980176a41..4569dd1d355d 100644
--- a/WordPress/build.gradle
+++ b/WordPress/build.gradle
@@ -529,7 +529,7 @@ dependencies {
     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"
+    coreLibraryDesugaring libs.desugar.jdk.libs
     lintChecks "org.wordpress:lint:$wordPressLintVersion"
 
     // Firebase
diff --git a/build.gradle b/build.gradle
index 831e711f223a..0557f0cad80f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -39,7 +39,6 @@ ext {
     androidxComposeCompilerVersion = '1.5.9'
 
     // other
-    androidDesugarVersion = '2.0.4'
     wordPressLintVersion = '2.1.0'
 }
 
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index c8dbb9bb8161..ef1f8ea95062 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -1,5 +1,6 @@
 [versions]
 agp = '8.1.0'
+androidDesugar = '2.0.4'
 androidInstallReferrer = '2.2'
 androidxActivity = '1.8.0'
 androidxAppcompat = '1.6.1'
@@ -158,6 +159,7 @@ dagger-hilt-android = { group = "com.google.dagger", name = "hilt-android", vers
 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" }
+desugar-jdk-libs = { group = "com.android.tools", name = "desugar_jdk_libs", version.ref ="androidDesugar" }
 detekt-formatting = { group = "io.gitlab.arturbosch.detekt", name = "detekt-formatting", version.ref = "detekt" }
 facebook-flipper = { group = "com.facebook.flipper", name = "flipper", version.ref ="flipper" }
 facebook-flipper-network-plugin = { group = "com.facebook.flipper", name = "flipper-network-plugin", version.ref ="flipper" }