-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to generate code for common Ios target instead of individual (X64, Arm64) source sets #929
Comments
Tried |
With |
It works in Kotlin 1.8.20. |
This still only generates code for code for individual targets and commonMain but not iosMain. |
Found workaround, but it works only for extensions. Koin example: You can add following code to your package org.koin.ksp.generated // package should be same as your generated code
import org.koin.core.module.Module
@Suppress("UnusedReceiverParameter")
val Any.module: Module
get() = throw RuntimeException("Koin module was not generated. Add ksp for all your targets") On |
Is there a formal solution now? |
+1 |
This seemingly unrelated comment is another (imho, less hacky) workaround for the |
We use the shorthand
ios()
function to configure common ios source sets and we only have code in theiosMain
source set. However ksp generates code into the IosX64 and IosArm64 source sets. For both source sets, identical code is generated, but we cannot access the definitions from theiosMain
source set.If we try to configure
add("kspIos", project(":processor"))
we get the following error:Configuration with name 'kspIos' not found.
Either the commonization task should run on the generated sources and generate the common definitions or ksp should generate code for the
iosMain
source set.The text was updated successfully, but these errors were encountered: