Skip to content

Commit

Permalink
[msbuild] fix integration caching (microsoft#16787)
Browse files Browse the repository at this point in the history
we would always run on build, as opposed to only running when changes happened
  • Loading branch information
strega-nil authored Mar 22, 2021
1 parent e2e6dbd commit 062676d
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions scripts/buildsystems/msbuild/vcpkg.targets
Original file line number Diff line number Diff line change
Expand Up @@ -73,31 +73,41 @@
Importance="High" Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgNormalizedConfiguration)' == ''"/>
</Target>

<ItemGroup>
<_ZVcpkgInstallManifestDependenciesInputs Include="$(VcpkgManifestRoot)vcpkg.json"/>
<_ZVcpkgInstallManifestDependenciesInputs Include="$(VcpkgManifestRoot)vcpkg-configuration.json" Condition="Exists('$(VcpkgManifestRoot)vcpkg-configuration.json')"/>
<PropertyGroup Condition="'$(VcpkgEnabled)' == 'true'">
<_ZVcpkgManifestFileLocation>$(VcpkgManifestRoot)vcpkg.json </_ZVcpkgManifestFileLocation>
<_ZVcpkgConfigurationFileLocation>$(VcpkgManifestRoot)vcpkg-configuration.json</_ZVcpkgConfigurationFileLocation>

<_ZVcpkgTLogFileLocation>$(TLogLocation)VcpkgInstallManifest$(VcpkgTriplet).$(VcpkgHostTriplet).read.1u.tlog</_ZVcpkgTLogFileLocation>
<_ZVcpkgMSBuildStampFile>$(VcpkgInstalledDir).msbuildstamp-$(VcpkgTriplet).$(VcpkgHostTriplet).stamp</_ZVcpkgMSBuildStampFile>
</PropertyGroup>
<ItemGroup Condition="'$(VcpkgEnabled)' == 'true'">
<_ZVcpkgInstallManifestDependenciesInputs Include="$(_ZVcpkgManifestFileLocation)"/>
<_ZVcpkgInstallManifestDependenciesInputs Include="$(_ZVcpkgConfigurationFileLocation)" Condition="Exists('$(_ZVcpkgConfigurationFileLocation)')"/>

<_ZVcpkgInstallManifestDependenciesOutputs Include="$(_ZVcpkgTLogFileLocation)"/>
<_ZVcpkgInstallManifestDependenciesOutputs Include="$(_ZVcpkgMSBuildStampFile)"/>
</ItemGroup>

<Target Name="VcpkgInstallManifestDependencies" BeforeTargets="ClCompile"
Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgEnableManifest)' == 'true' and '$(VcpkgManifestInstall)' == 'true'"
Inputs="@(_ZVcpkgInstallManifestDependenciesInputs)"
Outputs="$(TLogLocation)VcpkgInstallManifest$(VcpkgTriplet).read.1u.tlog;$(VcpkgInstalledDir).msbuildstamp-$(VcpkgTriplet).$(VcpkgHostTriplet).stamp">
Outputs="@(_ZVcpkgInstallManifestDependenciesOutputs)">
<Message Text="Installing vcpkg dependencies to $(VcpkgInstalledDir)" Importance="High" />
<MakeDir Directories="$(TLogLocation)" />
<ItemGroup>
<_VcpkgItemToDelete Include="$(TLogLocation)VcpkgInstallManifest*.read.1u.tlog" />
<_VcpkgItemToDelete Include="$(VcpkgInstalledDir).msbuildstamp-*" />
<_ZVcpkgItemToDelete Include="$(TLogLocation)VcpkgInstallManifest*.read.1u.tlog" />
<_ZVcpkgItemToDelete Include="$(VcpkgInstalledDir).msbuildstamp-*" />
</ItemGroup>
<Delete Files="@(_VcpkgItemToDelete)" />
<Delete Files="@(_ZVcpkgItemToDelete)" />
<Message Text="%22$(_ZVcpkgExecutable)%22 install $(_ZVcpkgHostTripletParameter) --x-wait-for-lock --triplet %22$(VcpkgTriplet)%22 --vcpkg-root %22$(VcpkgRoot)\%22 %22--x-manifest-root=$(VcpkgManifestRoot)\%22 %22--x-install-root=$(VcpkgInstalledDir)\%22 $(VcpkgAdditionalInstallOptions)"
Importance="High" />
<Exec Command="%22$(_ZVcpkgExecutable)%22 install $(_ZVcpkgHostTripletParameter) --x-wait-for-lock --triplet %22$(VcpkgTriplet)%22 --vcpkg-root %22$(VcpkgRoot)\%22 %22--x-manifest-root=$(VcpkgManifestRoot)\%22 %22--x-install-root=$(VcpkgInstalledDir)\%22 $(VcpkgAdditionalInstallOptions)"
StandardOutputImportance="High" />
<WriteLinesToFile File="$(TLogLocation)VcpkgInstallManifest$(VcpkgTriplet).$(VcpkgHostTriplet).read.1u.tlog"
<WriteLinesToFile File="$(_ZVcpkgTLogFileLocation)"
Lines="@(_VcpkgInstallManifestDependenciesInputs -> '^%(Identity)')"
Encoding="Unicode"
Overwrite="true"/>
<Touch Files="$(VcpkgInstalledDir).msbuildstamp-$(VcpkgTriplet).$(VcpkgHostTriplet).stamp" AlwaysCreate="true" />
<Touch Files="$(_ZVcpkgMSBuildStampFile)" AlwaysCreate="true" />

<CreateProperty Value="false">
<Output TaskParameter="ValueSetByTask" PropertyName="Link_MinimalRebuildFromTracking" />
Expand Down

0 comments on commit 062676d

Please sign in to comment.