Skip to content

Commit

Permalink
Refactoring to version catalog for plugins and libraries (#78)
Browse files Browse the repository at this point in the history
* Refactoring to version catalog for plugins and libraries

* minor

* minor updates
  • Loading branch information
mahmood199 authored Feb 27, 2024
1 parent 616aa87 commit d1b461d
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 94 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.

23 changes: 11 additions & 12 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")
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.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.dagger.hilt.android)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.kotlin.serialization)
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 Expand Up @@ -113,7 +112,7 @@ dependencies {
implementation(libs.accompanist.permissions)
implementation(libs.accompanist.navigation.animation)
implementation(libs.accompanist.pager)
implementation(libs.accompanist.systemuicontroller)
implementation(libs.accompanist.system.ui.controller)
implementation(libs.compose.runtime)
implementation(libs.androidx.profileinstaller)

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
22 changes: 12 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// 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
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.kotlin.serialization) apply false
}

buildscript {
Expand Down
26 changes: 16 additions & 10 deletions data/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
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.ksp)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.dagger.hilt.android)
}

android {
Expand All @@ -22,6 +23,11 @@ android {

buildConfigField("String", "SAAVN_BASE_URL", "\"saavn.me/\"")
buildConfigField("String", "VERSION_NAME", "\"1.0\"")
/*
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}
*/
}

buildTypes {
Expand Down Expand Up @@ -61,12 +67,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
97 changes: 63 additions & 34 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
[versions]
coreTesting = "2.2.0"
hiltAndroidCompiler = "2.50"
hiltAndroidGradlePlugin = "2.50"
hiltAndroidTesting = "2.50"
kotlinGradlePlugin = "1.6.21"
kotlinSerialization = "1.9.10"
kotlinxCoroutinesTest = "1.6.1"
kotlinxCoroutinesTestJvm = "1.7.3"
benchmark-macro-junit4 = "1.2.2"
core-testing = "2.2.0"
hilt-android-compiler = "2.50"
hilt-android-gradle-plugin = "2.50"
hilt-android-testing = "2.50"
kotlin-gradle-plugin = "1.6.21"
kotlin-version = "1.9.10"
kotlinx-coroutines-test = "1.6.1"
kotlinx-coroutines-test-jvm = "1.7.3"
ktx = "1.12.0"
appcompat = "1.6.1"
lottieCompose = "6.3.0"
app-compat = "1.6.1"
lottie-compose = "6.3.0"
material = "1.10.0"
ktor = "2.3.2"
ktor-gson = "1.5.0"
mockitoCore = "3.4.6"
paparazziGradlePlugin = "1.3.2"
perfsuite = "0.2"
prdownloader = "0.6.0"
profileinstaller = "1.4.0-alpha01"
mockito-core = "3.4.6"
paparazzi-gradle-plugin = "1.3.2"
perf-suite = "0.2"
pr-downloader = "0.6.0"
profile-installer = "1.4.0-alpha01"
serialization-json = "1.5.1"
media3-version = "1.1.1"
androidx-legacy-support = "1.0.0"
glide = "4.16.0"
room-version = "2.6.1"
paging-version = "3.2.1"
glide-version = "2.2.12"
dataStore-version = "1.0.0"
data-store-version = "1.0.0"
compose-audio-wave-form = "1.1.1"
kotlinx-collections-immutable-version = "0.3.7"
brotli-dec-version = "0.1.2"
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-core-testing = { module = "androidx.arch.core:core-testing", version.ref = "coreTesting" }
androidx-benchmark-macro-junit4 = { module = "androidx.benchmark:benchmark-macro-junit4", version.ref = "benchmark-macro-junit4" }
androidx-core-testing = { module = "androidx.arch.core:core-testing", version.ref = "core-testing" }
androidx-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "ktx" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "app-compat" }
android-material = { group = "com.google.android.material", name = "material", version.ref = "material" }

androidx-profileinstaller = { module = "androidx.profileinstaller:profileinstaller", version.ref = "profileinstaller" }
androidx-profileinstaller = { module = "androidx.profileinstaller:profileinstaller", version.ref = "profile-installer" }
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 @@ -72,23 +89,23 @@ compose-material3-window-size = { group = "androidx.compose.material3", name = "



hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hiltAndroidCompiler" }
hilt-android-gradle-plugin = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "hiltAndroidGradlePlugin" }
hilt-android-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "hiltAndroidTesting" }
hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt-android-compiler" }
hilt-android-gradle-plugin = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "hilt-android-gradle-plugin" }
hilt-android-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "hilt-android-testing" }



kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePlugin" }
kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlinSerialization" }
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" }
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockitoCore" }
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin-gradle-plugin" }
kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin-version" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines-test" }
kotlinx-coroutines-test-jvm = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test-jvm", version.ref = "kotlinx-coroutines-test-jvm" }
lottie-compose = { module = "com.airbnb.android:lottie-compose", version.ref = "lottie-compose" }
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito-core" }
navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation-compose" }
accompanist-permissions = { group = "com.google.accompanist", name = "accompanist-permissions", version.ref = "accompanist-permission" }
accompanist-navigation-animation = { group = "com.google.accompanist", name = "accompanist-navigation-animation", version.ref = "accompanist-animation" }
accompanist-pager = { group = "com.google.accompanist", name = "accompanist-pager", version.ref = "accompanist-pager" }
accompanist-systemuicontroller = { group = "com.google.accompanist", name = "accompanist-systemuicontroller", version.ref = "accompanist-system-ui-controller" }
accompanist-system-ui-controller = { group = "com.google.accompanist", name = "accompanist-systemuicontroller", version.ref = "accompanist-system-ui-controller" }
compose-runtime = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "compose-runtime" }
compose-constraint-layout = { group = "androidx.constraintlayout", name = "constraintlayout-compose", version.ref = "compose-constraint-layout" }

Expand Down Expand Up @@ -127,9 +144,9 @@ ktor-client-serialization = { group = "io.ktor", name = "ktor-client-serializati
ktor-serialization-kotlinx-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }
ktor-client-content-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation", version.ref = "ktor" }
ktor-client-encoding = { group = "io.ktor", name = "ktor-client-encoding", version.ref = "ktor" }
paparazzi-gradle-plugin = { module = "app.cash.paparazzi:paparazzi-gradle-plugin", version.ref = "paparazziGradlePlugin" }
perfsuite = { module = "com.booking:perfsuite", version.ref = "perfsuite" }
prdownloader = { module = "com.mindorks.android:prdownloader", version.ref = "prdownloader" }
paparazzi-gradle-plugin = { module = "app.cash.paparazzi:paparazzi-gradle-plugin", version.ref = "paparazzi-gradle-plugin" }
perfsuite = { module = "com.booking:perfsuite", version.ref = "perf-suite" }
prdownloader = { module = "com.mindorks.android:prdownloader", version.ref = "pr-downloader" }
slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4jSimple" }


Expand Down Expand Up @@ -158,7 +175,7 @@ paging-runtime = { group = "androidx.paging", name = "paging-runtime", version.r
paging-compose = { group = "androidx.paging", name = "paging-compose", version.ref = "paging-version" }
landscapist-glide = { group = "com.github.skydoves", name = "landscapist-glide", version.ref = "glide-version" }
landscapist-glide-transformation = { group = "com.github.skydoves", name = "landscapist-transformation", version.ref = "glide-version" }
datastore-preferences = { group = "androidx.datastore", name = "datastore-preferences", version.ref = "dataStore-version" }
datastore-preferences = { group = "androidx.datastore", name = "datastore-preferences", version.ref = "data-store-version" }
compose-audiowaveform = { group = "com.github.lincollincol", name = "compose-audiowaveform", version.ref = "compose-audio-wave-form" }

kotlinx-collections-immutable = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version.ref = "kotlinx-collections-immutable-version" }
Expand All @@ -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 = "paparazzi-gradle-plugin" }
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 = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin-version" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.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 d1b461d

Please sign in to comment.