Skip Updating CopyComplete Marker When Not Necessary #6846
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backporting fix for #6576
See base PR #6698
Context
#6576 revealed that the
.copycomplete
file marker is updated even when theCopy
task in_GetCopyFilesMarkedLocal
doesn't actually copy anything. This can mess with incremental builds.Changes Made
This change adds an output parameter,
CopiedAtLeastOneFile
to theCopy
task that theTouch
task is now conditioned off of.Testing
Tested local builds
Notes
This could also be done by having an ITaskItem[] that contains all files that were actually copied. Then the touch task could check if that item were empty. I opted for the straightforward route since the ITaskItem[] solution isn't needed yet, and this implementation can easily be changed when we do need that.