Skip to content

Commit

Permalink
chore: allow internal use of deprecated APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
romainbsl committed Jul 11, 2024
1 parent 0af1948 commit 25bd0ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import org.kodein.type.generic
ReplaceWith("rememberViewModel", "org.kodein.di.compose.viewmodel"),
DeprecationLevel.WARNING
)
@Suppress("DEPRECATION")
public inline fun <reified VM : ViewModel> rememberViewModel(
tag: String? = null
): ViewModelLazy<VM> = with(localDI()) {
Expand Down Expand Up @@ -59,6 +60,7 @@ public inline fun <reified VM : ViewModel> rememberViewModel(
ReplaceWith("rememberViewModel", "org.kodein.di.compose.viewmodel"),
DeprecationLevel.WARNING
)
@Suppress("DEPRECATION")
public inline fun <reified VM : ViewModel> viewModel(
tag: String? = null
): VM = with(localDI()) {
Expand Down Expand Up @@ -95,6 +97,7 @@ public inline fun <reified VM : ViewModel> viewModel(
ReplaceWith("rememberViewModel", "org.kodein.di.compose.viewmodel"),
DeprecationLevel.WARNING
)
@Suppress("DEPRECATION")
public inline fun <reified A : Any, reified VM : ViewModel> rememberViewModel(
tag: String? = null,
arg: A,
Expand Down Expand Up @@ -138,6 +141,7 @@ public inline fun <reified A : Any, reified VM : ViewModel> rememberViewModel(
ReplaceWith("rememberViewModel", "org.kodein.di.compose.viewmodel"),
DeprecationLevel.WARNING
)
@Suppress("DEPRECATION")
public inline fun <reified A : Any, reified VM : ViewModel> viewModel(
tag: String? = null,
arg: A,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ kotlin.kodein {

common.mainDependencies {
implementation(kotlin.compose.runtime)
implementation(libs.jetbrains.lifecycle.viewmodel.compose)
api(projects.kodeinDi)
}

android {
sources.mainDependencies {
api(projects.framework.android.kodeinDiFrameworkAndroidX)
implementation(libs.jetbrains.compose.viewmodel)
implementation(libs.android.x.lifecycle.viewmodel.compose)
}
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ androidx-lifecycle = "2.7.0"
androidx-compose = "2.7.7"
# Compose
jbCompose = "1.6.11"
compose-viewmodel = "2.8.0"
jb-lifecycle = "2.8.0"
compose-navigation = "2.7.0-alpha07"
compose-compiler = "2.0.0"
compose-bom = "2024.05.00"
Expand Down Expand Up @@ -43,7 +43,7 @@ android-x-compose-navigation = { module = "androidx.navigation:navigation-compos
android-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "compose-bom" }
android-compose-runtime = { module = "androidx.compose.runtime:runtime" }
# Compose Multiplatform
jetbrains-compose-viewmodel = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "compose-viewmodel" }
jetbrains-lifecycle-viewmodel-compose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "jb-lifecycle" }
jetbrains-compose-navigation = { module = "org.jetbrains.androidx.navigation:navigation-compose", version.ref = "compose-navigation" }
# KSP
kotlinpoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinpoet" }
Expand Down

0 comments on commit 25bd0ad

Please sign in to comment.