Skip to content

Commit

Permalink
Fix issue with incremental build with globs.
Browse files Browse the repository at this point in the history
Add a target that runs before CoreCompile that will record and store the
state of the Compile ItemGroup. This file is added to the
CustomAdditionalCompileInputs which is an input to CoreCompile. When this
file changes, CoreCompile will run again. This fixes the issue of deleting
a file or adding a file with an old timestamp to a glob (e.g. *.cs).

Fixes #1327
  • Loading branch information
AndyGerlicher committed Nov 9, 2016
1 parent dfebfd5 commit add61d1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/XMakeTasks/Microsoft.Common.CurrentVersion.targets
Expand Up @@ -3010,6 +3010,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
_GenerateCompileInputs;
BeforeCompile;
_TimeStampBeforeCompile;
_GenerateCompilerDependencyFile;
CoreCompile;
_TimeStampAfterCompile;
AfterCompile;
Expand Down Expand Up @@ -3164,6 +3165,22 @@ Copyright (C) Microsoft Corporation. All rights reserved.

</Target>

<!--
============================================================
_GenerateCompilerDependencyFile
Generate file with a list of compile source files. This is used to track
incremental build between build execution specifically around addition and
deletions of file globs (e.g. <Compile Include="**\*.cs" />).
============================================================
-->
<Target Name="_GenerateCompilerDependencyFile" BeforeTargets="CoreCompile">
<WriteLinesToFile Lines="@(Compile->'%(FullPath)')" File="$(IntermediateOutputPath)Compile.deps" Overwrite="True" WriteOnlyWhenDifferent="True" />
<ItemGroup>
<CustomAdditionalCompileInputs Include="$(IntermediateOutputPath)Compile.deps" />
</ItemGroup>
</Target>

<!--
============================================================
_TimeStampAfterCompile
Expand Down

0 comments on commit add61d1

Please sign in to comment.