Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 41efe17

Browse files
committed
Fix identity package filtering
We only want to filter out identity package builds on official builds that aren't windows x64, to avoid building and publishing them more then once in an official build. We also need to account for source-build which sets the OfficialBuildId property to replicate the official builds, so we also look at the DotNetBuildOffline property to determine that we should still build the identity package.
1 parent 2252f2b commit 41efe17

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/.nuget/dir.traversal.targets

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,28 @@
33

44
<Import Project="$(MSBuildThisFileDirectory)..\..\dir.traversal.targets" />
55

6-
<PropertyGroup Condition="'$(OfficialBuildId)' != ''">
7-
<!-- During an official build, only build identity packages in the AllConfigurations build -->
8-
<BuildIdentityPackage Condition="'$(BuildIdentityPackage)' == '' AND '$(OS)' == 'Windows_NT' AND '$(BuildArch)' == 'x64'">true</BuildIdentityPackage>
6+
<PropertyGroup Condition="'$(BuildIdentityPackage)' == ''">
7+
<BuildIdentityPackage>true</BuildIdentityPackage>
8+
9+
<!-- Used to determine if we should build some packages only once across multiple official build legs.
10+
For offline builds we still set OfficialBuildId but we need to build all the packages for a single
11+
leg only, so we also take DotNetBuildOffline into account. -->
12+
<BuildingAnOfficialBuildLeg Condition="'$(OfficialBuildId)' != '' AND '$(DotNetBuildOffline)' != 'true'">true</BuildingAnOfficialBuildLeg>
13+
14+
<!-- During an official build, only build identity packages on windows x64 legs -->
15+
<BuildIdentityPackage Condition="'$(BuildingAnOfficialBuildLeg)' == 'true' AND ('$(OS)' != 'Windows_NT' OR '$(BuildArch)' != 'x64')">false</BuildIdentityPackage>
916
</PropertyGroup>
1017

1118
<Target Name="FilterProjects" BeforeTargets="Build">
1219
<Error Condition="'$(PackageRID)' == ''" Text="'PackageRID' property must be specified."/>
1320

1421
<!-- Only build packages for current RID or non-RID-specific -->
15-
<ItemGroup Condition="$(BuildIdentityPackage)!='true'">
22+
<ItemGroup>
1623
<_projectsToBuild Include="@(Project)" Condition="'%(Project.PackageTargetRuntime)' == '$(PackageRID)'" />
1724
</ItemGroup>
1825

19-
<ItemGroup Condition="$(BuildIdentityPackage)=='true'" >
20-
<_projectsToBuild Include="@(Project)" Condition="'%(Project.PackageTargetRuntime)' == '$(PackageRID)' OR '%(Project.PackageTargetRuntime)' == ''" />
26+
<ItemGroup Condition="'$(BuildIdentityPackage)' == 'true'">
27+
<_projectsToBuild Include="@(Project)" Condition="'%(Project.PackageTargetRuntime)' == ''" />
2128
</ItemGroup>
2229

2330
<ItemGroup>

0 commit comments

Comments
 (0)