Skip to content
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

Fixed unchanged sources check #104

Merged

Conversation

AndreaBaroncelli
Copy link

When attempting to use flag skipSourcesUnchanged in a code base that generates mapping code via MapStruct, I realized the flag is overworking, in that changed source files too were skipped. The issue seems to reside in lastModified check being polluted by file .maven-processor-source-files.txt, that is rewritten in method areSourceFilesSameAsPreviousRun (which seems to be part of the problem, as you would not expect this method to be in charge of rewriting the file, which should instead be generated at the very end) : as a consequence, its lastModified date is inevitably the most recent one, hence it comes after all source files' ones, which results in method isSourcesUnchanged always returning true.

I wonder whether another possible approach could be to compare maxSourceDate with minOutputDate, instead that maxOutputDate.

File .maven-processor-source-files.txt must be skipped in lastModified check (being just an extra file added for control purposes), especially because it is rewritten in method areSourceFilesSameAsPreviousRun, so its lastModified date is necessarily the most recent one, which causes method to always return true.
@bsorrentino bsorrentino self-assigned this Apr 12, 2024
@bsorrentino bsorrentino merged commit 0b470ed into bsorrentino:master Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants