Skip to content

Commit e590f87

Browse files
authored
Merge pull request #721 from dotnet/platformNegotiation
Set Platform=AnyCPU on inner P2P to satisfy MSBuild platform negotiation
2 parents d9ed2fe + b245ff9 commit e590f87

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/Nerdbank.GitVersioning.Tasks/build/MSBuildTargetCaching.targets

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,13 @@
1717
<_BuildMetadataSnapped Include="@(BuildMetadata)" />
1818
</ItemGroup>
1919

20-
<!-- We generally prefer to clear config|platform properties because they do not impact the version.
21-
But quickbuild doesn't like a p2p that removes these, so set them to defensible constant values in that situation. -->
22-
<PropertyGroup Condition=" '$(QBuild)' == '1' ">
23-
<NBGV_InnerGlobalProperties>$(NBGV_InnerGlobalProperties)Configuration=Release;</NBGV_InnerGlobalProperties>
24-
<NBGV_InnerGlobalProperties>$(NBGV_InnerGlobalProperties)Platform=AnyCPU;</NBGV_InnerGlobalProperties>
25-
</PropertyGroup>
26-
<ItemGroup Condition=" '$(QBuild)' != '1' ">
27-
<NBGV_GlobalPropertiesToRemove Include="Configuration" />
28-
<NBGV_GlobalPropertiesToRemove Include="Platform" />
29-
</ItemGroup>
30-
3120
<ItemGroup>
3221
<!-- Declare a P2P so that "msbuild -graph -isolate" doesn't complain when we use the MSBuild task to invoke our inner shared project. -->
3322
<ProjectReference Include="$(NBGV_CachingProjectReference)">
3423
<Targets>GetBuildVersion_Properties;GetBuildVersion_CloudBuildVersionVars</Targets>
3524
<Properties>$(NBGV_InnerGlobalProperties)BuildMetadata=@(BuildMetadata, ',');</Properties>
25+
<SetConfiguration>Configuration=Release</SetConfiguration>
26+
<SetPlatform>Platform=AnyCPU</SetPlatform>
3627
<GlobalPropertiesToRemove>@(NBGV_GlobalPropertiesToRemove)</GlobalPropertiesToRemove>
3728

3829
<!-- Do our very best to prevent Microsoft.Common.CurrentVersion.targets or IDEs from processing this P2P. It's only here for MSBuild's static graph. -->

0 commit comments

Comments
 (0)