Skip to content

Commit

Permalink
Refactoring to version catalog for plugins and libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmood199 committed Feb 26, 2024
1 parent 616aa87 commit e28c55d
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 59 deletions.
3 changes: 0 additions & 3 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions .idea/deploymentTargetSelector.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 8 additions & 9 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.dagger.hilt.android")
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.dagger.hilt.android)
id("kotlin-parcelize")
id("kotlin-android")
id("kotlinx-serialization")
id("com.google.devtools.ksp")
id("androidx.baselineprofile")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
id("com.google.firebase.firebase-perf")
alias(libs.plugins.ksp)
alias(libs.plugins.androidx.baselineprofile)
alias(libs.plugins.google.services)
alias(libs.plugins.firebase.crashlytics)
alias(libs.plugins.firebase.perf)
alias(libs.plugins.paparazzi)
}

Expand Down
14 changes: 7 additions & 7 deletions baselineProfile/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import com.android.build.api.dsl.ManagedVirtualDevice

plugins {
id("com.android.test")
id("org.jetbrains.kotlin.android")
id("androidx.baselineprofile")
alias(libs.plugins.android.test)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.androidx.baselineprofile)
}

android {
Expand Down Expand Up @@ -45,8 +45,8 @@ baselineProfile {
}

dependencies {
implementation("androidx.test.ext:junit:1.1.5")
implementation("androidx.test.espresso:espresso-core:3.5.1")
implementation("androidx.test.uiautomator:uiautomator:2.2.0")
implementation("androidx.benchmark:benchmark-macro-junit4:1.2.2")
implementation(libs.androidx.test.ext.junit)
implementation(libs.androidx.test.espresso.core)
implementation(libs.androidx.uiautomator)
implementation(libs.androidx.benchmark.macro.junit4)
}
12 changes: 6 additions & 6 deletions benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("com.android.test")
id("org.jetbrains.kotlin.android")
alias(libs.plugins.android.test)
alias(libs.plugins.kotlin.android)
}

android {
Expand Down Expand Up @@ -39,10 +39,10 @@ android {
}

dependencies {
implementation("androidx.test.ext:junit:1.1.5")
implementation("androidx.test.espresso:espresso-core:3.5.1")
implementation("androidx.test.uiautomator:uiautomator:2.2.0")
implementation("androidx.benchmark:benchmark-macro-junit4:1.2.2")
implementation(libs.androidx.test.ext.junit)
implementation(libs.androidx.test.espresso.core)
implementation(libs.androidx.uiautomator)
implementation(libs.androidx.benchmark.macro.junit4)
}

androidComponents {
Expand Down
20 changes: 10 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.4.0-alpha08" apply false
id("com.android.library") version "8.4.0-alpha08" apply false
id("org.jetbrains.kotlin.android") version "1.9.10" apply false
id("com.google.dagger.hilt.android") version "2.50" apply false
id("com.android.test") version "8.4.0-alpha08" apply false
id("androidx.baselineprofile") version "1.2.3" apply false
id("com.google.gms.google-services") version "4.4.0" apply false
id("com.google.firebase.crashlytics") version "2.9.9" apply false
id("com.google.firebase.firebase-perf") version "1.4.2" apply false
id("com.google.devtools.ksp") version "1.9.10-1.0.13" apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.dagger.hilt.android) apply false
alias(libs.plugins.android.test) apply false
alias(libs.plugins.androidx.baselineprofile) apply false
alias(libs.plugins.google.services) apply false
alias(libs.plugins.firebase.crashlytics) apply false
alias(libs.plugins.firebase.perf) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.paparazzi) apply false
}

Expand Down
18 changes: 9 additions & 9 deletions data/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
id("kotlin-kapt")
id("kotlin-parcelize")
id("com.google.dagger.hilt.android")
alias(libs.plugins.dagger.hilt.android)
}

android {
Expand Down Expand Up @@ -61,12 +61,12 @@ android {

dependencies {

implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.11.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
implementation(libs.androidx.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.android.material)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.androidx.test.espresso.core)

implementation(libs.hilt.android)
kapt(libs.hilt.compiler)
Expand Down
35 changes: 32 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[versions]
benchmarkMacroJunit4 = "1.2.2"
coreTesting = "2.2.0"
hiltAndroidCompiler = "2.50"
hiltAndroidGradlePlugin = "2.50"
hiltAndroidTesting = "2.50"
kotlinGradlePlugin = "1.6.21"
kotlinSerialization = "1.9.10"
kotlin-version = "1.9.10"
kotlinxCoroutinesTest = "1.6.1"
kotlinxCoroutinesTestJvm = "1.7.3"
ktx = "1.12.0"
Expand Down Expand Up @@ -54,13 +55,29 @@ shortcut-core = "1.0.0"
firebase-bom = "32.7.1"
turbine = "0.13.0"


# Plugins verison
android-application = "8.2.2"
android-library = "8.2.2"
kotlin-android = "1.9.10"
dagger-hilt-android = "2.50"
android-test = "8.2.2"
androidx-baselineprofile = "1.2.3"
google-services = "4.4.0"
firebase-crashlytics = "2.9.9"
firebase-perf = "1.4.2"
ksp = "1.9.10-1.0.13"
uiautomator = "2.3.0"

[libraries]
androidx-benchmark-macro-junit4 = { module = "androidx.benchmark:benchmark-macro-junit4", version.ref = "benchmarkMacroJunit4" }
androidx-core-testing = { module = "androidx.arch.core:core-testing", version.ref = "coreTesting" }
androidx-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "ktx" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
android-material = { group = "com.google.android.material", name = "material", version.ref = "material" }

androidx-profileinstaller = { module = "androidx.profileinstaller:profileinstaller", version.ref = "profileinstaller" }
androidx-uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "uiautomator" }
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraint-layout" }
activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activity-compose" }
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
Expand All @@ -79,7 +96,7 @@ hilt-android-testing = { module = "com.google.dagger:hilt-android-testing", vers


kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePlugin" }
kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlinSerialization" }
kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin-version" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinxCoroutinesTest" }
kotlinx-coroutines-test-jvm = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test-jvm", version.ref = "kotlinxCoroutinesTestJvm" }
lottie-compose = { module = "com.airbnb.android:lottie-compose", version.ref = "lottieCompose" }
Expand Down Expand Up @@ -182,4 +199,16 @@ turbine = { module = "app.cash.turbine:turbine", version.ref = "turbine" }


[plugins]
paparazzi = { id = "app.cash.paparazzi", version.ref = "paparazziGradlePlugin" }
paparazzi = { id = "app.cash.paparazzi", version.ref = "paparazziGradlePlugin" }
android-application = { id = "com.android.application", version.ref = "android-application" }
android-library = { id = "com.android.library", version.ref = "android-library" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-android" }
dagger-hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "dagger-hilt-android" }
android-test = { id = "com.android.test", version.ref = "android-test" }
androidx-baselineprofile = { id = "androidx.baselineprofile", version.ref = "androidx-baselineprofile" }
google-services = { id = "com.google.gms.google-services", version.ref = "google-services" }
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "firebase-crashlytics" }
firebase-perf = { id = "com.google.firebase.firebase-perf", version.ref = "firebase-perf" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
kotlin-parcelize = { id = "kotlin-parcelize", version.ref = "kotlin-version" }
kotlinx-serialization = { id = "kotlinx-serialization" , version.ref = "kotlin-version" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Sep 13 10:30:41 IST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-rc-1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit e28c55d

Please sign in to comment.