Skip to content

Commit

Permalink
Merge pull request #13 from unusualcodeorg/version-catelog
Browse files Browse the repository at this point in the history
Version catalog
  • Loading branch information
janishar authored Jul 4, 2024
2 parents 7cee3f9 + 7115b68 commit 11fe28d
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 116 deletions.
168 changes: 64 additions & 104 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
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.hilt.android)
id("kotlin-parcelize")
id("com.google.devtools.ksp")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
alias(libs.plugins.devtools.ksp)
alias(libs.plugins.google.services)
alias(libs.plugins.firebase.crashlytics)
}

android {
Expand All @@ -17,7 +17,7 @@ android {
minSdk = 24
targetSdk = 34
versionCode = 1
versionName = "1.0"
versionName = "1.0.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand All @@ -27,7 +27,7 @@ android {

buildTypes {
debug {
buildConfigField("String", "BASE_URL", "\"http://192.168.1.6:3000/\"")
buildConfigField("String", "BASE_URL", "\"http://192.168.1.5:3000/\"")
buildConfigField("String", "API_KEY", "\"1D3F2DD1A5DE725DD4DF1D82BBB37\"")
}
release {
Expand Down Expand Up @@ -65,131 +65,91 @@ android {
}

dependencies {
implementation(libs.core)

val core = "1.12.0"
implementation("androidx.core:core-ktx:$core")

// Material Design 3
val material3 = "1.1.2"
implementation("androidx.compose.material3:material3:$material3")

// lifecycle
val lifecycle = "2.7.0"
implementation("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycle")
implementation("androidx.lifecycle:lifecycle-runtime-compose:$lifecycle")
// Lifecycle
implementation(libs.lifecycle.runtime)
implementation(libs.lifecycle.viewmodel)
implementation(libs.lifecycle.viewmodel.compose)
implementation(libs.lifecycle.runtime.compose)

// Compose
val compose = "2023.03.00"
implementation(platform("androidx.compose:compose-bom:$compose"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.material3:material3")
implementation("androidx.compose.ui:ui-tooling-preview")
debugImplementation("androidx.compose.ui:ui-tooling")
implementation("androidx.compose.material:material-icons-extended")
implementation("androidx.compose.material3:material3-window-size-class")
implementation(platform(libs.compose.bom))
implementation(libs.compose.ui)
implementation(libs.compose.ui.graphics)
implementation(libs.compose.ui.tooling.preview)
debugImplementation(libs.compose.ui.tooling)
implementation(libs.compose.material3)
implementation(libs.compose.material.icons)
implementation(libs.compose.material3.windowsize)

val navigation = "2.7.6"
implementation("androidx.navigation:navigation-compose:$navigation")
implementation(libs.navigation.compose)

val constraintlayout = "1.0.1"
implementation("androidx.constraintlayout:constraintlayout-compose:$constraintlayout")
implementation(libs.constraintlayout.compose)

val activity = "1.8.2"
implementation("androidx.activity:activity-compose:$activity")
implementation(libs.activity.compose)

val browser = "1.7.0"
implementation("androidx.browser:browser:$browser")
implementation(libs.browser)

val charty = "2.0.0-alpha01"
implementation("com.himanshoe:charty:$charty")
implementation(libs.charty)

// Coroutine
val coroutines = "1.7.3"
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines")
implementation(libs.coroutines.android)

// Log
val timber = "5.0.1"
implementation("com.jakewharton.timber:timber:$timber")
implementation(libs.timber)

// Network
val retrofit2 = "2.9.0"
implementation("com.squareup.retrofit2:retrofit:$retrofit2")
implementation("com.squareup.retrofit2:converter-moshi:${retrofit2}")
implementation(libs.retrofit2)
implementation(libs.retrofit2.moshi)

val okhttp3 = "4.11.0"
implementation(platform("com.squareup.okhttp3:okhttp-bom:$okhttp3"))
implementation("com.squareup.okhttp3:okhttp")
implementation("com.squareup.okhttp3:logging-interceptor")
implementation(platform(libs.okhttp.bom))
implementation(libs.okhttp)
implementation(libs.okhttp.logging)

// Firebase
val firebase = "32.7.0"
implementation(platform("com.google.firebase:firebase-bom:$firebase"))
implementation("com.google.firebase:firebase-analytics")
implementation("com.google.firebase:firebase-messaging")
implementation("com.google.firebase:firebase-crashlytics")
implementation("com.google.firebase:firebase-config")

val crashlytics = "2.9.9"
implementation("com.google.firebase:firebase-crashlytics-buildtools:$crashlytics")
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics)
implementation(libs.firebase.messaging)
implementation(libs.firebase.crashlytics)
implementation(libs.firebase.config)
implementation(libs.firebase.crashlytics.buildtools)

// Work
val work = "2.9.0"
implementation("androidx.work:work-runtime-ktx:$work")
implementation(libs.work.runtime)

// JSON
val moshi = "1.15.0"
implementation("com.squareup.moshi:moshi:$moshi")
ksp("com.squareup.moshi:moshi-kotlin-codegen:$moshi")
implementation(libs.moshi)
ksp(libs.moshi.codegen)

// Database
val room = "2.6.1"
implementation("androidx.room:room-runtime:$room")
ksp("androidx.room:room-compiler:$room")
implementation("androidx.room:room-ktx:$room")
implementation(libs.room.runtime)
ksp(libs.room.compiler)
implementation(libs.room)

// Dependency Management
val hilt = "2.50"
implementation("com.google.dagger:hilt-android:$hilt")
ksp("com.google.dagger:hilt-android-compiler:$hilt")

val hiltKtx = "1.1.0"
implementation("androidx.hilt:hilt-navigation-compose:$hiltKtx")
implementation("androidx.hilt:hilt-work:$hiltKtx")
ksp("androidx.hilt:hilt-compiler:$hiltKtx")
implementation(libs.hilt.android)
ksp(libs.hilt.android.compiler)
implementation(libs.hilt.navigation.compose)
implementation(libs.hilt.work)
ksp(libs.hilt.compiler)

// Image
val coil = "2.5.0"
implementation("io.coil-kt:coil:$coil")
implementation("io.coil-kt:coil-compose:$coil")

val lottie = "6.3.0"
implementation("com.airbnb.android:lottie-compose:$lottie")
implementation(libs.coil)
implementation(libs.coil.compose)
implementation(libs.lottie.compose)

// Unit Test
val junit = "4.13.2"
testImplementation("junit:junit:$junit")

val mockk = "1.13.9"
testImplementation("io.mockk:mockk:$mockk")

val coroutinesTest = "1.7.3"
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesTest")
testImplementation(libs.junit)
testImplementation(libs.mockk)
testImplementation(libs.coroutines.test)

// Android Test
val junitExt = "1.1.5"
androidTestImplementation("androidx.test.ext:junit:$junitExt")

val espresso = "3.5.1"
androidTestImplementation("androidx.test.espresso:espresso-core:$espresso")

androidTestImplementation("io.mockk:mockk-android:$mockk")

androidTestImplementation(platform("androidx.compose:compose-bom:$compose"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")

androidTestImplementation(libs.junit.ext)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(libs.mockk.android)
androidTestImplementation(platform(libs.compose.bom))
androidTestImplementation(libs.compose.ui.test.junit4)
debugImplementation(libs.compose.ui.tooling)
debugImplementation(libs.compose.ui.test.manifest)
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MainActivity : ComponentActivity() {
handleIntent(intent)
}

override fun onNewIntent(intent: Intent?) {
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
handleIntent(intent)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ object Destination {

abstract class Screen(baseRoute: String) {
companion object {
const val baseDeeplinkUrl = "app://wimm"
const val BASE_DEEPLINK_URL = "app://wimm"
}

open val route = baseRoute
open val deeplink = "${baseDeeplinkUrl}/$baseRoute"
open val deeplink = "${BASE_DEEPLINK_URL}/$baseRoute"
}

abstract class DynamicScreen(
Expand All @@ -39,11 +39,11 @@ object Destination {
val navArguments = listOf(navArgument(routeArgName) { type = NavType.StringType })

override val route = "$baseRoute/{$routeArgName}"
override val deeplink = "${baseDeeplinkUrl}/$baseRoute/{$routeArgName}"
override val deeplink = "${BASE_DEEPLINK_URL}/$baseRoute/{$routeArgName}"

fun dynamicRoute(param: String) = "$baseRoute/$param"

fun dynamicDeeplink(param: String) = "$baseDeeplinkUrl/$baseRoute/${param}"
fun dynamicDeeplink(param: String) = "$BASE_DEEPLINK_URL/$baseRoute/${param}"
}
}

12 changes: 6 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.2.1" apply false
id("org.jetbrains.kotlin.android") version "1.9.22" apply false
id("com.google.dagger.hilt.android") version "2.50" apply false
id("com.google.devtools.ksp") version "1.9.22-1.0.17" 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
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.hilt.android) apply false
alias(libs.plugins.devtools.ksp) apply false
alias(libs.plugins.google.services) apply false
alias(libs.plugins.firebase.crashlytics) apply false
}
Loading

0 comments on commit 11fe28d

Please sign in to comment.