Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Platform=AnyCPU on inner P2P to satisfy MSBuild platform negotiation #721

Merged
merged 1 commit into from
Feb 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,13 @@
<_BuildMetadataSnapped Include="@(BuildMetadata)" />
</ItemGroup>

<!-- We generally prefer to clear config|platform properties because they do not impact the version.
But quickbuild doesn't like a p2p that removes these, so set them to defensible constant values in that situation. -->
<PropertyGroup Condition=" '$(QBuild)' == '1' ">
<NBGV_InnerGlobalProperties>$(NBGV_InnerGlobalProperties)Configuration=Release;</NBGV_InnerGlobalProperties>
<NBGV_InnerGlobalProperties>$(NBGV_InnerGlobalProperties)Platform=AnyCPU;</NBGV_InnerGlobalProperties>
</PropertyGroup>
<ItemGroup Condition=" '$(QBuild)' != '1' ">
<NBGV_GlobalPropertiesToRemove Include="Configuration" />
<NBGV_GlobalPropertiesToRemove Include="Platform" />
</ItemGroup>

<ItemGroup>
<!-- Declare a P2P so that "msbuild -graph -isolate" doesn't complain when we use the MSBuild task to invoke our inner shared project. -->
<ProjectReference Include="$(NBGV_CachingProjectReference)">
<Targets>GetBuildVersion_Properties;GetBuildVersion_CloudBuildVersionVars</Targets>
<Properties>$(NBGV_InnerGlobalProperties)BuildMetadata=@(BuildMetadata, ',');</Properties>
<SetConfiguration>Configuration=Release</SetConfiguration>
<SetPlatform>Platform=AnyCPU</SetPlatform>
<GlobalPropertiesToRemove>@(NBGV_GlobalPropertiesToRemove)</GlobalPropertiesToRemove>

<!-- 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. -->
Expand Down