-
-
Notifications
You must be signed in to change notification settings - Fork 728
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 #2086 from InsertKoinIO/koinapplication_mp_config
KoinApplication Multiplatform Config - Logger + Androic context automatic injection
- Loading branch information
Showing
12 changed files
with
274 additions
and
8 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
65 changes: 65 additions & 0 deletions
65
projects/compose/koin-compose/api/android/koin-compose.api
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,65 @@ | ||
public final class org/koin/compose/KoinApplicationKt { | ||
public static final fun KoinApplication (Lkotlin/jvm/functions/Function1;Lorg/koin/core/logger/Level;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V | ||
public static final fun KoinContext (Lorg/koin/core/Koin;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V | ||
public static final fun KoinIsolatedContext (Lorg/koin/core/KoinApplication;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V | ||
public static final fun currentKoinScope (Landroidx/compose/runtime/Composer;I)Lorg/koin/core/scope/Scope; | ||
public static final fun getKoin (Landroidx/compose/runtime/Composer;I)Lorg/koin/core/Koin; | ||
public static final fun getLocalKoinApplication ()Landroidx/compose/runtime/ProvidableCompositionLocal; | ||
public static final fun getLocalKoinScope ()Landroidx/compose/runtime/ProvidableCompositionLocal; | ||
} | ||
|
||
public final class org/koin/compose/application/CompositionKoinApplicationLoader : androidx/compose/runtime/RememberObserver { | ||
public static final field $stable I | ||
public fun <init> (Lorg/koin/core/KoinApplication;)V | ||
public final fun getKoin ()Lorg/koin/core/Koin; | ||
public final fun getKoinApplication ()Lorg/koin/core/KoinApplication; | ||
public fun onAbandoned ()V | ||
public fun onForgotten ()V | ||
public fun onRemembered ()V | ||
public final fun setKoin (Lorg/koin/core/Koin;)V | ||
} | ||
|
||
public final class org/koin/compose/application/RememberKoinApplicationKt { | ||
public static final fun rememberKoinApplication (Lorg/koin/core/KoinApplication;Landroidx/compose/runtime/Composer;I)Lorg/koin/core/Koin; | ||
} | ||
|
||
public final class org/koin/compose/error/UnknownKoinContext : java/lang/Exception { | ||
public static final field $stable I | ||
public fun <init> ()V | ||
} | ||
|
||
public final class org/koin/compose/module/CompositionKoinModuleLoader : androidx/compose/runtime/RememberObserver { | ||
public static final field $stable I | ||
public fun <init> (Ljava/util/List;Lorg/koin/core/Koin;ZZ)V | ||
public final fun getKoin ()Lorg/koin/core/Koin; | ||
public final fun getModules ()Ljava/util/List; | ||
public final fun getUnloadOnAbandoned ()Z | ||
public final fun getUnloadOnForgotten ()Z | ||
public fun onAbandoned ()V | ||
public fun onForgotten ()V | ||
public fun onRemembered ()V | ||
} | ||
|
||
public final class org/koin/compose/module/RememberModulesKt { | ||
public static final fun rememberKoinModules (Ljava/lang/Boolean;Ljava/lang/Boolean;ZLkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;II)V | ||
} | ||
|
||
public final class org/koin/compose/scope/CompositionKoinScopeLoader : androidx/compose/runtime/RememberObserver { | ||
public static final field $stable I | ||
public fun <init> (Lorg/koin/core/scope/Scope;)V | ||
public final fun getScope ()Lorg/koin/core/scope/Scope; | ||
public fun onAbandoned ()V | ||
public fun onForgotten ()V | ||
public fun onRemembered ()V | ||
} | ||
|
||
public final class org/koin/compose/scope/KoinScopeKt { | ||
public static final fun KoinScope (Ljava/lang/String;Lorg/koin/core/qualifier/Qualifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V | ||
public static final fun KoinScope (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V | ||
public static final fun OnKoinScope (Lorg/koin/core/scope/Scope;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V | ||
} | ||
|
||
public final class org/koin/compose/scope/RememberScopesKt { | ||
public static final fun rememberKoinScope (Lorg/koin/core/scope/Scope;Landroidx/compose/runtime/Composer;I)Lorg/koin/core/scope/Scope; | ||
} | ||
|
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,65 @@ | ||
public final class org/koin/compose/KoinApplicationKt { | ||
public static final fun KoinApplication (Lkotlin/jvm/functions/Function1;Lorg/koin/core/logger/Level;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V | ||
public static final fun KoinContext (Lorg/koin/core/Koin;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V | ||
public static final fun KoinIsolatedContext (Lorg/koin/core/KoinApplication;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V | ||
public static final fun currentKoinScope (Landroidx/compose/runtime/Composer;I)Lorg/koin/core/scope/Scope; | ||
public static final fun getKoin (Landroidx/compose/runtime/Composer;I)Lorg/koin/core/Koin; | ||
public static final fun getLocalKoinApplication ()Landroidx/compose/runtime/ProvidableCompositionLocal; | ||
public static final fun getLocalKoinScope ()Landroidx/compose/runtime/ProvidableCompositionLocal; | ||
} | ||
|
||
public final class org/koin/compose/application/CompositionKoinApplicationLoader : androidx/compose/runtime/RememberObserver { | ||
public static final field $stable I | ||
public fun <init> (Lorg/koin/core/KoinApplication;)V | ||
public final fun getKoin ()Lorg/koin/core/Koin; | ||
public final fun getKoinApplication ()Lorg/koin/core/KoinApplication; | ||
public fun onAbandoned ()V | ||
public fun onForgotten ()V | ||
public fun onRemembered ()V | ||
public final fun setKoin (Lorg/koin/core/Koin;)V | ||
} | ||
|
||
public final class org/koin/compose/application/RememberKoinApplicationKt { | ||
public static final fun rememberKoinApplication (Lorg/koin/core/KoinApplication;Landroidx/compose/runtime/Composer;I)Lorg/koin/core/Koin; | ||
} | ||
|
||
public final class org/koin/compose/error/UnknownKoinContext : java/lang/Exception { | ||
public static final field $stable I | ||
public fun <init> ()V | ||
} | ||
|
||
public final class org/koin/compose/module/CompositionKoinModuleLoader : androidx/compose/runtime/RememberObserver { | ||
public static final field $stable I | ||
public fun <init> (Ljava/util/List;Lorg/koin/core/Koin;ZZ)V | ||
public final fun getKoin ()Lorg/koin/core/Koin; | ||
public final fun getModules ()Ljava/util/List; | ||
public final fun getUnloadOnAbandoned ()Z | ||
public final fun getUnloadOnForgotten ()Z | ||
public fun onAbandoned ()V | ||
public fun onForgotten ()V | ||
public fun onRemembered ()V | ||
} | ||
|
||
public final class org/koin/compose/module/RememberModulesKt { | ||
public static final fun rememberKoinModules (Ljava/lang/Boolean;Ljava/lang/Boolean;ZLkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;II)V | ||
} | ||
|
||
public final class org/koin/compose/scope/CompositionKoinScopeLoader : androidx/compose/runtime/RememberObserver { | ||
public static final field $stable I | ||
public fun <init> (Lorg/koin/core/scope/Scope;)V | ||
public final fun getScope ()Lorg/koin/core/scope/Scope; | ||
public fun onAbandoned ()V | ||
public fun onForgotten ()V | ||
public fun onRemembered ()V | ||
} | ||
|
||
public final class org/koin/compose/scope/KoinScopeKt { | ||
public static final fun KoinScope (Ljava/lang/String;Lorg/koin/core/qualifier/Qualifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V | ||
public static final fun KoinScope (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V | ||
public static final fun OnKoinScope (Lorg/koin/core/scope/Scope;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V | ||
} | ||
|
||
public final class org/koin/compose/scope/RememberScopesKt { | ||
public static final fun rememberKoinScope (Lorg/koin/core/scope/Scope;Landroidx/compose/runtime/Composer;I)Lorg/koin/core/scope/Scope; | ||
} | ||
|
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
21 changes: 21 additions & 0 deletions
21
...s/compose/koin-compose/src/androidMain/kotlin/org/koin/compose/KoinApplication.android.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,21 @@ | ||
package org.koin.compose | ||
|
||
import androidx.compose.runtime.Composable | ||
import org.koin.core.KoinApplication | ||
import org.koin.dsl.KoinConfiguration | ||
import androidx.compose.ui.platform.LocalContext | ||
import org.koin.android.ext.koin.androidContext | ||
import org.koin.android.ext.koin.androidLogger | ||
import org.koin.core.logger.Level | ||
import org.koin.dsl.koinConfiguration | ||
import org.koin.dsl.includes | ||
|
||
@Composable | ||
internal actual fun composeConfiguration(loggerLevel : Level,config : KoinApplication.() -> Unit) : KoinConfiguration { | ||
val current = LocalContext.current | ||
return koinConfiguration { | ||
androidContext(current) | ||
androidLogger(loggerLevel) | ||
includes(config) | ||
} | ||
} |
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
16 changes: 16 additions & 0 deletions
16
projects/compose/koin-compose/src/jsMain/kotlin/org/koin/compose/KoinApplication.js.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,16 @@ | ||
package org.koin.compose | ||
|
||
import androidx.compose.runtime.Composable | ||
import org.koin.core.KoinApplication | ||
import org.koin.dsl.KoinConfiguration | ||
import org.koin.core.logger.Level | ||
import org.koin.dsl.koinConfiguration | ||
import org.koin.dsl.includes | ||
|
||
@Composable | ||
internal actual fun composeConfiguration(loggerLevel : Level,config : KoinApplication.() -> Unit) : KoinConfiguration { | ||
return koinConfiguration { | ||
printLogger(loggerLevel) | ||
includes(config) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
projects/compose/koin-compose/src/jvmMain/kotlin/org/koin/compose/KoinApplication.jvm.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,16 @@ | ||
package org.koin.compose | ||
|
||
import androidx.compose.runtime.Composable | ||
import org.koin.core.KoinApplication | ||
import org.koin.dsl.KoinConfiguration | ||
import org.koin.core.logger.Level | ||
import org.koin.dsl.koinConfiguration | ||
import org.koin.dsl.includes | ||
|
||
@Composable | ||
internal actual fun composeConfiguration(loggerLevel : Level,config : KoinApplication.() -> Unit) : KoinConfiguration { | ||
return koinConfiguration { | ||
printLogger(loggerLevel) | ||
includes(config) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...cts/compose/koin-compose/src/nativeMain/kotlin/org/koin/compose/KoinApplication.native.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,16 @@ | ||
package org.koin.compose | ||
|
||
import androidx.compose.runtime.Composable | ||
import org.koin.core.KoinApplication | ||
import org.koin.dsl.KoinConfiguration | ||
import org.koin.core.logger.Level | ||
import org.koin.dsl.koinConfiguration | ||
import org.koin.dsl.includes | ||
|
||
@Composable | ||
internal actual fun composeConfiguration(loggerLevel : Level,config : KoinApplication.() -> Unit) : KoinConfiguration { | ||
return koinConfiguration { | ||
printLogger(loggerLevel) | ||
includes(config) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...cts/compose/koin-compose/src/wasmJsMain/kotlin/org/koin/compose/KoinApplication.wasmJS.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,16 @@ | ||
package org.koin.compose | ||
|
||
import androidx.compose.runtime.Composable | ||
import org.koin.core.KoinApplication | ||
import org.koin.dsl.KoinConfiguration | ||
import org.koin.core.logger.Level | ||
import org.koin.dsl.koinConfiguration | ||
import org.koin.dsl.includes | ||
|
||
@Composable | ||
internal actual fun composeConfiguration(loggerLevel : Level,config : KoinApplication.() -> Unit) : KoinConfiguration { | ||
return koinConfiguration { | ||
printLogger(loggerLevel) | ||
includes(config) | ||
} | ||
} |
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