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

Compatibility with Kotlin/Native compiler plugins #897

Closed
rickclephas opened this issue Mar 14, 2022 · 2 comments · Fixed by #1126
Closed

Compatibility with Kotlin/Native compiler plugins #897

rickclephas opened this issue Mar 14, 2022 · 2 comments · Fixed by #1126
Assignees
Labels
bug Something isn't working P2 affects usability but not blocks users
Milestone

Comments

@rickclephas
Copy link

We are seeing a similar error as in #207 where required plugin options aren't provided to the compiler plugin by KSP.
Looking at that issue this should be fixed by #270, though it looks like that fix isn't applied to the KspTaskNative task.

@ting-yuan ting-yuan added the bug Something isn't working label Mar 28, 2022
@ting-yuan ting-yuan added this to the 1.0.5 milestone Mar 28, 2022
@ting-yuan
Copy link
Collaborator

Before this is fixed, it can be worked around by blocking other compiler plugins in KSP's task. I.e., settings this in build.gradle[.kts]

ksp {
    blockOtherCompilerPlugins = true
}

This only affects tasks where processors run, and don't apply to compilation tasks.

@ting-yuan ting-yuan added the P2 affects usability but not blocks users label Mar 28, 2022
@ting-yuan ting-yuan modified the milestones: 1.0.5, 1.0.6 Apr 5, 2022
@neetopia neetopia modified the milestones: 1.0.6, 1.0.5, 1.0.7 Jun 8, 2022
@TadeasKriz
Copy link

TadeasKriz commented Jul 2, 2022

Setting the blockOtherCompilerPlugins = true results in Caused by: java.lang.ClassNotFoundException: com.google.devtools.ksp.processing.KSPLogger exception being thrown. My understanding is, that it removes the symbol-processing-api jar from the compiler's classpath as well.

I'm using the following as a workaround so that compiler options from the native compile task are added to the ksp native task:

tasks.withType<KspTask>().configureEach {
    when (this) {
        is KspTaskNative -> {
            this.compilerPluginOptions.addPluginArgument(
                tasks.named<KotlinNativeCompile>(compilation.compileKotlinTaskName).get().compilerPluginOptions
            )
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 affects usability but not blocks users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants