Skip to content

Commit

Permalink
Invalidate FUTD checks when deploying new impls
Browse files Browse the repository at this point in the history
When a project both uses and produces reference assemblies, its primary
output assembly might be up to date while (transitive) references need
to be copied to its output directory. This case fooled the Visual Studio
Fast Up-To-Date check, because the transitive dependencies aren't listed
as project inputs (because design-time builds disable RAR's
FindDependencies for performance reasons).

To account for this, introduce a new file that is updated whenever
_CopyFilesMarkedCopyLocal does actual work, pass it along as part of the
project's output, and consider it a project input for the FUTD check.
  • Loading branch information
rainersigwald committed May 19, 2017
1 parent fc64b35 commit a5cf059
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Tasks/Microsoft.Common.CurrentVersion.targets
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<PropertyGroup>
<IntermediateOutputPath Condition="!HasTrailingSlash('$(IntermediateOutputPath)')">$(IntermediateOutputPath)\</IntermediateOutputPath>
<_GenerateBindingRedirectsIntermediateAppConfig>$(IntermediateOutputPath)$(MSBuildProjectFile).$(TargetFileName).config</_GenerateBindingRedirectsIntermediateAppConfig>
<CopyUpToDateMarker Condition="'$(ProduceReferenceAssembly)' == 'true'">$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '$(IntermediateOutputPath)', '$(MSBuildProjectFile).CopyComplete'))</CopyUpToDateMarker>
</PropertyGroup>
<ItemGroup>
<IntermediateAssembly Include="$(IntermediateOutputPath)$(TargetName)$(TargetExt)"/>
Expand Down Expand Up @@ -1814,6 +1815,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<TargetPlatformMoniker>$(TargetPlatformMoniker)</TargetPlatformMoniker>
<TargetPlatformIdentifier>$(TargetPlatformIdentifier)</TargetPlatformIdentifier>
<ReferenceAssembly Condition="'$(ProduceReferenceAssembly)' == 'true'">$(TargetRefPath)</ReferenceAssembly>
<CopyUpToDateMarker Condition="'$(ProduceReferenceAssembly)' == 'true'">$(CopyUpToDateMarker)</CopyUpToDateMarker>
</TargetPathWithTargetPlatformMoniker>
</ItemGroup>
</Target>
Expand Down Expand Up @@ -2065,7 +2067,10 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<!-- The project system normally looks only at the inputs to the compiler in its
fast up-to-date check, but if the implementation assembly of a ref is stale
we still want to rerun to ensure copies, etc. happen. -->
<UpToDateCheckInput Include="@(ReferencePathWithRefAssemblies->'%(OriginalPath)')" />
<!-- The remote project might not have done anything to _its own_ assemblies, but
still need to invalidate the fast up-to-date check in projects that depend on
it because it has brought along a new implementation of one of its references. -->
<UpToDateCheckInput Include="@(ReferencePathWithRefAssemblies->'%(CopyUpToDateMarker)')" />
</ItemGroup>
</Target>

Expand Down Expand Up @@ -4235,9 +4240,18 @@ Copyright (C) Microsoft Corporation. All rights reserved.
>

<Output TaskParameter="DestinationFiles" ItemName="FileWritesShareable"/>
<Output TaskParameter="CopiedFiles" ItemName="ReferencesCopiedInThisBuild"/>

</Copy>

<!-- If this project produces reference assemblies *and* copied (possibly transitive)
references on this build, subsequent builds of projects that depend on it must
not be considered up to date, so touch this marker file that is considered an
input to projects that reference this one. -->
<Touch Files="$(CopyUpToDateMarker)"
AlwaysCreate="true"
Condition="'$(ProduceReferenceAssembly)' == 'true' and '@(ReferencesCopiedInThisBuild)' != ''" />

</Target>

<!--
Expand Down

0 comments on commit a5cf059

Please sign in to comment.