-
Notifications
You must be signed in to change notification settings - Fork 5k
Cache JavaExec task by Java version. #6711
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
Conversation
Hi everyone! Would it be possible to get an update? If this change looks good, I'd love for it to be in a nightly version soon so I can pull it into my company's build. If there are other things to consider, I can either help resolve them or can look for temporary workarounds in my build in the meantime. Thank you! |
Whoops, I forgot about this as I switched teams at my company, but a former teammate reminded me about our need for this so wanted to check back in for an update. Is this something we can merge in the current form? |
@tjni Thank you for the PR. No, we cannot merge it in the current form since test coverage is missing. There should be a test which checks that the task is out of date when the Java version changes. |
Thanks for the pointers on Slack, @wolfs. I updated the PR with a few integration tests. Let me know if any changes are needed. I took the opportunity to update the test that requires two different JDK 7 installations to look for two different JDK 8 installations and verified that they pass on my own machine. I'll need help to configure the CI build machines to satisfy that precondition if they do not already. |
Instead of caching by the executable, cache by the Java version so that the task remains cacheable if the path to the executable changes. Signed-off-by: Theodore Ni <[email protected]>
Hi @wolfs , Is this PR available in nightly build yet? I would love to pull this into our company's build and test it out. |
@big-guy - Is this PR available in nightly build? |
@tjni @devishree90 this will be in 5.2. You should be able to see this in a nightly tomorrow |
Thank you @big-guy |
Instead of caching by the executable, cache by the Java version so that the task remains cacheable if the path to the executable changes.
Resolves #6694.
Signed-off-by: Theodore Ni [email protected]
I attempted to write a test for this but could not figure out a way to emulate a changing Java path that returns the same Java version. I did not find a similar test for the Java compile or test tasks that could be used as a template.
Contributor Checklist
<subproject>/src/integTest
) to verify changes from a user perspective<subproject>/src/test
) to verify logic./gradlew <changed-subproject>:check
Gradle Core Team Checklist