https://kotlinlang.org logo
#ios
Title
# ios
j

Jacob Rhoda

11/15/2023, 6:49 PM
I’m trying to mock some expect/`actual` types with a KSP plugin, but the
actual
type on iOS requires an
@OptIn(ExperimentalForeignApi::class)
annotation on one method. I can do this with
Copy code
sourceSets {
  all {
    languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi")
  }
}
However, this seems wrong. I really only need to do this for the test sources, which are generated by KSP. How do I add this compiler flag just for compiling the test source set on iOS?
2 Views