kmp-project-template icon indicating copy to clipboard operation
kmp-project-template copied to clipboard

chore: Update Project Dependencies to Latest Version

Open TheKalpeshPawar opened this issue 10 months ago • 4 comments

This pull request introduces significant updates to the project's build logic and multiplatform configuration, with a focus on improving consistency, modernizing plugin usage, and streamlining dependency management across platforms. The most important changes are the migration to the androidLibrary DSL for Android configuration in multiplatform modules, updates to plugin application conventions, and enhanced dependency handling for platform-specific source sets.

Multiplatform and Build Logic Modernization:

  • Migrated Android configuration in multiplatform modules to use the androidLibrary DSL block instead of the legacy android block, improving consistency and future-proofing build scripts in files like cmp-navigation/build.gradle.kts, cmp-shared/build.gradle.kts, core-base/common/build.gradle.kts, core-base/database/build.gradle.kts, and core-base/designsystem/build.gradle.kts. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Updated plugin application in convention plugins: replaced com.android.library with com.android.kotlin.multiplatform.library and adjusted lint configuration logic to match, ensuring correct plugin usage for multiplatform projects. [1] [2]
  • Refactored the multiplatform configuration logic to use androidLibrary within the configureKotlinMultiplatform function, explicitly setting compileSdk, minSdk, resource handling, and desugaring dependencies.

Dependency and Source Set Improvements:

  • Improved Room database dependencies for multiplatform: added platform-specific dependencies for androidMain, desktopMain, nativeMain, and nonJsCommonMain source sets, ensuring correct runtime and SQLite support across platforms.
  • Enhanced Firebase and analytics dependency management: switched from api to implementation, added BOM support, and clarified dependency requirements for different source sets in core-base/analytics/build.gradle.kts.

Build Configuration and Toolchain Updates:

  • Standardized build toolchain configuration by using the Gradle toolchain API for Java 17 and updating Kotlin JVM target configuration, replacing legacy compatibility settings. [1] [2]
  • Added BuildKonfig plugin and configuration to enable build-time constants for flavors and demo mode in analytics, supporting better environment-based logic in multiplatform code. [1] [2] [3]

Gradle Settings and Plugin Management:

  • Updated settings.gradle.kts to include explicit plugin management repositories and the latest Kotlin JVM plugin version, ensuring reliable plugin resolution and compatibility.

These changes collectively modernize the project structure, improve multiplatform support, and lay the groundwork for easier maintenance and future upgrades.

Summary by CodeRabbit

  • New Features

    • Contextual month navigation in the tasks calendar (hides prev/next arrows at year boundaries).
    • Improved connectivity provider for more reliable online/offline behavior.
  • Bug Fixes & Improvements

    • Broad dependency upgrades across UI, networking, and platform libraries for stability and performance.
    • Modernized build and multiplatform configuration to streamline releases.
    • Update/review checks now honor debug/demo configuration, reducing spurious prompts during testing.

✏️ Tip: You can customize this high-level summary in your review settings.

TheKalpeshPawar avatar Jan 08 '26 16:01 TheKalpeshPawar

📝 Walkthrough

Walkthrough

Switches many modules from the legacy Android DSL to Kotlin Multiplatform's androidLibrary DSL, adopts Java toolchains for Java 17, updates the version catalog and plugin aliases, restructures Room/platform dependencies, integrates BuildKonfig, and applies several code fixes (month-indexing, datetime qualification, connectivity and analytics wiring).

Changes

Cohort / File(s) Summary
Root build & plugin management
build.gradle.kts, settings.gradle.kts, build-logic/settings.gradle.kts
Simplify repositories to google(), mavenCentral(), gradlePluginPortal(); add pluginManagement repos; register Kotlin JVM Gradle plugin; add many plugin aliases (most apply false).
Java toolchains
build-logic/convention/build.gradle.kts
Replace direct Java source/target 17 settings with Gradle Java toolchains (languageVersion = 17).
Kotlin Multiplatform convention changes
build-logic/convention/src/main/kotlin/* (KMPLibraryConventionPlugin.kt, KMPRoomConventionPlugin.kt, KotlinAndroid.kt, KotlinMultiplatform.kt)
Switch plugin identifiers toward Kotlin MPP library plugin, make configureKotlin() public, add androidLibrary target config (compileSdk/minSdk/desugaring), restructure Room dependencies to platform-specific adds, and adjust lint plugin detection.
Module Android → androidLibrary migrations
multiple build files under cmp-*/, core-*/**/build.gradle.kts, feature/*/build.gradle.kts (e.g., cmp-navigation/build.gradle.kts, core-base/*, core/*, feature/*)
Replace android { namespace = ... } with kotlin { androidLibrary { namespace = ... } } across many modules; add/adjust DSL imports; enable device/host test configs where present; move consumer proguard rules into optimization blocks.
Version catalog & dependency bumps
gradle/libs.versions.toml, cmp-android/dependencies/prodReleaseRuntimeClasspath.txt
Large-scale version upgrades across Kotlin, Compose/CMP, AndroidX, Firebase, Ktor, Koin, Coil, tooling; add buildKonfig and android-kotlin-multiplatform plugin entries and new library mappings (e.g., firebase-common-ktx).
BuildKonfig integration & usage
core-base/platform/build.gradle.kts, core-base/analytics/build.gradle.kts, core-base/platform/src/.../AppReviewManagerImpl.kt, .../AppUpdateManagerImpl.kt
Add buildkonfig plugin/blocks and fields (FLAVOR, IS_DEMO_MODE, DEBUG toggles); switch debug checks from BuildConfig.DEBUG to BuildKonfig.DEBUG.
Room dependency restructuring
build-logic/convention/src/main/kotlin/KMPRoomConventionPlugin.kt
Replace single androidx.room.ktx dependency with multiple platform-specific add("<sourceSet>Implementation", ...) entries (room runtime + sqlite bundled) for Android, desktop, native, and non-JS common.
New/modified Kotlin sources
core-base/analytics/src/androidMain/.../AnalyticsModule.kt, core/data/src/androidMain/.../ConnectivityProvider.android.kt
Add Koin analytics module wiring (AnalyticsHelper → StubAnalyticsHelper) and Android connectivity provider (actual val connectivityProvider) with autoStart(true).
Home feature: datetime & month-index fixes
feature/home/src/commonMain/.../EditTaskScreen.kt, TasksScreen.kt, TasksUiState.kt, TasksViewModel.kt, DateTimeFormatter.kt
Fully qualify datetime calls, rename/shift month field from selectedMonthIndex → selectedMonthNumber (1-based semantics), update month navigation/boundary and rendering logic.
Miscellaneous & formatting
cmp-shared/cmp_shared.podspec, assorted build files
Whitespace/formatting adjustments, some api→implementation dependency scope changes, minor import refinements.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~70 minutes

Possibly related PRs

  • openMF/kmp-project-template#101 — Addresses the same month-indexing change in TasksViewModel/TasksUiState (off-by-one / month field semantics).

Poem

🐰
I hopped through Gradle, nibbling old DSL thread,
Swapped namespaces, toolchains, and versions ahead.
BuildKonfig tucked flavors into pockets so neat,
Months now count proper — no off-by-one defeat!
Dependency carrots and repo clover to eat.

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 61.54% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'chore: Update Project Dependencies to Latest Version' is partially related to the changeset but overly broad, as the PR encompasses extensive build logic refactoring, multiplatform configuration migration, and toolchain updates beyond just dependency version bumping. Consider a more specific title that reflects the primary modernization effort, such as 'chore: Migrate to androidLibrary DSL and add BuildKonfig for Kotlin Multiplatform' or 'refactor: Modernize build configuration with androidLibrary and multiplatform support'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • [ ] 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Jan 08 '26 16:01 coderabbitai[bot]

@niyajali Bhaiya please review this PR. Also I need to connect with you to discuss some things so, please connect with me at your earliest convenience.

TheKalpeshPawar avatar Jan 09 '26 12:01 TheKalpeshPawar

@TheKalpeshPawar We appreciate your Pull Request. As previously discussed, a migration to Kotlin 2.3 is currently not reasonable due to extensive configuration modifications on the Android platform and incompatible library dependencies. Consequently, we will retain this Pull Request for future consideration. Thank you for your understanding.

niyajali avatar Jan 12 '26 15:01 niyajali

I'm converting this PR to "Draft" and will be open when all libraries are updated with the new version of Kotlin and ready to intregate on this project.

niyajali avatar Jan 12 '26 15:01 niyajali