-
-
Notifications
You must be signed in to change notification settings - Fork 729
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1953 from InsertKoinIO/split_vm_api
Split VM / Nav API - Retrograde to composeNavigation = "2.8.0-alpha02"
- Loading branch information
Showing
13 changed files
with
8,736 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
projects/compose/koin-compose-viewmodel-navigation/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
alias(libs.plugins.kotlinMultiplatform) | ||
alias(libs.plugins.jetbrainsCompose) | ||
alias(libs.plugins.compose.compiler) | ||
} | ||
|
||
val koinVersion: String by project | ||
version = koinVersion | ||
|
||
kotlin { | ||
jvmToolchain(1_8) | ||
jvm { | ||
withJava() | ||
} | ||
|
||
js(IR) { | ||
nodejs() | ||
browser() | ||
binaries.executable() | ||
} | ||
|
||
wasmJs { | ||
nodejs() | ||
binaries.executable() | ||
} | ||
|
||
iosX64() | ||
iosArm64() | ||
iosSimulatorArm64() | ||
macosX64() | ||
macosArm64() | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
api(project(":compose:koin-compose-viewmodel")) | ||
api(project(":core:koin-core-viewmodel-navigation")) | ||
api(libs.jb.composeNavigation) | ||
} | ||
} | ||
} | ||
|
||
tasks.withType<KotlinCompile>().all { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
} | ||
} | ||
|
||
tasks.withType<org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask>().configureEach { | ||
args.add("--ignore-engines") | ||
} | ||
|
||
apply(from = file("../../gradle/publish.gradle.kts")) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
projects/core/koin-core-viewmodel-navigation/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
alias(libs.plugins.kotlinMultiplatform) | ||
} | ||
|
||
val koinVersion: String by project | ||
version = koinVersion | ||
|
||
kotlin { | ||
jvmToolchain(1_8) | ||
jvm { | ||
withJava() | ||
} | ||
|
||
js(IR) { | ||
nodejs() | ||
browser() | ||
binaries.executable() | ||
} | ||
|
||
wasmJs { | ||
binaries.executable() | ||
nodejs() | ||
} | ||
|
||
iosX64() | ||
iosArm64() | ||
iosSimulatorArm64() | ||
macosX64() | ||
macosArm64() | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
api(project(":core:koin-core-viewmodel")) | ||
api(libs.jb.navigation) | ||
} | ||
} | ||
} | ||
|
||
tasks.withType<KotlinCompile>().all { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
} | ||
} | ||
|
||
tasks.withType<KotlinCompile>().all { | ||
compilerOptions { | ||
jvmTarget.set(JvmTarget.JVM_1_8) | ||
} | ||
} | ||
|
||
apply(from = file("../../gradle/publish.gradle.kts")) |
14 changes: 14 additions & 0 deletions
14
...n-core-viewmodel-navigation/src/commonMain/kotlin/org/koin/viewmodel/CreationExtrasExt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.koin.viewmodel | ||
|
||
import androidx.lifecycle.HasDefaultViewModelProviderFactory | ||
import androidx.lifecycle.ViewModelStoreOwner | ||
import androidx.lifecycle.viewmodel.CreationExtras | ||
import androidx.navigation.NavBackStackEntry | ||
import org.koin.core.annotation.KoinInternalApi | ||
|
||
@OptIn(KoinInternalApi::class) | ||
fun defaultNavExtras(viewModelStoreOwner: ViewModelStoreOwner): CreationExtras = when { | ||
viewModelStoreOwner is NavBackStackEntry && viewModelStoreOwner.arguments != null -> viewModelStoreOwner.arguments?.toExtras(viewModelStoreOwner) ?: CreationExtras.Empty | ||
viewModelStoreOwner is HasDefaultViewModelProviderFactory -> viewModelStoreOwner.defaultViewModelCreationExtras | ||
else -> CreationExtras.Empty | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.