-
Notifications
You must be signed in to change notification settings - Fork 213
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
Annotation Processing #6
Comments
kapt3 doesn't respect the processors attribute (likely I am encoding it incorrectly), it will happily discover processors from the classpath though. |
implemented in #16 intellij support works well enough with dagger. The references are resolved against the compiled classes, an improvement would be to generate an annotations processing src jar and pass that through, happy for a PR on this. |
Note, we really don't want to rely on classpath discovery. That's not a required feature of javax.annotation.processing implementations, though it happens to work in javac and kapt3 for now. But we shouldn't rely on non-spec behavior. It's fine for now, but once jetbrains attends to your issue with kapt3 configuration, we should revert to explicitly passing the processors via java_plugin targets. As to "compilers being invoked twice" - is that necessary? I know javac does multiple "rounds" - I assume kapt3 does this also, with kotlinc, but I don't know that for sure. |
On classpath discovery: Kapt does not respect the processor list so what I have done for the time being is exclude the plugin entry entirely if it has a null or empty Kotlinc does need to be invoked twice once with the kapt plugin config and once without, but this is done within the kotlin builder within the same function so the overhead I suspect is very low. |
Kotlin Youtrack issue for annotation processor classes configuration. |
Fixed since 1.2.40 |
Ensure that the runtime deps pass along their javainfo if present
Ensure that the runtime deps pass along their javainfo if present
This needs some experimentation, notes:
java_plugin
label into an abstract set of switches or preferably an encoded payload for the worker (bazel proto format ?).* Unless we can cache any of the results create a single set of temp directories for all annotation processors (src, classes and stubs). (RFC: Are temp directories OK ? also used in Mixed-Mode compilation - Compile Java and Kotlin in one pass in the worker. #3).(see #3 broad rework of mix-mode compilation and fixes. #10).The text was updated successfully, but these errors were encountered: