Fix #305 Hilt integration + libs bump/fix
Fixes #305
- Hilt integration fix
- Hilt integration sample
- Deps versions bump/fix
Summary by CodeRabbit
-
New Features
- Added Hilt dependency injection framework integration for Android platform
- Integrated Kotlin Symbol Processing (KSP) support
-
Chores
- Updated Kotlin to version 2.2.21
- Updated Jetbrains Compose to version 1.10.0-beta02
- Bumped AndroidX Activity Compose, BuildConfig plugin, and related dependencies
- Enhanced tooling libraries for improved development experience
@coderabbit review
✅ Actions performed
Review triggered.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
Walkthrough
Integrates Hilt dependency injection into the Kotlin Multiplatform Compose sample application by adding Hilt and KSP plugins to the build configuration, updating dependencies, establishing the Hilt entry point via a custom Application class, and creating a sample screen demonstrating Hilt-based ViewModel injection. Additionally updates the navigation framework's view model store ownership handling and refactors retained values store implementation.
Changes
| Cohort / File(s) | Change Summary |
|---|---|
Gradle Build Configuration build.gradle.kts |
Adds Hilt and KSP plugin aliases with apply false to the plugins block. |
Dependency Management gradle/libs.versions.toml |
Adds Kotlin version 2.2.21 and Jetbrains Compose beta version; introduces Hilt Android and Hilt Compiler libraries; adds Hilt and KSP plugin declarations; updates androidx-activity-compose to 1.12.0, compose-navigationevent to beta02, detekt-compose to 0.4.28, buildconfig to 6.0.4, and kctfork to 0.11.1; adds kotlin-test, kotlin-compiler-embeddable, and kotlin-gradle-plugin-api. |
Sample App Build Configuration sample/composeApp/build.gradle.kts |
Applies Hilt and KSP plugins; adds Hilt lifecycle ViewModel Compose, Hilt Android, and Hilt Compiler dependencies with KSP processor configuration. |
Sample App Hilt Integration sample/composeApp/src/androidMain/AndroidManifest.xml, sample/composeApp/src/androidMain/kotlin/.../MainActivity.kt, sample/composeApp/src/androidMain/kotlin/.../TiamatSampleApp.kt |
Adds TiamatSampleApp class with @HiltAndroidApp annotation as the application entry point; annotates MainActivity with @AndroidEntryPoint; specifies application class in manifest. |
Sample Hilt Feature sample/composeApp/src/androidMain/kotlin/.../HiltScreen.kt, sample/composeApp/src/androidMain/kotlin/.../Platform.android.kt |
Introduces HiltDependency and HiltSampleViewModel with constructor injection; adds HiltSample navigation destination; registers Hilt feature in platform features list. |
Navigation Framework Updates tiamat/src/commonMain/kotlin/.../NavEntry.kt, tiamat/src/commonMain/kotlin/.../ComposableNavEntry.kt |
Replaces ControlledRetainedValuesStore with ManagedRetainedValuesStore and updates retention control methods; introduces rememberEntryContentViewModelStoreOwner() composable for delegated ViewModelStoreOwner management with HasDefaultViewModelProviderFactory support. |
Test Utilities tiamat/src/commonTest/kotlin/.../TestUtils.kt, tiamat/src/commonTest/kotlin/.../RememberSaveable.kt |
Adds readText() extension function on SemanticsNodeInteraction to fetch text from semantics nodes; updates RememberSaveable test to use the new extension. |
Possibly related PRs
- ComposeGears/Tiamat#273: Modifies navigation implementation including NavEntry and ComposableNavEntry wiring, directly related to the view-model store ownership and lifecycle management changes in this PR.
Suggested reviewers
- egorikftp
Pre-merge checks and finishing touches
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately summarizes the main changes: Hilt integration fix/sample and dependency version updates are the primary focuses of this PR. |
✨ Finishing touches
- [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
bugfix/#305-hilt-compativility-fix
[!TIP]
📝 Customizable high-level summaries are now available in beta!
You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
- Provide your own instructions using the
high_level_summary_instructionssetting.- Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
- Use
high_level_summary_in_walkthroughto move the summary from the description to the walkthrough section.Example instruction:
"Divide the high-level summary into five sections:
- 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
- 📓 References — List relevant issues, discussions, documentation, or related PRs.
- 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
- 📊 Contributor Summary — Include a Markdown table showing contributions:
| Contributor | Lines Added | Lines Removed | Files Changed |- ✔️ Additional Notes — Add any extra reviewer context. Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.
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.
Comment @coderabbitai help to get the list of available commands and usage tips.