-
Notifications
You must be signed in to change notification settings - Fork 64
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
KSP errors are not included in the message output #69
Comments
It's because the stderror stream isn't captured. Was able to work around this by capturing the stderr stream myself. https://github.com/evant/kotlin-inject/blob/main/compiler-tests/src/main/kotlin/me/tatarka/inject/ProjectCompiler.kt#L31 |
I've got a slightly different hack via just copying the sources (leftover from when I needed a newer version compatible with the new package names): https://github.com/ZacSweers/MoshiX/blob/main/ksp-test-util/src/main/kotlin/com/tschuchort/compiletesting/symbolProcessors.kt#L94-L98 @tschuchortdev do you have an implementation in mind for this TODO item in Ksp.kt? If so I'd be happy to take a look at a PR! |
@ZacSweers I don't have a specific implementation in mind. The whole KSP implementation is kind of hacky, because kotlin-compile-testing is not very composable right now, so you might not find a "clean" way to access the You can try one of the following approaches:
|
Btw, this might be just related to google/ksp#122. |
@yigit Originally it was simply the case that the KSP-related code had no access to the Outputstream where all the compiler messages are saved. Now that the KSP implementation has changed, deeper changes in KCT will be required to adapt and this issue should get fixed as well. |
Resolves #69. This is based on an implementation I've been using in my projects, and also works around internal access across modules via lesser-known suppression mechanism until kotlin finally finishes implementing friend-paths support in their gradle/IDE tooling.
Resolves #69. This is based on an implementation I've been using in my projects, and also works around internal access across modules via lesser-known suppression mechanism until kotlin finally finishes implementing friend-paths support in their gradle/IDE tooling.
* Report KSP logs in compilations Resolves #69. This is based on an implementation I've been using in my projects, and also works around internal access across modules via lesser-known suppression mechanism until kotlin finally finishes implementing friend-paths support in their gradle/IDE tooling. * Add tests * Remove unnecessary copy of MessageCollectorBasedKSPLogger Co-authored-by: Thilo Schuchort <[email protected]>
I'm trying to use errors printed by KSP in my test but it seems that any KSP logs are not included. I see them in the test logs but not in
KotlinCompilation.Result.messages
.The text was updated successfully, but these errors were encountered: