From e2850fa7214cc7c55722a67aa9769198d19a7757 Mon Sep 17 00:00:00 2001 From: Prashan Dharmasena Date: Thu, 23 May 2024 15:47:13 -0400 Subject: [PATCH] Fix publishToMavenLocal - need to create expect/actual for kotlin-inject component creation methods for every final platform. (See kotlin-inject KMP examples.) --- .../di/AbacusComponent.kt | 13 ++++++++- .../kotlin/di/AbacusComponent.ios.kt | 28 +++++++++++++++++++ .../kotlin/di/AbacusComponent.ios.kt | 28 +++++++++++++++++++ .../di/AbacusComponent.js.kt | 28 +++++++++++++++++++ src/jvmMain/kotlin/di/AbacusComponent.jvm.kt | 28 +++++++++++++++++++ 5 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 src/iosArm64Main/kotlin/di/AbacusComponent.ios.kt create mode 100644 src/iosSimulatorArm64Main/kotlin/di/AbacusComponent.ios.kt create mode 100644 src/jsMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.js.kt create mode 100644 src/jvmMain/kotlin/di/AbacusComponent.jvm.kt diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.kt b/src/commonMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.kt index a6fe3de2e..685636d02 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.kt @@ -34,7 +34,7 @@ object AbacusFactory { stateNotification: StateNotificationProtocol? = null, dataNotification: DataNotificationProtocol? = null, presentationProtocol: PresentationProtocol? = null, - ): AbacusComponent = AbacusComponent::class.create( + ): AbacusComponent = createAbacusComponent( deploymentUri, deployment, appConfigs, @@ -61,3 +61,14 @@ abstract class AbacusComponent( ) { abstract val stateManager: AsyncAbacusStateManagerV2 } + +internal expect fun createAbacusComponent( + deploymentUri: DeploymentUri, + deployment: Deployment, + appConfigs: AppConfigsV2, + ioImplementations: IOImplementations, + uiImplementations: UIImplementations, + stateNotification: StateNotificationProtocol?, + dataNotification: DataNotificationProtocol?, + presentationProtocol: PresentationProtocol?, +): AbacusComponent diff --git a/src/iosArm64Main/kotlin/di/AbacusComponent.ios.kt b/src/iosArm64Main/kotlin/di/AbacusComponent.ios.kt new file mode 100644 index 000000000..7b03d7e4a --- /dev/null +++ b/src/iosArm64Main/kotlin/di/AbacusComponent.ios.kt @@ -0,0 +1,28 @@ +package exchange.dydx.abacus.di + +import exchange.dydx.abacus.protocols.DataNotificationProtocol +import exchange.dydx.abacus.protocols.PresentationProtocol +import exchange.dydx.abacus.protocols.StateNotificationProtocol +import exchange.dydx.abacus.state.v2.supervisor.AppConfigsV2 +import exchange.dydx.abacus.utils.IOImplementations +import exchange.dydx.abacus.utils.UIImplementations + +internal actual fun createAbacusComponent( + deploymentUri: DeploymentUri, + deployment: Deployment, + appConfigs: AppConfigsV2, + ioImplementations: IOImplementations, + uiImplementations: UIImplementations, + stateNotification: StateNotificationProtocol?, + dataNotification: DataNotificationProtocol?, + presentationProtocol: PresentationProtocol?, +): AbacusComponent = AbacusComponent::class.create( + deploymentUri, + deployment, + appConfigs, + ioImplementations, + uiImplementations, + stateNotification, + dataNotification, + presentationProtocol, +) diff --git a/src/iosSimulatorArm64Main/kotlin/di/AbacusComponent.ios.kt b/src/iosSimulatorArm64Main/kotlin/di/AbacusComponent.ios.kt new file mode 100644 index 000000000..7b03d7e4a --- /dev/null +++ b/src/iosSimulatorArm64Main/kotlin/di/AbacusComponent.ios.kt @@ -0,0 +1,28 @@ +package exchange.dydx.abacus.di + +import exchange.dydx.abacus.protocols.DataNotificationProtocol +import exchange.dydx.abacus.protocols.PresentationProtocol +import exchange.dydx.abacus.protocols.StateNotificationProtocol +import exchange.dydx.abacus.state.v2.supervisor.AppConfigsV2 +import exchange.dydx.abacus.utils.IOImplementations +import exchange.dydx.abacus.utils.UIImplementations + +internal actual fun createAbacusComponent( + deploymentUri: DeploymentUri, + deployment: Deployment, + appConfigs: AppConfigsV2, + ioImplementations: IOImplementations, + uiImplementations: UIImplementations, + stateNotification: StateNotificationProtocol?, + dataNotification: DataNotificationProtocol?, + presentationProtocol: PresentationProtocol?, +): AbacusComponent = AbacusComponent::class.create( + deploymentUri, + deployment, + appConfigs, + ioImplementations, + uiImplementations, + stateNotification, + dataNotification, + presentationProtocol, +) diff --git a/src/jsMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.js.kt b/src/jsMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.js.kt new file mode 100644 index 000000000..7b03d7e4a --- /dev/null +++ b/src/jsMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.js.kt @@ -0,0 +1,28 @@ +package exchange.dydx.abacus.di + +import exchange.dydx.abacus.protocols.DataNotificationProtocol +import exchange.dydx.abacus.protocols.PresentationProtocol +import exchange.dydx.abacus.protocols.StateNotificationProtocol +import exchange.dydx.abacus.state.v2.supervisor.AppConfigsV2 +import exchange.dydx.abacus.utils.IOImplementations +import exchange.dydx.abacus.utils.UIImplementations + +internal actual fun createAbacusComponent( + deploymentUri: DeploymentUri, + deployment: Deployment, + appConfigs: AppConfigsV2, + ioImplementations: IOImplementations, + uiImplementations: UIImplementations, + stateNotification: StateNotificationProtocol?, + dataNotification: DataNotificationProtocol?, + presentationProtocol: PresentationProtocol?, +): AbacusComponent = AbacusComponent::class.create( + deploymentUri, + deployment, + appConfigs, + ioImplementations, + uiImplementations, + stateNotification, + dataNotification, + presentationProtocol, +) diff --git a/src/jvmMain/kotlin/di/AbacusComponent.jvm.kt b/src/jvmMain/kotlin/di/AbacusComponent.jvm.kt new file mode 100644 index 000000000..7b03d7e4a --- /dev/null +++ b/src/jvmMain/kotlin/di/AbacusComponent.jvm.kt @@ -0,0 +1,28 @@ +package exchange.dydx.abacus.di + +import exchange.dydx.abacus.protocols.DataNotificationProtocol +import exchange.dydx.abacus.protocols.PresentationProtocol +import exchange.dydx.abacus.protocols.StateNotificationProtocol +import exchange.dydx.abacus.state.v2.supervisor.AppConfigsV2 +import exchange.dydx.abacus.utils.IOImplementations +import exchange.dydx.abacus.utils.UIImplementations + +internal actual fun createAbacusComponent( + deploymentUri: DeploymentUri, + deployment: Deployment, + appConfigs: AppConfigsV2, + ioImplementations: IOImplementations, + uiImplementations: UIImplementations, + stateNotification: StateNotificationProtocol?, + dataNotification: DataNotificationProtocol?, + presentationProtocol: PresentationProtocol?, +): AbacusComponent = AbacusComponent::class.create( + deploymentUri, + deployment, + appConfigs, + ioImplementations, + uiImplementations, + stateNotification, + dataNotification, + presentationProtocol, +)