-
Notifications
You must be signed in to change notification settings - Fork 441
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 Annotation Processing Supported for Gradle project? #1039
Comments
There's no native annotation processor support in Buildship (the Gradle integration for Eclipse project), that we use under the hood. However following the instructions from http://dplatz.de/blog/2018/gradle-apt.html should give you some good pointers (I haven't tried). Then you're welcome to update the wiki for Gradle ;-) |
@fbricon I'll try. Thanks! |
The information is outdated. It took me a few hours to get this working:
Here is the configuration, I currently use in my project and have verified in another project:
You then have to run After restarting vscode-java, changes made to source files should trigger the annotation processor and update the generated source files. @fbricon Should I add this to the Gradle Wiki? I believe you have to run this everytime an annotation processor is added, because the generated
After adding a new processor, is it still necessary to restart vscode? If yes, would it be possible to watch the file and generate a message for the user, similiar to what is currently displayed, when the user changes settings regarding the language server. |
@fvclaus Thank you so much for this. I try it in vscode, it works beautifully! Except that my path is different from yours, and hopefully putting these path under build folder won't cause problem, when i do a clean using gradle.
I hope in future, someone would do something about this, without us having to do this workaround. |
i have following error:
|
Create the fle
|
by the way: such a trick is working well for me in the case of MapStruct. so, without any plugins
|
Test project - https://github.com/snjeza/autovalued-gradle @fbricon in chat:
|
@fbricon I have fixed the issue. See snjeza/autovalued-gradle@f09e3d5
|
Nope? gradle-ap.mp4 |
Just FYI, I'm working on the Gradle AP support as well. Instead of requiring users declare
|
I know there's a wiki page about how to set up for Maven project - https://github.com/redhat-developer/vscode-java/wiki/Annotation-Processing-support-for-Maven-projects.
But how about Gradle project? Is it even possible?
The text was updated successfully, but these errors were encountered: