Skip to content

Instantly share code, notes, and snippets.

View romainbsl's full-sized avatar

Romain Boisselle romainbsl

View GitHub Profile
@romainbsl
romainbsl / Podfile
Created August 29, 2020 12:03
di-on-mpp-part3-podfile
target 'iosApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
platform :ios, '13.5'
# Pods for iosApp
pod 'NBVCommon', :path => '../nbv-kmp'
end
./gradlew publish // or publishToMavenLocal for dev purpose
plugins {
// ...
`maven-publish`
}
kotlin {
// ...
cocoapods {
// Configure fields required by CocoaPods.
summary = "This is my personal KMP module"
homepage = "Do not have one yet."
// The name of the produced framework can be changed.
// The name of the Gradle project is used here by default.
frameworkName = "NBVCommon"
plugins {
// ...
kotlin("native.cocoapods") version "1.3.72"
}
val packForXcode by tasks.creating(Sync::class) {
val mode = System.getenv("CONFIGURATION") ?: "DEBUG"
val framework = kotlin.targets
.getByName<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget>("ios")
.binaries.getFramework(mode)
inputs.property("mode", mode)
dependsOn(framework.linkTask)
val targetDir = File(buildDir, "xcode-frameworks")
val notLoggedInContainer = DI {
import(loginModule, allowOverride = true)
bind<AuthApi>(overrides = true) with singleton { AuthApiError() }
bind<TokenRepository>(overrides = true) with singleton { TokenRepositoryNotLoggedIn() }
bind() from provider { TestLoginView() }
}
class LoginPresenterTest : DIAware {
override val di = DI {
import(loginModule, allowOverride = true)
bind<AuthApi>(overrides = true) with singleton { AuthApiSuccess() }
bind<TokenRepository>(overrides = true) with singleton { TokenRepositoryLoggedIn() }
bind() from provider { TestLoginView() }
}
@Test
fun test01_attachView() {