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
LUCENE-9475: Switch validateSourcePatterns away from Ant legacy #1806
Conversation
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.
Thanks Uwe.
Mike Drob did some work on inputs/ outputs here, it was too early though (ant compatibility). The outputs can be empty (but declared). The inputs as per usual - file collection. Should work out of the box. |
Oh haven't seen that PR. I was just annoyed by the warning. |
I wanted to change the task in the same way after all. 👍🏻 |
…puts for this task)
Hi I converted this PR to a draft, because I am incorporating changes from #1441 (which I closed, as outdated). |
…puts.uptodateWhen(true), see gradle docs!)
I think it's now ready. I did not change the inner closures to be real class members. The most important thing to me was to make the inputs declared and the outputs always uptodate, so the task only runs when inputs change. The temporary file by @madrob was not needed (the trick is |
In case you ask: Making is a class extends DefaultTask allows to better declare inputs/outputs. I am not a fan of manually adding them. This code is much more readable (because of annotations). |
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.
I'm fine with it as it is - just left some hints that I think would make the separation between task class vs. task configuration better?
Thanks Dawid, |
By the way: Due to my changes, also |
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.
Thanks Uwe!
This PR changes the legacy setp of the checkSourcePatterns task to directly execute the checker code in the running Gradle VM.
Because of Ant compatibility we preserved the old code using Ant's Groovy task. So it was executing Groovy shell inside Groovy. The code changes are minimal, further improvements are coming later.
This task has no outputs, so it's declared to run always. We may improve this, if we make the checked files and patterns a task input. Quick tests on different branches showed that task works.
This PR fixes the stupid warning caused by the groovy-inside-groovy: