Skip to content

Commit

Permalink
reformatted app level gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
bedirhansaricayir committed May 14, 2024
1 parent e879cb7 commit b274362
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 170 deletions.
76 changes: 8 additions & 68 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import java.util.Properties
import java.io.FileInputStream

@Suppress("DSL_SCOPE_VIOLATION")

plugins {
Expand Down Expand Up @@ -91,72 +92,11 @@ android {

dependencies {
api(project(":core:network"))
coreLibraryDesugaring(Dependencies.desugaring)

implementation(Dependencies.coreKtx)
implementation(platform(Dependencies.platformKotlin))
implementation(Dependencies.lifecycleRuntimeKtx)
implementation(Dependencies.compose)
implementation(platform(Dependencies.platformCompose))
implementation(Dependencies.composeUi)
implementation(Dependencies.composeUiGraphics)
implementation(Dependencies.composeUiPreview)
implementation(Dependencies.material3)
implementation(Dependencies.foundation)

testImplementation(Dependencies.junit)
androidTestImplementation(Dependencies.junitTest)
androidTestImplementation(Dependencies.espressoCore)
androidTestImplementation(platform(Dependencies.composeTest))
androidTestImplementation(Dependencies.composeTestJunit4)
debugImplementation(Dependencies.composeTestTooling)
debugImplementation(Dependencies.composeTestManifest)

implementation(Dependencies.composeViewModel)
implementation(Dependencies.ktxViewModel)

implementation(Dependencies.coroutinesCore)
implementation(Dependencies.coroutinesAndroid)

implementation(Dependencies.retrofit)
implementation(Dependencies.gsonConvertor)
implementation(Dependencies.okHttp)
implementation(Dependencies.okHttpInterceptor)

implementation(Dependencies.navigation)

implementation(Dependencies.splash)

implementation(Dependencies.hiltAndroid)
ksp(Dependencies.hiltAndroidCompiler)
implementation(Dependencies.hiltNavigationCompose)
ksp(Dependencies.hiltCompiler)

implementation(Dependencies.datastore)

implementation(Dependencies.numberPicker)

implementation(platform(Dependencies.platformFirebase))
implementation(Dependencies.firebaseAuth)
implementation(Dependencies.crashlytics)
implementation(Dependencies.firestore)
implementation(Dependencies.storage)
implementation(Dependencies.config)

implementation(Dependencies.googleServicesAuth)

implementation(Dependencies.coil)
implementation(Dependencies.youtubePlayer)
implementation(Dependencies.chart)
implementation(Dependencies.room)
ksp(Dependencies.roomCompiler)
implementation(Dependencies.roomRuntime)

implementation(Dependencies.calendar)

implementation(Dependencies.media3)
implementation(Dependencies.media3_exoplayer)

implementation(Dependencies.inappUpdate)
implementation(Dependencies.inappUpdateKtx)

Kotlin.list.forEach(::api)
Compose.list.forEach(::api)
Di.list.forEach(::api)

coreLibraryDesugaring(ThirdParty.desugaring)
api(Androidx.splash)
}
108 changes: 6 additions & 102 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,105 +1,13 @@
object Dependencies {

//Core
val coreKtx by lazy { "androidx.core:core-ktx:${Versions.coreKtxVersion}" }
val platformKotlin by lazy { "org.jetbrains.kotlin:kotlin-bom:${Versions.platformKotlinBomVersion}" }
val lifecycleRuntimeKtx by lazy { "androidx.lifecycle:lifecycle-runtime-ktx:${Versions.lifecycleRuntimeKtxVersion}" }
val compose by lazy { "androidx.activity:activity-compose:${Versions.activityComposeVersion}" }
val platformCompose by lazy { "androidx.compose:compose-bom:${Versions.platformComposeBomVersion}" }
val composeUi by lazy { "androidx.compose.ui:ui" }
val composeUiGraphics by lazy { "androidx.compose.ui:ui-graphics" }
val composeUiPreview by lazy { "androidx.compose.ui:ui-tooling-preview" }
val material3 by lazy { "androidx.compose.material3:material3:${Versions.material3Version}" }
val foundation by lazy { "androidx.compose.foundation:foundation:${Versions.foundationVersion}" }


//Test
val junit by lazy { "junit:junit:${Versions.junitVersion}" }
val junitTest by lazy { "androidx.test.ext:junit:${Versions.junitTestVersion}" }
val espressoCore by lazy { "androidx.test.espresso:espresso-core:${Versions.espressoCoreVersion}" }
val composeTest by lazy { "androidx.compose:compose-bom:${Versions.platformComposeBomTestVersion}" }
val composeTestJunit4 by lazy { "androidx.compose.ui:ui-test-junit4" }
val composeTestTooling by lazy { "androidx.compose.ui:ui-tooling" }
val composeTestManifest by lazy { "androidx.compose.ui:ui-test-manifest" }

//Viewmodel
val composeViewModel by lazy { "androidx.lifecycle:lifecycle-viewmodel-compose:${Versions.lifecycleViewmodelComposeVersion}" }
val ktxViewModel by lazy { "androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.lifecycleViewmodelKtxVersion}" }

//Coroutines
val coroutinesCore by lazy { "org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.coroutinesCoreVersion}" }
val coroutinesAndroid by lazy { "org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.coroutinesAndroidVersion}" }

//Retrofit
val retrofit by lazy { "com.squareup.retrofit2:retrofit:${Versions.retrofitVersion}" }
val gsonConvertor by lazy { "com.squareup.retrofit2:converter-gson:${Versions.converterGsonVersion}" }
val okHttp by lazy { "com.squareup.okhttp3:okhttp:${Versions.okhttpVersion}" }
val okHttpInterceptor by lazy { "com.squareup.okhttp3:logging-interceptor:${Versions.okhttpInterceptorVersion}" }

//Navigation
val navigation by lazy { "androidx.navigation:navigation-compose:${Versions.composeNavigationVersion}" }

//Splash API
val splash by lazy { "androidx.core:core-splashscreen:${Versions.splashScreenVersion}" }

//Dagger - Hilt
val hiltAndroid by lazy { "com.google.dagger:hilt-android:${Versions.hiltAndroidVersion}" }
val hiltAndroidCompiler by lazy { "com.google.dagger:hilt-android-compiler:${Versions.hiltAndroidCompilerVersion}" }
val hiltNavigationCompose by lazy { "androidx.hilt:hilt-navigation-compose:${Versions.hiltNavigationComposeVersion}" }
val hiltCompiler by lazy { "androidx.hilt:hilt-compiler:${Versions.hiltCompilerVersion}" }

//Datastore
val datastore by lazy { "androidx.datastore:datastore-preferences:${Versions.datastoreVersion}" }

//Numberpicker
val numberPicker by lazy { "com.chargemap.compose:numberpicker:${Versions.numberpickerVersion}" }

//Firebase
val platformFirebase by lazy { "com.google.firebase:firebase-bom:${Versions.platformFirebaseBomVersion}" }
val firebaseAuth by lazy { "com.google.firebase:firebase-auth-ktx" }
val crashlytics by lazy { "com.google.firebase:firebase-crashlytics-ktx" }
val firestore by lazy { "com.google.firebase:firebase-firestore-ktx" }
val storage by lazy { "com.google.firebase:firebase-storage-ktx" }
val config by lazy { "com.google.firebase:firebase-config-ktx" }

//GoogleAuth
val googleServicesAuth by lazy { "com.google.android.gms:play-services-auth:${Versions.googleServicesAuthVersion}" }

//Coil
val coil by lazy { "io.coil-kt:coil-compose:${Versions.coilVersion}" }

//Player
val youtubePlayer by lazy { "com.pierfrancescosoffritti.androidyoutubeplayer:chromecast-sender:${Versions.youtubePlayerVersion}" }

//Chart
val chart by lazy { "com.github.PhilJay:MPAndroidChart:${Versions.chartVersion}" }

//Room
val room by lazy { "androidx.room:room-ktx:${Versions.roomVersion}" }
val roomRuntime by lazy { "androidx.room:room-runtime:${Versions.roomVersion}" }
val roomCompiler by lazy { "androidx.room:room-compiler:${Versions.roomVersion}" }

//Calendar
val calendar by lazy { "com.kizitonwose.calendar:compose:${Versions.calendarVersion}" }

//Desugaring
val desugaring by lazy { "com.android.tools:desugar_jdk_libs:${Versions.desugaringVersion}" }

//Media3
val media3 by lazy { "androidx.media3:media3-ui:${Versions.media3Version}" }
val media3_exoplayer by lazy { "androidx.media3:media3-exoplayer:${Versions.media3Version}" }

val inappUpdate by lazy { "com.google.android.play:app-update:${Versions.updateVersion}" }
val inappUpdateKtx by lazy { "com.google.android.play:app-update:${Versions.updateVersion}" }
}
object Kotlin {
private val coreKtx by lazy { "androidx.core:core-ktx:${Versions.coreKtxVersion}" }
private val platformKotlin by lazy { "org.jetbrains.kotlin:kotlin-bom:${Versions.platformKotlinBomVersion}" }
private val coroutinesCore by lazy { "org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.coroutinesCoreVersion}" }
private val coroutinesAndroid by lazy { "org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.coroutinesAndroidVersion}" }
private val lifecycleRuntimeKtx by lazy { "androidx.lifecycle:lifecycle-runtime-ktx:${Versions.lifecycleRuntimeKtxVersion}" }
val ktxViewModel by lazy { "androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.lifecycleViewmodelKtxVersion}" }

val list =
listOf(coreKtx, platformKotlin, coroutinesCore, coroutinesCore, lifecycleRuntimeKtx, coroutinesAndroid)
listOf(coreKtx, platformKotlin, coroutinesCore, coroutinesCore, lifecycleRuntimeKtx, coroutinesAndroid, ktxViewModel)
}

object Compose {
Expand All @@ -111,9 +19,10 @@ object Compose {
private val material3 by lazy { "androidx.compose.material3:material3:${Versions.material3Version}" }
private val foundation by lazy { "androidx.compose.foundation:foundation:${Versions.foundationVersion}" }
private val navigation by lazy { "androidx.navigation:navigation-compose:${Versions.composeNavigationVersion}" }
val composeViewModel by lazy { "androidx.lifecycle:lifecycle-viewmodel-compose:${Versions.lifecycleViewmodelComposeVersion}" }
val list = listOf(
compose, platformCompose, composeUi, composeUiGraphics, composeUiPreview,
material3, foundation, navigation
material3, foundation, navigation, composeViewModel
)
}

Expand All @@ -122,6 +31,7 @@ object Di {
val hiltAndroidCompiler by lazy { "com.google.dagger:hilt-android-compiler:${Versions.hiltAndroidCompilerVersion}" }
val hiltNavigationCompose by lazy { "androidx.hilt:hilt-navigation-compose:${Versions.hiltNavigationComposeVersion}" }
val hiltCompiler by lazy { "androidx.hilt:hilt-compiler:${Versions.hiltCompilerVersion}" }
val list = listOf(hiltAndroid, hiltAndroidCompiler, hiltNavigationCompose, hiltCompiler)
}
object Test {
val junit by lazy { "junit:junit:${Versions.junitVersion}" }
Expand Down Expand Up @@ -155,12 +65,6 @@ object ThirdParty {
val desugaring by lazy { "com.android.tools:desugar_jdk_libs:${Versions.desugaringVersion}" }
}

object ViewModel {
val composeViewModel by lazy { "androidx.lifecycle:lifecycle-viewmodel-compose:${Versions.lifecycleViewmodelComposeVersion}" }
val ktxViewModel by lazy { "androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.lifecycleViewmodelKtxVersion}" }
}


object Network {
val retrofit by lazy { "com.squareup.retrofit2:retrofit:${Versions.retrofitVersion}" }
val gsonConvertor by lazy { "com.squareup.retrofit2:converter-gson:${Versions.converterGsonVersion}" }
Expand Down

0 comments on commit b274362

Please sign in to comment.