-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Currently targets are skipped based on the timestamps of files defined as inputs and outputs for the target. This is good and fast, yet maybe incorrect for what the target author intended.
Especially with the increased popularity of globbing to add items to projects, these items alone cannot be used as only inputs for incremental builds in some situations which may be unexpected for target authors. For example, when items are deleted or renamed, there is no newer modification timestamp, so a target may be skipped. Previously, the main project was modified when new items were added to the project so all targets using $(MSBuildAllProjects)
as input would be rebuilt, but with globbing and an @(Compile)
or @(Content)
input, a target may be skipped unexpectedly.
Proposal: Add a new attribute to targets to allow target authors to opt into a new tracking of the input closure, so that given File1
, File2
and File3
existed on disk with equal timestamps, a change of inputs from File1;File2
to File2;File3
will cause the target to be rebuilt.
I don't have a good idea how to name it though (TrackClosureForIncrementalBuilds="true"
?).
The only workaround tat the moment would be to have an additional target write a file with all the inputs using MSBuild 15's <WriteLinesToFile WriteOnlyWhenDifferent="True" …/>
feature and using the resulting file as input for incremental builds.