Skip to content

Commit e1f3ed9

Browse files
committed
Fix traversal builds and don't overbuild packages
1 parent b151617 commit e1f3ed9

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

src/libraries/Microsoft.Extensions.HostFactoryResolver/src/Microsoft.Extensions.HostFactoryResolver.Sources.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
package infra globs for .cs files. -->
44
<PropertyGroup>
55
<TargetFramework>netstandard2.0</TargetFramework>
6-
<!-- The project doesn't compile anything therefore create the package during build. -->
7-
<GeneratePackageOnBuild Condition="'$(BuildingAnOfficialBuildLeg)' != 'true'">true</GeneratePackageOnBuild>
86
<IsShipping>false</IsShipping>
97
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
108
<!-- This is a source package which includes all .cs files by default. -->

src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
<PackageId>$(MSBuildProjectName)</PackageId>
77
<AvoidRestoreCycleOnSelfReference>true</AvoidRestoreCycleOnSelfReference>
88
<AssemblyName>Microsoft.NETCore.Platforms.BuildTasks</AssemblyName>
9-
<!-- The only output of this project is the package as the tasks aren't packaged. -->
10-
<GeneratePackageOnBuild Condition="'$(BuildingAnOfficialBuildLeg)' != 'true'">true</GeneratePackageOnBuild>
119

1210
<IsSourceProject>false</IsSourceProject>
1311
<IsPackable>true</IsPackable>

src/libraries/Microsoft.Windows.Compatibility/src/Microsoft.Windows.Compatibility.csproj

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,11 @@
1010
<PackageDescription>This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard.</PackageDescription>
1111
</PropertyGroup>
1212

13-
<!-- By default, don't build the project references to avoid unnecessary incremental builds. -->
14-
<ItemDefinitionGroup Condition="'$(BuildProjectReferences)' != 'true'">
15-
<ProjectReference>
16-
<BuildReference>false</BuildReference>
17-
</ProjectReference>
18-
</ItemDefinitionGroup>
19-
2013
<ItemGroup>
2114
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Win32.Registry.AccessControl\src\Microsoft.Win32.Registry.AccessControl.csproj" />
2215
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Win32.SystemEvents\src\Microsoft.Win32.SystemEvents.csproj" />
2316
<ProjectReference Include="$(LibrariesProjectRoot)System.CodeDom\src\System.CodeDom.csproj" />
2417
<ProjectReference Include="$(LibrariesProjectRoot)System.ComponentModel.Composition\src\System.ComponentModel.Composition.csproj" />
25-
<ProjectReference Include="$(LibrariesProjectRoot)System.ComponentModel.Composition.Registration\src\System.ComponentModel.Composition.Registration.csproj"
26-
Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netstandard2.1'))" />
2718
<ProjectReference Include="$(LibrariesProjectRoot)System.Configuration.ConfigurationManager\src\System.Configuration.ConfigurationManager.csproj" />
2819
<ProjectReference Include="$(LibrariesProjectRoot)System.Data.Odbc\src\System.Data.Odbc.csproj" />
2920
<ProjectReference Include="$(LibrariesProjectRoot)System.Data.OleDb\src\System.Data.OleDb.csproj" />
@@ -49,6 +40,10 @@
4940
<ProjectReference Include="$(LibrariesProjectRoot)System.Threading.AccessControl\src\System.Threading.AccessControl.csproj" />
5041
</ItemGroup>
5142

43+
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netstandard2.1'))">
44+
<ProjectReference Include="$(LibrariesProjectRoot)System.ComponentModel.Composition.Registration\src\System.ComponentModel.Composition.Registration.csproj" />
45+
</ItemGroup>
46+
5247
<ItemGroup>
5348
<PackageReference Include="System.Data.SqlClient" Version="$(SystemDataSqlClientVersion)" />
5449
<PackageReference Include="System.ServiceModel.Primitives;

src/libraries/libraries-packages.proj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
<ItemGroup>
44
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Packaging" Version="$(MicrosoftDotNetBuildTasksPackagingVersion)" />
5+
</ItemGroup>
56

6-
<ProjectReference Include="$(MSBuildThisFileDirectory)System.Runtime.Experimental\ref\System.Runtime.Experimental.csproj"
7-
Condition="'$(BuildAllConfigurations)' == 'true'" />
7+
<ItemGroup Condition="'$(BuildAllConfigurations)' == 'true'">
8+
<ProjectReference Include="$(MSBuildThisFileDirectory)System.Runtime.Experimental\ref\System.Runtime.Experimental.csproj" />
89
<ProjectReference Include="$(PkgDir)*\*.proj" Exclude="$(PkgDir)test\*" />
910
<ProjectReference Include="$(MSBuildThisFileDirectory)*\src\*.*proj"
10-
Condition="'$(BuildAllConfigurations)' == 'true'"
11-
Exclude="$(MSBuildThisFileDirectory)*\src\**\*.shproj"/>
11+
Exclude="$(MSBuildThisFileDirectory)*\src\**\*.shproj" />
12+
<!-- Don't build *projs again during the Pack task that have already been built. -->
13+
<ProjectReference Update="@(ProjectReference)"
14+
AdditionalProperties="NoBuild=true" />
1215
</ItemGroup>
1316

1417
<!-- Need the PackageIndexFile file property from baseline.props -->

src/libraries/pkg/runtime.native.System.IO.Ports/runtime.native.System.IO.Ports.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project DefaultTargets="Build">
22
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
33

4-
<ItemGroup Condition="'$(BuildAllConfigurations)' == 'true'">
4+
<ItemGroup>
55
<!-- identity project built in AllConfigurations leg, runtime specific projects are included through netcoreapp.rids.props -->
66
<Project Include="$(MSBuildProjectName).pkgproj" />
77
</ItemGroup>

src/libraries/src.proj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
<ItemGroup>
88
<_allSrc Include="$(MSBuildThisFileDirectory)*\src\*.csproj"
99
Exclude="@(ProjectExclusions)" />
10+
<!-- Don't build ProjectReferences of the compat pack in a traversal build to avoid unnecessary incremental builds. -->
11+
<_allSrc Update="$(MSBuildThisFileDirectory)Microsoft.Windows.Compatibility\src\Microsoft.Windows.Compatibility.csproj"
12+
AdditionalProperties="BuildProjectReferences=false" />
13+
<!-- Only build the compat pack in the allconfigurations leg. -->
14+
<_allSrc Remove="$(MSBuildThisFileDirectory)Microsoft.Windows.Compatibility\src\Microsoft.Windows.Compatibility.csproj"
15+
Condition="'$(BuildAllConfigurations)' != 'true'" />
1016
<NonNetCoreAppProject Include="@(_allSrc)"
1117
Exclude="@(NetCoreAppLibrary->'%(Identity)\src\%(Identity).csproj')" />
1218
<NetCoreAppProject Include="$(CoreLibProject);

0 commit comments

Comments
 (0)