diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 01fbe13..f0a23c9 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -26,7 +26,6 @@ android { isDebuggable = false isMinifyEnabled = true isShrinkResources = true - buildConfigField("String", "BASE_URL", "\"https://fakestoreapi.com/\"") proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" @@ -43,7 +42,6 @@ android { getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) - buildConfigField("String", "BASE_URL", "\"https://fakestoreapi.com/\"") } } @@ -72,8 +70,10 @@ dependencies { implementation(libs.androidx.core.splashscreen) implementation(libs.okhttp.logging.interceptor) - implementation(project(":core:common")) - implementation(project(":core:designsystem")) + implementation(projects.core.common) + implementation(projects.core.designsystem) + implementation(projects.core.data) + implementation(projects.core.domain) testImplementation(libs.junit4) @@ -94,6 +94,7 @@ dependencies { debugImplementation(libs.chucker) releaseImplementation(libs.chucker.no.op) + implementation(libs.androidx.compose.runtime) implementation(libs.androidx.lifecycle.runtime.ktx) implementation(libs.androidx.lifecycle.runtimeCompose) implementation(libs.compose.state.events) diff --git a/app/src/main/java/com/loodos/samplecomposeandroid/feature/navigation/MainNavHost.kt b/app/src/main/java/com/loodos/samplecomposeandroid/feature/navigation/MainNavHost.kt deleted file mode 100644 index 1eaef9c..0000000 --- a/app/src/main/java/com/loodos/samplecomposeandroid/feature/navigation/MainNavHost.kt +++ /dev/null @@ -1,51 +0,0 @@ -package com.loodos.samplecomposeandroid.feature.navigation - -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.navigation.NavHostController -import androidx.navigation.compose.NavHost -import androidx.navigation.navOptions -import com.loodos.samplecomposeandroid.feature.category.categoryScreen -import com.loodos.samplecomposeandroid.feature.home.navigation.HomeNavigationRoute -import com.loodos.samplecomposeandroid.feature.home.navigation.homeScreen -import com.loodos.samplecomposeandroid.feature.home.navigation.navigateToHome -import com.loodos.samplecomposeandroid.feature.login.navigation.LoginNavigationRoute -import com.loodos.samplecomposeandroid.feature.login.navigation.loginScreen -import com.loodos.samplecomposeandroid.feature.productdetail.navigateToProductDetail -import com.loodos.samplecomposeandroid.feature.productdetail.productDetail -import com.loodos.samplecomposeandroid.feature.profile.profileScreen - -/** - * Created by mertcantoptas on 10.03.2023 - */ - -@Composable -fun MainNavHost( - navController: NavHostController, - modifier: Modifier = Modifier, - startDestination: String = HomeNavigationRoute, -) { - NavHost( - modifier = modifier, - navController = navController, - startDestination = startDestination, - ) { - homeScreen( - navigateToDetail = { id -> - navController.navigateToProductDetail(id = id) - }, - ) - loginScreen(navigateToHome = { - navController.navigateToHome( - navOptions = navOptions { - popUpTo(LoginNavigationRoute) { - inclusive = true - } - }, - ) - }) - categoryScreen() - profileScreen() - productDetail() - } -} diff --git a/app/src/main/java/com/loodos/samplecomposeandroid/feature/navigation/TopLevelDestination.kt b/app/src/main/java/com/loodos/samplecomposeandroid/feature/navigation/TopLevelDestination.kt deleted file mode 100644 index 08c641f..0000000 --- a/app/src/main/java/com/loodos/samplecomposeandroid/feature/navigation/TopLevelDestination.kt +++ /dev/null @@ -1,34 +0,0 @@ -package com.loodos.samplecomposeandroid.feature.navigation - -import com.loodos.designsystems.icon.AppIcons -import com.loodos.designsystems.icon.Icon -import com.loodos.samplecomposeandroid.R -import com.loodos.samplecomposeandroid.feature.category.CategoryRoute -import com.loodos.samplecomposeandroid.feature.home.navigation.HomeNavigationRoute -import com.loodos.samplecomposeandroid.feature.profile.ProfileRoute - -enum class TopLevelDestination( - val route: String, - val selectedIcon: Icon, - val unselectedIcon: Icon, - val titleTextId: Int, -) { - HOME( - route = HomeNavigationRoute, - selectedIcon = Icon.ImageVectorIcon(AppIcons.Home), - unselectedIcon = Icon.ImageVectorIcon(AppIcons.HomeOutlined), - titleTextId = R.string.nav_home_title, - ), - CATEGORY( - route = CategoryRoute, - selectedIcon = Icon.ImageVectorIcon(AppIcons.Category), - unselectedIcon = Icon.ImageVectorIcon(AppIcons.CategoryOutlined), - titleTextId = R.string.nav_category_title, - ), - PROFILE( - route = ProfileRoute, - selectedIcon = Icon.ImageVectorIcon(AppIcons.Person), - unselectedIcon = Icon.ImageVectorIcon(AppIcons.PersonOutlined), - titleTextId = R.string.nav_profile_title, - ), -} diff --git a/build.gradle.kts b/build.gradle.kts index 0c3d1c5..6035384 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,6 +12,8 @@ plugins { alias(libs.plugins.firebase.crashlytics) apply false alias(libs.plugins.ksp) apply false alias(libs.plugins.com.android.library) apply false + alias(libs.plugins.secrets) apply false + } apply(from = "buildscripts/githooks.gradle") diff --git a/core/data/build.gradle.kts b/core/data/build.gradle.kts index 11e3e67..20194dc 100644 --- a/core/data/build.gradle.kts +++ b/core/data/build.gradle.kts @@ -2,6 +2,8 @@ plugins { id("samplecomposeanroid.android.library") id("samplecomposeanroid.android.hilt") id("kotlinx-serialization") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") + } android { @@ -14,6 +16,10 @@ android { } } +secrets { + defaultPropertiesFileName = "secrets.defaults.properties" +} + dependencies { implementation(libs.androidx.core.ktx) implementation(libs.kotlinx.coroutines.android) @@ -27,5 +33,4 @@ dependencies { debugImplementation(libs.chucker) releaseImplementation(libs.chucker.no.op) implementation(projects.core.common) - implementation(projects.core.designsystem) } diff --git a/core/data/src/main/java/com/loodos/data/di/RemoteDataModule.kt b/core/data/src/main/java/com/loodos/data/di/RemoteDataModule.kt index 7c362a9..6feadd6 100644 --- a/core/data/src/main/java/com/loodos/data/di/RemoteDataModule.kt +++ b/core/data/src/main/java/com/loodos/data/di/RemoteDataModule.kt @@ -4,8 +4,8 @@ import android.content.Context import com.chuckerteam.chucker.api.ChuckerCollector import com.chuckerteam.chucker.api.ChuckerInterceptor import com.chuckerteam.chucker.api.RetentionManager -import com.loodos.samplecomposeandroid.BuildConfig import com.loodos.data.remote.api.AuthenticationService +import com.loodos.samplecomposeanroid.core.data.BuildConfig import dagger.Module import dagger.Provides import dagger.hilt.InstallIn @@ -33,7 +33,7 @@ object RemoteDataModule { okHttpClient: OkHttpClient, gsonConverterFactory: GsonConverterFactory, ): Retrofit { - return Retrofit.Builder().baseUrl(BuildConfig.BUILD_TYPE) + return Retrofit.Builder().baseUrl(BuildConfig.BACKEND_URL) .addConverterFactory(gsonConverterFactory) .client(okHttpClient).build() } diff --git a/core/domain/build.gradle.kts b/core/domain/build.gradle.kts index 131725e..b18511b 100644 --- a/core/domain/build.gradle.kts +++ b/core/domain/build.gradle.kts @@ -1,5 +1,3 @@ -import org.jetbrains.kotlin.kapt3.base.Kapt.kapt - @Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed plugins { id("samplecomposeanroid.android.library") @@ -16,6 +14,9 @@ dependencies { implementation(libs.hilt.android) implementation(libs.kotlinx.coroutines.android) implementation(libs.kotlinx.datetime) + api(libs.androidx.compose.runtime) + api(libs.androidx.compose.runtime.livedata) + implementation(projects.core.data) implementation(projects.core.common) diff --git a/gradle.properties b/gradle.properties index 3b95974..c69b90e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,6 +26,8 @@ android.enableJetifier=true android.defaults.buildfeatures.resvalues=false android.defaults.buildfeatures.shaders=false android.features.buildConfig = true +android.suppressUnsupportedCompileSdk=34 +android.defaults.buildfeatures.buildconfig=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e46d0d4..89f14a2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,25 +2,25 @@ accompanist = "0.30.1" appCompat = "1.6.1" androidDesugarJdkLibs = "2.0.3" -androidGradlePlugin = "8.0.0" -androidxActivity = "1.7.1" +androidGradlePlugin = "8.0.2" +androidxActivity = "1.8.0" navigationCompose = "2.7.4" fragmentKtx = "1.6.1" okhttp = "4.10.0" kotlinxSerializationJson = "1.5.1" kotlinxCoroutines = "1.6.4" -androidxComposeBom = "2023.05.01" -androidxCoreSplashscreen = "1.0.0" +androidxComposeBom = "2023.10.00" +androidxCoreSplashscreen = "1.0.1" androidxDataStore = "1.0.0" -androidxMetrics = "1.0.0-alpha03" +androidxMetrics = "1.0.0-alpha04" androidxEspresso = "3.5.0" androidxHiltNavigationCompose = "1.0.0" -androidxLifecycle = "2.6.0-alpha05" +androidxLifecycle = "2.6.2" androidxTest = "1.1.5" firebaseBom = "31.2.0" firebaseCrashlyticsPlugin = "2.9.4" -gmsPlugin = "4.3.14" kotlin = "1.8.21" +gmsPlugin = "4.4.0" composeStateEvents = "1.2.3" kotlinxDatetime = "0.4.0" ksp = "1.8.21-1.0.11" @@ -33,14 +33,14 @@ detektGradlePlugin = "1.22.0" espresso = "3.5.1" gradleVersionsPlugin = "0.46.0" hiltNavigationCompose = "1.0.0" -androidxNavigation = "2.5.3" -hilt = "2.46.1" +androidxNavigation = "2.7.4" +hilt = "2.47" junit = "4.13.2" kotlinter = "3.14.0" -ktxCore = "1.10.1" +ktxCore = "1.12.0" leakCanary = "2.10" -lifecycle = "2.6.1" -material = "1.9.0" +lifecycle = "2.6.2" +material = "1.10.0" minSdk = "21" targetSdk = "34" moshi = "1.15.0" @@ -48,6 +48,7 @@ retrofit = "2.9.0" room = "2.5.1" chucker = "3.5.2" firebase-pref = "1.4.1" +secrets = "2.0.1" [libraries] @@ -131,4 +132,5 @@ com-android-test = { id = "com.android.test", version.ref = "com-android-test" } gradle-versions = { id = "com.github.ben-manes.versions", version.ref = "gradleVersionsPlugin" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detektGradlePlugin" } kotlinter = { id = "org.jmailen.kotlinter", version.ref = "kotlinter" } -ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } \ No newline at end of file +ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } +secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secrets" } diff --git a/secrets.defaults.properties b/secrets.defaults.properties new file mode 100644 index 0000000..c9e114b --- /dev/null +++ b/secrets.defaults.properties @@ -0,0 +1,4 @@ +## This file provides default values to modules using the secrets-gradle-plugin. It is necessary +# because the secrets properties file is not under source control so CI builds will fail without +# default values. +BACKEND_URL="https://fakestoreapi.com/" \ No newline at end of file