https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
j

Jeff Lockhart

01/27/2023, 11:35 PM
I'm using a custom entry point for my iOS and macOS native tests that runs the tests on a background thread and starts the main run loop, to allow testing callbacks that dispatch on the main thread (see YouTrack). This has worked great until updating to Kotlin 1.8.0. It's no longer calling the custom entry point function. Any idea why this code would no longer work for this in 1.8?
Copy code
kotlin {
    ...
    targets.withType<KotlinNativeTarget> {
        if (konanTarget.family.isAppleFamily) {
            compilations["test"].kotlinOptions {
                freeCompilerArgs += listOf("-e", "testlauncher.mainBackground")
            }
        }
    }
}
r

russhwolf

01/28/2023, 4:02 AM
j

Jeff Lockhart

01/30/2023, 3:47 PM
Thanks. It looks like this is in fact a bug introduced by these changes. https://youtrack.jetbrains.com/issue/KT-56280
I guess the intention was for
kotlinOptions
to be deprecated, but it just hasn't been properly marked so until the plugin has a migration quickfix.
11 Views