Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Refactor gradle libs file
Browse files Browse the repository at this point in the history
  • Loading branch information
M3DZIK committed Jan 30, 2024
1 parent 8ff22b8 commit c7624bd
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 82 deletions.
40 changes: 20 additions & 20 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.google.dagger.hilt)
alias(libs.plugins.google.ksp)
alias(libs.plugins.dagger.hilt)
alias(libs.plugins.kotlin.ksp)
alias(libs.plugins.kotlin.android)
}

Expand Down Expand Up @@ -61,7 +61,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get()
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}

packaging {
Expand All @@ -72,31 +72,31 @@ android {
}

dependencies {
implementation(libs.androidx.material.icons.extended)
implementation(libs.androidx.material3)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.ui)
implementation(libs.google.accompanist.drawablepainter)
implementation(libs.google.accompanist.systemuicontroller)
implementation(libs.compose.material.icons)
implementation(libs.compose.material3)
implementation(libs.compose.navigation)
implementation(libs.compose.ui)
implementation(libs.accompanist.drawablepainter)
implementation(libs.accompanist.systemuicontroller)

// for biometric authentication
implementation(libs.androidx.biometric)

// used for calling `onResume` and locking vault after X minutes
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.compose.lifecycle.runtime)

// datastore
implementation(libs.androidx.datastore.preferences)

// room database
implementation(libs.androidx.room.ktx)
implementation(libs.androidx.room.runtime)
ksp(libs.androidx.room.compiler)
implementation(libs.room.ktx)
implementation(libs.room.runtime)
ksp(libs.room.compiler)

// dagger
implementation(libs.google.dagger.hilt)
implementation(libs.androidx.hilt.navigation.compose)
ksp(libs.google.dagger.hilt.compiler)
implementation(libs.dagger.hilt)
implementation(libs.hilt.navigation.compose)
ksp(libs.dagger.hilt.compiler)

// for cipher icons in vault
implementation(libs.coil.compose)
Expand All @@ -108,7 +108,7 @@ dependencies {
implementation(libs.process.phoenix)

// kotlin coroutines
implementation(libs.kotlinx.coroutines.android)
implementation(libs.kotlinx.coroutines)

// local modules
implementation(project(":components"))
Expand All @@ -120,9 +120,9 @@ dependencies {
implementation(libs.google.material)

// for testing
debugImplementation(libs.androidx.ui.test.manifest)
debugImplementation(libs.compose.ui.test.manifest)

// for preview support
debugImplementation(libs.androidx.ui.tooling)
implementation(libs.androidx.ui.tooling.preview)
debugImplementation(libs.compose.ui.tooling)
implementation(libs.compose.ui.tooling.preview)
}
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ plugins {
// trick: for the same plugin versions in all sub-modules
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.google.dagger.hilt) apply false
alias(libs.plugins.google.ksp) apply false
alias(libs.plugins.dagger.hilt) apply false
alias(libs.plugins.kotlin.ksp) apply false
alias(libs.plugins.kotlin.android) apply false
}

Expand Down
24 changes: 12 additions & 12 deletions components/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get()
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
}

dependencies {
compileOnly(libs.androidx.material3)
compileOnly(libs.androidx.navigation.compose)
compileOnly(libs.compose.material3)
compileOnly(libs.compose.navigation)

debugImplementation(libs.androidx.material3)
debugImplementation(libs.androidx.navigation.compose)
debugImplementation(libs.compose.material3)
debugImplementation(libs.compose.navigation)

androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.androidx.ui.test.junit4)
androidTestImplementation(libs.test.junit)
androidTestImplementation(libs.test.espresso.core)
androidTestImplementation(libs.compose.ui.test.junit4)

testImplementation(libs.androidx.junit)
testImplementation(libs.test.junit)
// testImplementation(libs.androidx.compose.runtime)

debugImplementation(libs.androidx.ui.test.manifest)
debugImplementation(libs.compose.ui.test.manifest)

// for preview support
debugImplementation(libs.androidx.ui.tooling)
implementation(libs.androidx.ui.tooling.preview)
debugImplementation(libs.compose.ui.tooling)
implementation(libs.compose.ui.tooling.preview)
}
4 changes: 2 additions & 2 deletions crypto/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ dependencies {
implementation(libs.androidx.datastore.preferences)
implementation(libs.medzik.libcrypto)

androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.test.junit)
androidTestImplementation(libs.test.espresso.core)
}
92 changes: 51 additions & 41 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,70 +1,80 @@
[versions]
# Android SDK
android-sdk-min = "24"
android-sdk-target = "34"
android-sdk-compile = "34"
# Libraries

compose = "1.5.4"
compose-compiler = "1.5.8"
compose-lifecycle-runtime = "2.7.0"
compose-material3 = "1.1.2"
compose-navigation = "2.7.6"

accompanist = "0.32.0"

room = "2.6.1"

androidx-annotation = "1.7.1"
androidx-biometric = "1.2.0-alpha05"
androidx-compose-compiler = "1.5.8"
androidx-datastore = "1.1.0-beta01"
androidx-espresso-core = "3.5.1"
androidx-hilt = "1.1.0"
androidx-junit = "1.1.5"
androidx-lifecycle-runtime-compose = "2.7.0"
androidx-material-icons-extended = "1.5.4"
androidx-material3 = "1.1.2"
androidx-navigation-compose = "2.7.6"
androidx-room = "2.6.1"
androidx-ui = "1.5.4"

dagger = "2.50"
hilt = "1.1.0"

coil-compose = "2.5.0"
google-accompanist = "0.32.0"
google-dagger = "2.50"
google-material = "1.11.0"
kotlinx-coroutines-android = "1.7.3"
kotlinx-coroutines = "1.7.3"
librepass-client = "1.4.1"
medzik-libcrypto = "1.2.0"
process-phoenix = "2.1.2"

test-espresso-core = "3.5.1"
test-junit = "1.1.5"

# Plugins
android-application = "8.2.2"
google-ksp = "1.9.22-1.0.17"
kotlin-ksp = "1.9.22-1.0.17"
kotlin-android = "1.9.22"

[libraries]
compose-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "compose-lifecycle-runtime" }
compose-material-icons = { module = "androidx.compose.material:material-icons-extended", version.ref = "compose" }
compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" }
compose-navigation = { module = "androidx.navigation:navigation-compose", version.ref = "compose-navigation" }
compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose" }
compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "compose" }
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }

accompanist-drawablepainter = { module = "com.google.accompanist:accompanist-drawablepainter", version.ref = "accompanist" }
accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "accompanist" }

room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" }
room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }

androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" }
androidx-biometric = { module = "androidx.biometric:biometric", version.ref = "androidx-biometric" }
# Only for showing latest version from Android Studio. Used version ref by calling it directly.
androidx-compose-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "androidx-compose-compiler" }
androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "androidx-datastore" }
androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-espresso-core" }
androidx-hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "androidx-hilt" }
androidx-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-junit" }
androidx-lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle-runtime-compose" }
androidx-material-icons-extended = { module = "androidx.compose.material:material-icons-extended", version.ref = "androidx-material-icons-extended" }
androidx-material3 = { module = "androidx.compose.material3:material3", version.ref = "androidx-material3" }
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidx-navigation-compose" }
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "androidx-room" }
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "androidx-room" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "androidx-room" }
androidx-ui = { module = "androidx.compose.ui:ui", version.ref = "androidx-ui" }
androidx-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "androidx-ui" }
androidx-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "androidx-ui" }
androidx-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "androidx-ui" }
androidx-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "androidx-ui" }
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil-compose" }
google-accompanist-drawablepainter = { module = "com.google.accompanist:accompanist-drawablepainter", version.ref = "google-accompanist" }
google-accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "google-accompanist" }
google-dagger-hilt = { module = "com.google.dagger:hilt-android", version.ref = "google-dagger" }
google-dagger-hilt-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "google-dagger" }

dagger-hilt = { module = "com.google.dagger:hilt-android", version.ref = "dagger" }
dagger-hilt-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "dagger" }
hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "hilt" }

google-material = { module = "com.google.android.material:material", version.ref = "google-material" }
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines-android" }

coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil-compose" }
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }
librepass-client = { module = "dev.medzik.librepass:client", version.ref = "librepass-client" }
medzik-libcrypto = { module = "dev.medzik:libcrypto", version.ref = "medzik-libcrypto" }
process-phoenix = { module = "com.jakewharton:process-phoenix", version.ref = "process-phoenix" }

test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "test-espresso-core" }
test-junit = { module = "androidx.test.ext:junit", version.ref = "test-junit" }

[plugins]
android-application = { id = "com.android.application", version.ref = "android-application" }
android-library = { id = "com.android.library", version.ref = "android-application" }
google-dagger-hilt = { id = "com.google.dagger.hilt.android", version.ref = "google-dagger" }
google-ksp = { id = "com.google.devtools.ksp", version.ref = "google-ksp" }
dagger-hilt = { id = "com.google.dagger.hilt.android", version.ref = "dagger" }
kotlin-ksp = { id = "com.google.devtools.ksp", version.ref = "kotlin-ksp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-android" }
6 changes: 3 additions & 3 deletions m3-pullrefresh/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get()
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
}

dependencies {
compileOnly(libs.androidx.material3)
compileOnly(libs.androidx.ui)
compileOnly(libs.compose.material3)
compileOnly(libs.compose.ui)
}
4 changes: 2 additions & 2 deletions utils/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ android {

dependencies {
compileOnly(libs.androidx.annotation)
compileOnly(libs.kotlinx.coroutines.android)
compileOnly(libs.kotlinx.coroutines)

debugImplementation(libs.androidx.annotation)
debugImplementation(libs.kotlinx.coroutines.android)
debugImplementation(libs.kotlinx.coroutines)

// androidTestImplementation(libs.androidx.junit)
// androidTestImplementation(libs.androidx.espresso.core)
Expand Down

0 comments on commit c7624bd

Please sign in to comment.