-
Notifications
You must be signed in to change notification settings - Fork 217
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
Add support for KSP annotation processing via KspCompile #955
Add support for KSP annotation processing via KspCompile #955
Conversation
Waiting for this to land so that we can properly find runfiles #956 |
b1c4ecb
to
6749c40
Compare
6749c40
to
3a552f0
Compare
d073c82
to
311e727
Compare
transitive_runtime_jars = transitive_runtime_jars, | ||
plugins = plugins, | ||
outputs = { | ||
"ksp_generated_java_srcjar": ksp_generated_java_srcjar, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This action currently only supports collecting generated Kotlin source files and resources. If a KSP plugin outputs Java or compiled outputs, this action will not collect them up to be used in the downstream actions.
"incremental" to listOf("false"), | ||
// Directory where class files are written to. Files written to this directory are class | ||
// files being written directly from the annotation processor, not Kotlinc | ||
"classOutputDir" to listOf(directories.generatedClasses), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
classOutputDir
, javaOutputDir
, and javaOutputDir
are currently being ignored when written to. We'll need to look into adding support for this incrementally.
@@ -19,12 +19,23 @@ java_plugin( | |||
deps = ["@maven//:com_google_auto_value_auto_value"], | |||
) | |||
|
|||
kt_ksp_plugin_info( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not kt_ksp_plugin
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good catch. Renamed this to just kt_ksp_plugin
Adding proper support for KSP annotation processors.
KSP plugins can be defined and given to targets using the
kt_ksp_plugin
rule and can be passed to Kotlin targets in theplugins
attribute.With this approach KSP and Kapt can be used in the same module.
Example: