More robust change detection - #594
Conversation
Also add file length comparaisons when detecting changes in order to increase the validity of the new `forceCreation` documentation. `forceCreation` is less necessary than it was in 3.x because the new plugin detects when the JAR file contains more files than expected. Therefore, the example given in documentation (shade plugin) should not be true anymore. `skipIfEmpty` skips the JAR file creation not only if the directory does not exist, but also if no input files are matched for inclusion.
|
Thanks @desruisseaux — great to have change detection robust enough that The length comparison is skipped on the forward-scan match. In I pushed a small fix that extracts a Two things it doesn't include yet — happy to add if useful:
Let me know if you'd like the tests too, or prefer to take it from here. |
TimestampCheck.removeFromFilesInJAR compared the entry length only when the entry was already buffered in filesInJAR; on the forward-scan match it returned true without checking the length. With build files requested in roughly ZIP order that path is the common one, so the length check rarely ran and a same-timestamp/different-size file (the shade-plugin case) could still be treated as up to date. Extract a sizesMatch(a, b) helper and apply it on both paths, and add an isDirectory(long) predicate for the sentinel checks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Modify the documentation about
forceCreationandskipIfEmptyfor taking in account the fact that the new JAR plugin implementation also verify if the JAR files has more files than expected, which cover the Shape plugin case documented as a reason for theforceCreationoption.Also add file length comparaison when detecting changes in order to increase the validity of the new
forceCreationdocumentation, which said that while supported, this option is often not necessary.Edit the documentation of
skipIfEmptybecause this option skips the JAR file creation not only if the directory does not exist, but also if no input files are matched for inclusion.This pull request complement #585.