incremental-build
Installation
SKILL.md
How MSBuild Incremental Build Works
MSBuild's incremental build mechanism allows targets to be skipped when their outputs are already up to date, dramatically reducing build times on subsequent runs.
- Targets with
InputsandOutputsattributes: MSBuild compares the timestamps of all files listed inInputsagainst all files listed inOutputs. If every output file is newer than every input file, the target is skipped entirely. - Without
Inputs/Outputs: The target runs every time the build is invoked. This is the default behavior and the most common cause of slow incremental builds. Incrementalattribute on targets: Targets can explicitly opt in or out of incremental behavior. SettingIncremental="false"forces the target to always run, even ifInputsandOutputsare specified.- Timestamp-based comparison: MSBuild uses file system timestamps (last write time) to determine staleness. It does not use content hashes. This means touching a file (updating its timestamp without changing content) will trigger a rebuild.
<!-- This target is incremental: skipped if Output is newer than all Inputs -->
<Target Name="Transform"
Inputs="@(TransformFiles)"
Outputs="@(TransformFiles->'$(OutputPath)%(Filename).out')">
<!-- work here -->
</Target>