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

Commit 2219e55

Browse files
committed
Account for source-build in our package build filtering
We 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 all the packages.
1 parent b50c15c commit 2219e55

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

pkg/Microsoft.NETCore.Platforms/Microsoft.NETCore.Platforms.builds

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
4-
<ItemGroup Condition="'$(OfficialBuildId)' == '' Or '$(BuildAllConfigurations)' == 'true'">
4+
<ItemGroup Condition="'$(BuildingAnOfficialBuildLeg)' != 'true' Or '$(BuildAllConfigurations)' == 'true'">
55
<Project Include="Microsoft.NETCore.Platforms.pkgproj" />
66
</ItemGroup>
77
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />

pkg/Microsoft.NETCore.Targets/Microsoft.NETCore.Targets.builds

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
4-
<ItemGroup Condition="'$(OfficialBuildId)' == '' Or '$(BuildAllConfigurations)' == 'true'">
4+
<ItemGroup Condition="'$(BuildingAnOfficialBuildLeg)' != 'true' Or '$(BuildAllConfigurations)' == 'true'">
55
<Project Include="Microsoft.NETCore.Targets.pkgproj"/>
66
</ItemGroup>
77
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />

pkg/dir.props

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="..\dir.props" />
44

5+
<PropertyGroup>
6+
<!-- Used to determine if we should build some packages only once across multiple official build legs.
7+
For offline builds we still set OfficialBuildId but we need to build all the packages for a single
8+
leg only, so we also take DotNetBuildOffline into account. -->
9+
<BuildingAnOfficialBuildLeg Condition="'$(BuildingAnOfficialBuildLeg)' == '' AND '$(OfficialBuildId)' != '' AND '$(DotNetBuildOffline)' != 'true'">true</BuildingAnOfficialBuildLeg>
10+
</PropertyGroup>
11+
512
<!-- Packages opt-in to automatic RID-specific builds by placing a *.RID.props next to their project
613
that defines the OfficialBuildRID item: all RIDs targeted by the package -->
714
<Import Project="$(MSBuildProjectDirectory)\*.rids.props" />
@@ -16,7 +23,7 @@
1623
</BuildRID>
1724
</ItemGroup>
1825

19-
<!-- create the "Project" item which is the current $(MSBuildProjectName).pkgproj with meta-data for all
26+
<!-- create the "Project" item which is the current $(MSBuildProjectName).pkgproj with meta-data for all
2027
supported RIDs -->
2128
<ItemGroup>
2229
<_project Include="@(BuildRID)">
@@ -48,10 +55,10 @@
4855
<AdditionalLibPackageExcludes Condition="'$(SymbolFileExtension)' != ''" Include="%2A%2A\%2A$(SymbolFileExtension)" />
4956
<AdditionalSymbolPackageExcludes Condition="'$(LibraryFileExtension)' != ''" Include="%2A%2A\%2A.a;%2A%2A\%2A$(LibraryFileExtension)" />
5057
</ItemGroup>
51-
58+
5259
<PropertyGroup>
5360
<!-- BlockStable on private packages by default -->
5461
<BlockStable Condition="'$(BlockStable)' == '' and $(MSBuildProjectName.Contains('Private'))">true</BlockStable>
5562
</PropertyGroup>
56-
63+
5764
</Project>

pkg/dir.traversal.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33

44
<Import Project="..\dir.traversal.targets" />
5-
6-
<PropertyGroup Condition="'$(OfficialBuildId)' != ''">
5+
6+
<PropertyGroup Condition="'$(BuildingAnOfficialBuildLeg)' == 'true'">
77
<!-- During an official build, only build identity packages in the AllConfigurations build -->
88
<SkipBuildIdentityPackage Condition="'$(BuildAllConfigurations)' != 'true'">true</SkipBuildIdentityPackage>
99

0 commit comments

Comments
 (0)