Skip to content

Commit

Permalink
A bit of cleaning configs, remove unused dependencies in libs.version…
Browse files Browse the repository at this point in the history
…s.toml and update gradle build configs
  • Loading branch information
Hospes committed May 31, 2024
1 parent 2f28827 commit f803c01
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 67 deletions.
24 changes: 9 additions & 15 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ android {
multiDexEnabled = true

buildConfigField("String", "NOTIFICATION_CHANNEL_RACE", "\"Race progress\"")

// javaCompileOptions {
// annotationProcessorOptions {
// // arguments += ["room.incremental": "true"]
// arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
// }
// }
}

buildFeatures {
Expand Down Expand Up @@ -100,6 +93,9 @@ android {
ksp {
arg("compose-destinations.useComposableVisibility", "true")
arg("compose-destinations.generateNavGraphs", "false")

arg("room.incremental", "true")
arg("room.schemaLocation", "$projectDir/schemas")
}

dependencies {
Expand All @@ -116,21 +112,19 @@ dependencies {

implementation(libs.androidx.core)
implementation(libs.androidx.activity.compose)
implementation("androidx.fragment:fragment-ktx:1.7.1")
implementation("androidx.preference:preference-ktx:1.2.1")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation(libs.androidx.fragment)
implementation(libs.androidx.appcompat)
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.recyclerview:recyclerview:1.3.2")
implementation("androidx.drawerlayout:drawerlayout:1.2.0")
implementation("androidx.annotation:annotation:1.8.0")
implementation("androidx.preference:preference-ktx:1.2.1")
implementation("com.google.android.material:material:1.12.0")

implementation("com.github.kirich1409:viewbindingpropertydelegate-noreflection:1.5.6")

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.androidx.room.runtime)
implementation(libs.androidx.room.ktx)
ksp(libs.androidx.room.compiler)

implementation(libs.google.hilt.android)
ksp(libs.google.hilt.compiler)
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
<item name="appBarLayoutStyle">@style/Widget.RTM.AppBarLayout</item>
<!-- <item name="actionBarPopupTheme">@style/ThemeOverlay.AppCompat</item>-->

<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
<!-- <item name="delayedButtonStyle">@style/UndoButton</item>-->
<item name="android:dialogTheme">@style/Theme.RTM.Dialog</item>
</style>
Expand Down
11 changes: 3 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ allprojects {
}
}

// Configure kapt
//pluginManager.withPlugin(rootProject.libs.plugins.kotlin.kapt.get().pluginId) {
// extensions.getByType<KaptExtension>().correctErrorTypes = true
//}

// Configure Android projects
pluginManager.withPlugin("com.android.application") { configureAndroidProject() }
pluginManager.withPlugin("com.android.library") { configureAndroidProject() }
Expand All @@ -74,11 +69,11 @@ tasks.register<Delete>("clean") {

fun Project.configureAndroidProject() {
extensions.configure<BaseExtension> {
compileSdkVersion(libs.versions.compileSdk.get().toInt())
compileSdkVersion(34)

defaultConfig {
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.targetSdk.get().toInt()
minSdk = 23
targetSdk = 34
}

// Can remove this once https://issuetracker.google.com/issues/260059413 is fixed.
Expand Down
51 changes: 15 additions & 36 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
[versions]
agp = "8.4.1"
compileSdk = "34"
targetSdk = "34"
minSdk = "23"
#Kotlin
kotlin = "2.0.0"
ksp = "2.0.0-1.0.21"
kotlinx-serialization = "1.6.3"
kotlinx-coroutines = "1.8.1"
#Compose
compose = "1.6.7"
compose = "1.7.0-beta02"
#Squareup
squareup-okhttp3 = "4.12.0" # 5.0.0-alpha.12 (after retrofit removed)
squareup-retrofit2 = "2.11.0"
#Android
androidx-activity = "1.9.0"
androidx-credentials = "1.3.0-alpha04"
androidx-fragment = "1.8.0-rc01"
androidx-appcompat = "1.7.0"
androidx-room = "2.6.1"
#Google
google-hilt = "2.51.1"
#Apollo
apollo3 = "3.8.4"
#Others
lifecycle = "2.7.0"
lifecycle = "2.8.1"
accompanist = "0.34.0"
braze = "31.1.0"
coil = "2.6.0"
Expand All @@ -38,10 +37,10 @@ kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref =
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
google-play-publisher = { id = "com.github.triplet.play", version = "3.8.1" }
google-hilt = { id = "com.google.dagger.hilt.android", version.ref = "google-hilt" }
google-gms = { id = "com.google.gms.google-services", version = "4.4.1" }
google-gms = { id = "com.google.gms.google-services", version = "4.4.2" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
apollo3 = { id = "com.apollographql.apollo3", version.ref = "apollo3" }
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version = "2.9.9" }
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version = "3.0.1" }
firebase-appdistribution = { id = "com.google.firebase.appdistribution", version = "5.0.0" }

[libraries]
Expand All @@ -52,18 +51,14 @@ classpath-javapoet = { module = "com.squareup:javapoet", version = "1.13.0" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }
#Squareup
squareup-okhttp3 = { module = "com.squareup.okhttp3:okhttp", version.ref = "squareup-okhttp3" }
squareup-okhttp3-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "squareup-okhttp3" }
squareup-retrofit2 = { module = "com.squareup.retrofit2:retrofit", version.ref = "squareup-retrofit2" }
squareup-retrofit2-serialization = { module = "com.squareup.retrofit2:converter-kotlinx-serialization", version.ref = "squareup-retrofit2" }
#Androidx
androidx-core = { module = "androidx.core:core-ktx", version = "1.13.1" }
androidx-activity = { module = "androidx.activity:activity", version.ref = "androidx-activity" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
androidx-browser = { module = "androidx.browser:browser", version = "1.8.0" }
androidx-fragment = { module = "androidx.fragment:fragment-ktx", version.ref = "androidx-fragment" } # TODO: To be removed
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" } # TODO: To be removed
androidx-hilt-navigation = { module = "androidx.hilt:hilt-navigation-compose", version = "1.2.0" }
androidx-navigation = { module = "androidx.navigation:navigation-compose", version = "2.7.7" }
androidx-navigation = { module = "androidx.navigation:navigation-compose", version = "2.8.0-beta02" }
androidx-compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "compose" }
androidx-compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
androidx-compose-ui-util = { module = "androidx.compose.ui:ui-util", version.ref = "compose" }
Expand All @@ -73,49 +68,35 @@ androidx-compose-foundation-layout = { module = "androidx.compose.foundation:fou
androidx-compose-animation = { module = "androidx.compose.animation:animation", version.ref = "compose" }
androidx-compose-material = { module = "androidx.compose.material:material", version.ref = "compose" }
androidx-compose-material-icons = { module = "androidx.compose.material:material-icons-core", version.ref = "compose" }
androidx-credentials = { module = "androidx.credentials:credentials", version.ref = "androidx-credentials" }
androidx-credentials-play-service-auth = { module = "androidx.credentials:credentials-play-services-auth", version.ref = "androidx-credentials" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "androidx-room" } # TODO: To be replaced by SQLDelight
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "androidx-room" }
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "androidx-room" }
#Google
google-hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "google-hilt" }
google-hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "google-hilt" } # TODO: To be replaced by kotlin-inject or koin
google-hilt-core = { module = "com.google.dagger:hilt-core", version.ref = "google-hilt" }
google-hilt-compiler = { module = "com.google.dagger:hilt-compiler", version.ref = "google-hilt" }
google-play-app-update = { module = "com.google.android.play:app-update-ktx", version = "2.1.0" }
google-places = { module = "com.google.android.libraries.places:places", version = "3.4.0" }
google-googleid = { module = "com.google.android.libraries.identity.googleid:googleid", version = "1.1.0" }
#Apollo
apollo3-runtime = { module = "com.apollographql.apollo3:apollo-runtime", version.ref = "apollo3" }
apollo3-adapters = { module = "com.apollographql.apollo3:apollo-adapters", version.ref = "apollo3" }
apollo3-normalized-cache-sqlite = { module = "com.apollographql.apollo3:apollo-normalized-cache-sqlite", version.ref = "apollo3" }

lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "lifecycle" }
lifecycle-viewmodel-savedstate = { module = "androidx.lifecycle:lifecycle-viewmodel-savedstate", version.ref = "lifecycle" }
lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycle" }
accompanist-system-ui-controller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "accompanist" }
accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanist" }

firebase-bom = { module = "com.google.firebase:firebase-bom", version = "33.0.0" }
firebase-bom = { module = "com.google.firebase:firebase-bom", version = "33.1.0" }
firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics" }
firebase-analytics = { module = "com.google.firebase:firebase-analytics" }
firebase-config = { module = "com.google.firebase:firebase-config" }
firebase-messaging = { module = "com.google.firebase:firebase-messaging" }

braze-ui = { module = "com.braze:android-sdk-ui", version.ref = "braze" }
braze-location = { module = "com.braze:android-sdk-location", version.ref = "braze" }
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
coil-svg = { module = "io.coil-kt:coil-svg", version.ref = "coil" }
compose-destinations-ksp = { module = "io.github.raamcosta.compose-destinations:ksp", version.ref = "compose-destinations" }
compose-destinations-core = { module = "io.github.raamcosta.compose-destinations:core", version.ref = "compose-destinations" }
compose-destinations-animations-core = { module = "io.github.raamcosta.compose-destinations:animations-core", version.ref = "compose-destinations" }
facebook-login = { module = "com.facebook.android:facebook-login", version = "17.0.0" }
lokalise = { module = "com.lokalise.android:sdk", version = "2.3.1-lite" }
stripe = { module = "com.stripe:stripe-android", version = "20.42.0" }
timber = { module = "com.jakewharton.timber:timber", version = "5.0.1" }
tools-desugarjdklibs = { module = "com.android.tools:desugar_jdk_libs", version = "2.0.4" }

headed-lazy-grid = { module = "com.github.Hospes:headed-lazy-grid", version = "0.9.2" }
libphonenumber-android = { module = "io.michaelrocks:libphonenumber-android", version = "8.13.35" }
telephoto = { module = "me.saket.telephoto:zoomable-image-coil", version = "0.11.2" }
mixpanel = { module = "com.mixpanel.android:mixpanel-android", version = "7.5.2" }

# Multiplatform ready
markdown-renderer = { module = "com.mikepenz:multiplatform-markdown-renderer-android", version.ref = "markdown" }
Expand All @@ -137,8 +118,6 @@ androidx-compose = [
"androidx-compose-foundation", "androidx-compose-foundation-layout",
"androidx-compose-runtime", "androidx-compose-animation", "androidx-compose-material"
]
androidx-credentials = ["androidx-credentials", "androidx-credentials-play-service-auth"]
firebase = ["firebase-crashlytics", "firebase-analytics", "firebase-config", "firebase-messaging"]
lifecycle = ["lifecycle-runtime-compose", "lifecycle-viewmodel-savedstate", "lifecycle-viewmodel-compose"]
braze = ["braze-ui", "braze-location"]
markdown-renderer = ["markdown-renderer", "markdown-renderer-m2"]
7 changes: 0 additions & 7 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
@file:Suppress("UnstableApiUsage")

pluginManagement {
// build-logic disabled because it takes time every gradle sync to compile plugins
// those plugin actually used only in 2 modules :core:base and :core:preferences
// unfortunately github actions are pretty slow and each build slowed approx on 2 minutes
// because of compiling build-logic folder
// Enable it only if project really moves to KMP at least :data module
//includeBuild("gradle/build-logic")

repositories {
google {
content {
Expand Down

0 comments on commit f803c01

Please sign in to comment.