Skip to content

Commit

Permalink
feat: change to use toml for libs management
Browse files Browse the repository at this point in the history
  • Loading branch information
dungngminh committed Jan 15, 2024
1 parent 4750570 commit 74f28d6
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 36 deletions.
54 changes: 27 additions & 27 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,53 +53,53 @@ android {
namespace = "me.dungngminh.verygoodblogapp"
}
dependencies {
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.12.0-alpha03")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
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.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.constraintlayout)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)

// Retrofit
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-moshi:2.9.0")
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
implementation(libs.retrofit)
implementation(libs.converter.moshi)
implementation(libs.logging.interceptor)

// Moshi
implementation("com.squareup.moshi:moshi-kotlin:1.14.0")
implementation("com.squareup.moshi:moshi-adapters:1.9.2")
ksp("com.squareup.moshi:moshi-kotlin-codegen:1.13.0")
implementation(libs.moshi.kotlin)
implementation(libs.moshi.adapters)
ksp(libs.moshi.kotlin.codegen)

// Coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.android)

// Fragment KTX
implementation("androidx.fragment:fragment-ktx:1.6.2")
implementation(libs.androidx.fragment.ktx)

// Navigation
implementation("androidx.navigation:navigation-runtime-ktx:2.7.6")
implementation("androidx.navigation:navigation-fragment-ktx:2.7.6")
implementation("androidx.navigation:navigation-ui-ktx:2.7.6")
implementation(libs.androidx.navigation.runtime.ktx)
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)

// View Model + Lifecycle
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0")
implementation("androidx.lifecycle:lifecycle-extensions:2.2.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation(libs.androidx.lifecycle.viewmodel.ktx)
implementation(libs.androidx.lifecycle.extensions)
implementation(libs.androidx.lifecycle.runtime.ktx)

// Timber
implementation("com.jakewharton.timber:timber:5.0.1")
implementation(libs.timber)

// Hilt
implementation("com.google.dagger:hilt-android:2.50")
kapt("com.google.dagger:hilt-android-compiler:2.48.1")
implementation(libs.hilt.android)
kapt(libs.hilt.android.compiler)

// Flow binding
implementation("io.github.reactivecircus.flowbinding:flowbinding-android:1.2.0")
implementation(libs.flowbinding.android)

// Coil
implementation("io.coil-kt:coil:2.5.0")
implementation(libs.coil)

// Memory leak detection
// debugImplementation("com.squareup.leakcanary:leakcanary-android:2.12")
Expand Down
13 changes: 6 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.1.1" apply false
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
kotlin("kapt") version "1.9.10"
id("androidx.navigation.safeargs.kotlin") version "2.7.5" apply false
id("com.google.dagger.hilt.android") version "2.48.1" apply false
id("com.google.devtools.ksp") version "1.9.0-1.0.13" apply false

alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.navigation.safeargs) apply false
alias(libs.plugins.kotlin.kapt)
alias(libs.plugins.dagger.hilt) apply false
alias(libs.plugins.devtools.ksp) apply false
}


66 changes: 66 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[versions]
androidx-junit = "1.1.5"
appcompat = "1.6.1"
coil = "2.5.0"
constraintlayout = "2.1.4"
converter-moshi = "2.9.0"
core-ktx = "1.12.0"
espresso-core = "3.5.1"
flowbinding-android = "1.2.0"
fragment-ktx = "1.6.2"
hilt-android = "2.50"
junit = "4.13.2"
lifecycle-runtime-ktx = "2.7.0"
lifecycle-extensions = "2.2.0"
lifecycle-viewmodel-ktx = "2.7.0"
kotlinx-coroutines-android = "1.7.3"
kotlinx-coroutines-core = "1.7.3"
logging-interceptor = "4.12.0"
material = "1.12.0-alpha03"
moshi-adapters = "1.9.2"
moshi-kotlin = "1.14.0"
moshi-kotlin-codegen = "1.13.0"
navigation = "2.7.6"
retrofit = "2.9.0"
timber = "5.0.1"
kotlin = "1.9.22"
ksp = "1.9.22-1.0.16"
android-application = "8.2.1"

[libraries]
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "core-ktx" }
androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso-core" }
androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "fragment-ktx" }
androidx-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-junit" }
androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle-runtime-ktx" }
androidx-lifecycle-extensions = { module = "androidx.lifecycle:lifecycle-extensions", version.ref = "lifecycle-extensions" }
androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycle-viewmodel-ktx" }
androidx-navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "navigation" }
androidx-navigation-fragment-ktx = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "navigation" }
androidx-navigation-runtime-ktx = { module = "androidx.navigation:navigation-runtime-ktx", version.ref = "navigation" }
coil = { module = "io.coil-kt:coil", version.ref = "coil" }
converter-moshi = { module = "com.squareup.retrofit2:converter-moshi", version.ref = "converter-moshi" }
flowbinding-android = { module = "io.github.reactivecircus.flowbinding:flowbinding-android", version.ref = "flowbinding-android" }
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt-android" }
hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt-android" }
junit = { module = "junit:junit", version.ref = "junit" }
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines-android" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines-core" }
logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "logging-interceptor" }
material = { module = "com.google.android.material:material", version.ref = "material" }
moshi-adapters = { module = "com.squareup.moshi:moshi-adapters", version.ref = "moshi-adapters" }
moshi-kotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "moshi-kotlin" }
moshi-kotlin-codegen = { module = "com.squareup.moshi:moshi-kotlin-codegen", version.ref = "moshi-kotlin-codegen" }
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" }

[plugins]
android-application = { id = "com.android.application", version.ref = "android-application" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
navigation-safeargs = { id = "androidx.navigation.safeargs.kotlin", version.ref = "navigation" }
devtools-ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
dagger-hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt-android" }
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Dec 01 02:35:05 ICT 2023
#Tue Jan 16 00:27:55 ICT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\:https://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 74f28d6

Please sign in to comment.