Skip to content
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

is there any way to know which native target is process in ksp on multiplatform? #1028

Open
cristianoro7 opened this issue Jun 24, 2022 · 2 comments

Comments

@cristianoro7
Copy link

cristianoro7 commented Jun 24, 2022

Hey!
I use ksp in my kmp project to generate code for iosArm64 and androidNativeArm64 target.

dependencies {
    add("kspAndroidNativeArm64", project(":core-ksp"))
    add("kspIosArm64", project(":core-ksp"))
}

but when I run kspAndroidNativeArm64 and kspIosArm64 task, both of their platformName value is "Native", like this
企业微信截图_0e1996f9-854c-468b-9f80-e89ab78ca842

so is there any way to know which native target is running in SymbolProcessorProvider or SymbolProcessor, I want to know which native target that ksp is running(iosArm64 or androidNativeArm64) so that I can generate different code for different native target.

@OliverO2
Copy link

Not currently, as far as I am aware. As the native target is also an (output) source set, this issue is a variant of source set-specific code generation. See #965 for details and a possible workaround via output source set detection.

@cristianoro7
Copy link
Author

Not currently, as far as I am aware. As the native target is also an (output) source set, this issue is a variant of source set-specific code generation. See #965 for details and a possible workaround via output source set detection.

thanks bro, the example you provide work fine for me. it had fix my problem!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants