-
Notifications
You must be signed in to change notification settings - Fork 12
Gradle incremental annotation processing support #200
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
Comments
This is kind of a bug. I am fairly sure there is some way to support incremental in gradle better I just have delved into it enough since I don't use Gradle as often. I know jooby does special things and I believe micronaut. |
... hm ...not sure this is a Gradle bug ... if you just tell it what the annotation processor is, it would not know what it works, or which files to monitor for changes. I still think adding this in the docs for Gradle would be enough:
|
What I was talking about is using That gives gradle some hints that I'm still exploring. |
@hrstoyanov Can you make a bare minimum Gradle project using JStachio? I have not used Gradle from the ground up in some time (> 5 years) and when I have to use it I'm building on top of someone else's gradle setup. If you can't it is ok it just would shave off some time for me to fix incremental. |
Sure, will have something for you later today... |
@agentgt i scraped together a bare-bone Gradle jstachio project here: https://github.com/hrstoyanov/issue201/ See the README.md for instructions. |
Ok I looked into it and you are right with the resources config you provided so I will be adding that to the doc. As for the other gradle incremental support I was mistaken. It is about Java and therefore when what happens when changing the annotated model. That I'm playing with right now with your sample project. |
Uh oh!
There was an error while loading. Please reload this page.
This is not a jStachio issue, but something users of the Gradle build tool need to be aware of:
I accidentally had this property in my gradle.properties file:
... and as a result, my template were cached and not reflecting changes I did to the files (resulting in stale rendered outputs), even after I run a clean task! The above gradle properties is not set on by default (maybe for a reason, I think), so be careful and know what you are doing, if you set it to true!
Another problem with Gradle is that (assuming the above property is not set) you still need to do a "clean" if you edit the templates, because changes in them will not be detected - gradle only looks at the java files and does not know that it should run the annotation processor after template files change. Here is how I mitigated this issue - I added additional dependency for the annotation processor:
Now every change in the templates will trigger the annotation processor and cause recompile of the generated template renderers. You can even set the org.gradle.caching property from above, and your dev cycles will still work correctly!
Maybe this is worth adding to the docs for "gradlers" like me? I am not even sure how is this addressed with Maven builds?
The text was updated successfully, but these errors were encountered: