-
Notifications
You must be signed in to change notification settings - Fork 460
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
Support custom index files for incremental up-to-date checking #1055
Conversation
7714eaa
to
b985e49
Compare
Is it your intention to check the index file into source control? The index file contains filesystem timestamps, so I don't think that it will work well for that. When a user does a clean, I think they usually want to redo the work from scratch for the next invocation, that's the point of performing a clean. I'm okay with merging this, but I'd like to understand the usecase better. |
Formatting for our codebase takes about 5 minutes. Our developers do clean builds fairly often, so the cache would be deleted very often and don't help us much. We do have a .cache directory in our projects, where e.g. the maven-frontend-plugin downloads node/npm. This would be the perfect location for us to put the index files. The directory is not checked into source control, it is not deleted on every clean, but we do have a custom mechanism, that cleans it from time to time, so "broken" index files can be cleaned up again. |
Hi @tisoft, thank you for this PR! Is your project a multi-module Maven project where each submodule has a <upToDateChecking>
<enabled>true</enabled>
<indexFile>${project.basedir}/.cache/custom-index-file</indexFile>
</upToDateChecking> and live in the project's root POM. Is my understanding correct? I think in a multi-module project <upToDateChecking>
<enabled>true</enabled>
<indexFile>/home/custom-index-file</indexFile>
</upToDateChecking> That's why I'm thinking perhaps the new configuration could be What do you think? |
Hi, in our use case the <upToDateChecking>
<enabled>true</enabled>
<indexFile>${maven.multiModuleProjectDirectory}/.cache/${project.groupId}_${project.artifactId}.index</indexFile>
</upToDateChecking> I agree, that it's easily possible to wrongly configure this setting. Specifying an (I wouldn't include the project version in the filename, there are maven plugins, that automatically set the version based on git commits and that would generate a new index file everytime a new commit is checked out, also cleaning the index file would only work for the exact same version) |
Interesting, I did not know about the The |
b985e49
to
fb18f39
Compare
Rebased against current main. |
@lutovich this LGTM, but if you want more changes please request them. If it looks good to you too then push the merge button :) |
* use java.nio APIs for file manipulations in UpToDateCheckingTest * simplify index file creation in NoopCheckerTest * annotate getter's return type with `@Nullable`
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.
Looks good. I pushed a few minor refactorings.
Thanks again @tisoft!
Released in |
No description provided.