T
Task5mo ago
Alex Lewis

Should the 'generates' folders be automatically excluded from 'sources' evaluaton?

If I have a project structure of:
project:
- src
- build
filea.txt
fileb.txt
project:
- src
- build
filea.txt
fileb.txt
In the taskfile, if you have:
sources:
- ./**/*
generates:
- ./build/**/*
sources:
- ./**/*
generates:
- ./build/**/*
Then the task will re-run each time. Changing sources to be:
sources:
- ./**/*
- exclude: ./build/**/*
sources:
- ./**/*
- exclude: ./build/**/*
appears to make it detect nothing has changed since the last run. Based on testing, it would appear that without the exclude the build directory is being picked up in the ./**/* pattern in sources. The actual project has a number more files and directories and adding them all as sources feels (in my ignorance) unnecessary. Are there reasons why the entries of generates are not automatically added as exclude entries for sources?
Solution:
ok, thanks. It seem like if the build directory is deleted and then recreated then it's thinking that the content has changed except I think the checksums for each file would be the same. I guess there's something different that I'm not realising. I'll close this question off as it's something specific to the project I'm working on. Thanks
Jump to solution
3 Replies
Alex Lewis
Alex LewisOP5mo ago
Actually, it appears that it is specific to the project I'm working with. If the cmds runs a clean (which only deletes the build directory) before running the build, task sees it as always changing, even if the files matched by the sources glob pattern have not changed. Does the date/time affect the output of the checksum checker?
andreynering
andreynering5mo ago
Does the date/time affect the output of the checksum checker?
What we do check is if there are any files from generates available. If not, we assume is wan't run and run again.
Solution
Alex Lewis
Alex Lewis5mo ago
ok, thanks. It seem like if the build directory is deleted and then recreated then it's thinking that the content has changed except I think the checksums for each file would be the same. I guess there's something different that I'm not realising. I'll close this question off as it's something specific to the project I'm working on. Thanks
Want results from more Discord servers?
Add your server