Paulo Cereda
09/18/2025, 5:37 PMcommonTest. Recently, I noticed that I inadvertedly used JVM-specific code in one of those tests (namely, File and readText() . Although the tests run without any issues, I think I should move them to jvmTest instead because it uses non-common code. Is this the correct way to go, or should I keep this scenario as-is? Thanks!jw
09/18/2025, 5:41 PMFile is common to them. However, if you have any native, js, and/or wasm targets then that will fail compilation when you try to compile tests for those targets.Paulo Cereda
09/18/2025, 5:43 PMdarkmoon_uk
09/19/2025, 1:03 AMcommonMain was able only to access a fixed API that was the intersection of all supported targets.
In recent Kotlin versions though, commonMain now sees a dynamically computed API - the intersection of all enabled targets.
This makes commonMain more intelligent and flexible - allowing you to use File being a nice example.jw
09/19/2025, 1:05 AMjw
09/19/2025, 1:06 AMdarkmoon_uk
09/19/2025, 1:17 AMMichael Paus
09/19/2025, 6:38 AMFile and readText() by their corresponding counterparts from a multi-platform IO library like Okio or kotlinx-io. Then you’d be ready for the future. There’s no point in using Java dependencies if they can be easily avoided. Of course that’s not always the case.Paulo Cereda
09/19/2025, 8:58 AM