Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
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
19 changes: 13 additions & 6 deletions src/.nuget/dir.traversal.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,28 @@

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

<PropertyGroup Condition="'$(OfficialBuildId)' != ''">
<!-- During an official build, only build identity packages in the AllConfigurations build -->
<BuildIdentityPackage Condition="'$(BuildIdentityPackage)' == '' AND '$(OS)' == 'Windows_NT' AND '$(BuildArch)' == 'x64'">true</BuildIdentityPackage>
<PropertyGroup Condition="'$(BuildIdentityPackage)' == ''">
<BuildIdentityPackage>true</BuildIdentityPackage>

<!-- Used to determine if we should build some packages only once across multiple official build legs.
For offline builds we still set OfficialBuildId but we need to build all the packages for a single
leg only, so we also take DotNetBuildOffline into account. -->
<BuildingAnOfficialBuildLeg Condition="'$(OfficialBuildId)' != '' AND '$(DotNetBuildOffline)' != 'true'">true</BuildingAnOfficialBuildLeg>

<!-- During an official build, only build identity packages on windows x64 legs -->
<BuildIdentityPackage Condition="'$(BuildingAnOfficialBuildLeg)' == 'true' AND ('$(OS)' != 'Windows_NT' OR '$(BuildArch)' != 'x64')">false</BuildIdentityPackage>
</PropertyGroup>

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

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

<ItemGroup Condition="$(BuildIdentityPackage)=='true'" >
<_projectsToBuild Include="@(Project)" Condition="'%(Project.PackageTargetRuntime)' == '$(PackageRID)' OR '%(Project.PackageTargetRuntime)' == ''" />
<ItemGroup Condition="'$(BuildIdentityPackage)' == 'true'">
<_projectsToBuild Include="@(Project)" Condition="'%(Project.PackageTargetRuntime)' == ''" />
</ItemGroup>

<ItemGroup>
Expand Down