Slackbot
02/09/2022, 4:08 PMVivek Modi
02/09/2022, 6:55 PMLandry Norris
02/09/2022, 7:06 PMelectrolobzik
02/09/2022, 7:23 PMSooYoung
02/09/2022, 10:11 PMluciano_fabris
02/09/2022, 11:35 PMTristan
02/10/2022, 12:26 AMmy-project/
├─ shared/
│ ├─ feature.domain.usecase/
│ │ ├─ GetSomethingUseCase
├─ android/
│ ├─ feature.domain.usecase/
│ │ ├─ GetSomethingUseCaseImpl
├─ iOS/
│ ├─ feature.domain.usecase/
│ │ ├─ GetSomethingUseCaseImpl
Where GetSomethingUseCase
interface GetSomethingUseCase {
operator fun invoke(): String
}
And Android GetSomethingUseCaseImpl
class GetSomethingUseCaseImpl(private val context: Context) : GetSomethingUseCase {
override operator fun invoke() = TODO("It uses the context.")
}
And iOS GetSomethingUseCaseImpl
class GetSomethingUseCaseImpl(private val context: NSBundle) : GetSomethingUseCase {
override operator fun invoke() = TODO("It does use something else.")
}
I am not sure I am doing it the correct way. Without expect/actual, I am loosing some tips, like “missing implementation” errors at compile time 😞Charles Prado
02/10/2022, 10:28 AMno such module 'shared'
). Can it be something related to the env config?Gellért Biró
02/10/2022, 10:33 AMKtor
? Does it work on iOS as well?Matt Nelson
02/10/2022, 1:45 PM-jvm
variant of a kmp project module?
// javafx sample module build.gradle.kts
plugins {
kotlin("jvm")
application
id("org.openjfx.javafxplugin") version("0.0.11")
}
// java/javafx/application configuration...
dependencies {
implementation(project(":multiplatform-module"))
}
The above keeps importing the -android
variant of my :multiplatform-module
😢CLOVIS
02/10/2022, 5:27 PMexpect/actual
into checking at compile-time if all endpoints are implemented. Eg, having a common module in which you declare the different endpoints, having a client-side module that depends on it and must implement all the endpoints, and the same server-side.
The difficulty is that the implementation on the client-side and the server-side will not look the same at all, and the server-side needs to know the list of endpoints so they can be registered in KtorJim
02/10/2022, 7:32 PM./gradlew detekt
the konan compiler is downloaded. Is there a way I can make native compiler downloads lazy? Furthermore I only have mingwX64 and macosX64, why is my jvm build runner that happens to be linux downloading linux platform compiler stuff?adjpd
02/10/2022, 9:23 PMjava.util.Date
in the shared
module under commonMain
? (I'm guessing this because the import fails, although I have other strange import failures)adjpd
02/10/2022, 11:24 PMimplementation("org.jetbrains.kotlinx:kotlinx-datetime:0.3.2")
to commonMain
in my shared
module, add Clock.System.now().epochSeconds
in my Greeting
file, then run the application in Android, it crashes with an error about not finding java.time.Instance
.xxfast
02/11/2022, 2:19 AMcommonDebug
by default? whats the best way to create a dubug source set that links up correctly to android debug variant and ios debug configuration?clark
02/11/2022, 3:58 AMsqldelight
DatabaseDriver
for Android without requiring a context? I want all of my database work to be handled by shared code and I don't love having to instantiate it all by passing in an Android contextStefan Oltmann
02/11/2022, 8:18 AMequals()
of my data class actually looks like?
I needed to change it to a normal class and now in Swift it does not work anymore.
So I try to find out what the original generated method does different.Jakub Sieprawski
02/11/2022, 3:30 PMKathrin Petrova
02/11/2022, 4:44 PMLandry Norris
02/11/2022, 6:00 PMjean
02/11/2022, 10:18 PMPlugin [id: 'com.android.application'] was not found in any of the following sources:
and nothing after. So gradle doesn’t understand that the buildscript
block is now define in a different gradle file. I did include implementation(project(":shared"))
in the gradle file at the android app level but still the same issue. Are there any non-gradle configuration changes to do I am not aware of?adjpd
02/11/2022, 11:04 PMsuspend
function as a constructor parameter. How can I call this in swift? I've attempted to pass a simple closure but it complains it doesn't conform to KotlinSuspendFunction0
. Any idea on the correct swift syntax? My attempt in 🧵.adjpd
02/12/2022, 1:57 PMtheapache64
02/13/2022, 1:26 AMadjpd
02/13/2022, 3:45 AMclass
that takes a suspend
function, passedFn
, as a parameter. And the class has a suspend
method, fn()
. When fn()
calls passedFn()
I receive this error on iOS illegal attempt to access non-shared Something.$fnCOROUTINE$0@2d9f788 from other thread.
I'm vaguely aware it has something to do with freezing objects across threads. Could anyone enlighten me further? What would I need to do in order to get this to work?adjpd
02/13/2022, 9:03 PMStateFlow
that I'm collecting from swift. It works with a class that inherits from Kotlinx_coroutines_coreFlowCollector
. But it's rather ugly. Is there are more concise way? Code in 🧵kierans777
02/14/2022, 12:23 AMcommonTest
on iOS, however it doesn't look like any tests are run from the binary (text.kexe
).
Looking at the output from $ ./gradlew iosX64Test --info
and running xcrun
myself I get
$ /usr/bin/xcrun simctl spawn --standalone A92077C5-F953-4646-8FEE-C0F0A0C84C8F /Users/kieran/my-library/build/bin/iosX64/debugTest/test.kexe
[==========] Running 0 tests from 0 test cases.
[----------] Global test environment set-up.
[----------] Global test environment tear-down
[==========] 0 tests from 0 test cases ran. (0 ms total)
[ PASSED ] 0 tests.
It works find for the JVM.
My Gradle looks like:
kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
withJava()
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
ios {
binaries {
framework {
baseName = "MyLibrary"
}
}
}
sourceSets {
commonMain {
dependencies {
api "io.arrow-kt:arrow-core:${rootProject.ext.arrowVersion}"
api "io.arrow-kt:arrow-fx-coroutines:${rootProject.ext.arrowVersion}"
}
}
commonTest {
dependencies {
implementation "io.kotest:kotest-framework-engine:${rootProject.ext.kotestVersion}"
implementation "io.kotest:kotest-assertions-core:${rootProject.ext.kotestVersion}"
implementation "io.kotest:kotest-property:${rootProject.ext.kotestVersion}"
implementation "io.kotest.extensions:kotest-assertions-arrow:1.1.0.98-SNAPSHOT"
}
}
iosMain {
dependsOn(commonMain)
iosX64Main.dependsOn(it)
iosArm64Main.dependsOn(it)
}
iosTest {
dependsOn(commonTest)
iosX64Test.dependsOn(it)
iosArm64Test.dependsOn(it)
}
jvmTest {
dependencies {
implementation "io.kotest:kotest-runner-junit5:${rootProject.ext.kotestVersion}"
}
}
}
}
Am I missing something?Sterling Albury
02/14/2022, 7:13 AMSet<Foo>
, where Foo
is just a simple interface with a couple of functions defined in commonMain
, and if I try to declare or instantiate this set in swift, I get the error "Type 'Foo' does not conform to protocol 'Hashable'". Is there a way to make my interface Hashable or is there another good way to have sets of my interface?jean
02/14/2022, 8:15 AMbuild.gradle -> buildscript -> repositories
, build.gradle -> allprojects -> repositories
, settings.gradle -> pluginManagement -> repositories
and shared -> build.gradle -> repositories
but I always get the same error :
Could not find com.jeantuffierstatemachine1.5.0.
Required by:
project :shared
Alen Kirm
02/14/2022, 3:42 PMsuspend
functions? I’ve noticed you can call suspend/async
Kotlin function inside Swift, and it is compiled into a completion closure. One downside I see there, is nullability
and would be nice to have Swift's Result
type in it for example.
Any best practices regarding data flow in KMM project? 🙏