Provide conditional support for file inclusion.
- Dominant language
- JavaScript
- Stars
- 12.2k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
A specific issue that I had run in to a while back was that, after running a large build job, there is a lot of work going on building targets that had not changed. While I did not solve this problem for all file based tasks, I did specifically implement a modification for grunt-contrib-copy in my own fork:
https://github.com/dancingplatypus/grunt-contrib-copy
This modification allows files to be ignored unless the source is newer than the destination. I did this by specifically updating the modification timestamp of the destination file with that of the source file. I then allow the configuration to specify if the process should run every time, or only when the source file is newer, or when the destination file had been modified, never, or finally, through a user defined predicate.
After submitting a pull request, I was advised that my modification might belong further up the chain, so that all tasks, grunt-contrib-copy included, might benefit. I also recognize that this is the same sort of generic behavior we might find in other make systems.
I see that the changes might be localized to `file.js` in the grunt project, and although the `copy` method seems the obvious point of injection, the `recurse` method might allow for one to expand this functionality so that any task which specifies a source and destination might skip processing of files that have not changed.
Thoughts?
Contributor guide
Assessment
This issue has not been assessed yet.