Skip to content

Commit

Permalink
Fix traversal builds and don't overbuild packages
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorHofer committed Aug 3, 2021
1 parent b151617 commit e1f3ed9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
package infra globs for .cs files. -->
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<!-- The project doesn't compile anything therefore create the package during build. -->
<GeneratePackageOnBuild Condition="'$(BuildingAnOfficialBuildLeg)' != 'true'">true</GeneratePackageOnBuild>
<IsShipping>false</IsShipping>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<!-- This is a source package which includes all .cs files by default. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<PackageId>$(MSBuildProjectName)</PackageId>
<AvoidRestoreCycleOnSelfReference>true</AvoidRestoreCycleOnSelfReference>
<AssemblyName>Microsoft.NETCore.Platforms.BuildTasks</AssemblyName>
<!-- The only output of this project is the package as the tasks aren't packaged. -->
<GeneratePackageOnBuild Condition="'$(BuildingAnOfficialBuildLeg)' != 'true'">true</GeneratePackageOnBuild>

<IsSourceProject>false</IsSourceProject>
<IsPackable>true</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,11 @@
<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>
</PropertyGroup>

<!-- By default, don't build the project references to avoid unnecessary incremental builds. -->
<ItemDefinitionGroup Condition="'$(BuildProjectReferences)' != 'true'">
<ProjectReference>
<BuildReference>false</BuildReference>
</ProjectReference>
</ItemDefinitionGroup>

<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Win32.Registry.AccessControl\src\Microsoft.Win32.Registry.AccessControl.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Win32.SystemEvents\src\Microsoft.Win32.SystemEvents.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.CodeDom\src\System.CodeDom.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.ComponentModel.Composition\src\System.ComponentModel.Composition.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.ComponentModel.Composition.Registration\src\System.ComponentModel.Composition.Registration.csproj"
Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netstandard2.1'))" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Configuration.ConfigurationManager\src\System.Configuration.ConfigurationManager.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Data.Odbc\src\System.Data.Odbc.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Data.OleDb\src\System.Data.OleDb.csproj" />
Expand All @@ -49,6 +40,10 @@
<ProjectReference Include="$(LibrariesProjectRoot)System.Threading.AccessControl\src\System.Threading.AccessControl.csproj" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netstandard2.1'))">
<ProjectReference Include="$(LibrariesProjectRoot)System.ComponentModel.Composition.Registration\src\System.ComponentModel.Composition.Registration.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="$(SystemDataSqlClientVersion)" />
<PackageReference Include="System.ServiceModel.Primitives;
Expand Down
11 changes: 7 additions & 4 deletions src/libraries/libraries-packages.proj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Packaging" Version="$(MicrosoftDotNetBuildTasksPackagingVersion)" />
</ItemGroup>

<ProjectReference Include="$(MSBuildThisFileDirectory)System.Runtime.Experimental\ref\System.Runtime.Experimental.csproj"
Condition="'$(BuildAllConfigurations)' == 'true'" />
<ItemGroup Condition="'$(BuildAllConfigurations)' == 'true'">
<ProjectReference Include="$(MSBuildThisFileDirectory)System.Runtime.Experimental\ref\System.Runtime.Experimental.csproj" />
<ProjectReference Include="$(PkgDir)*\*.proj" Exclude="$(PkgDir)test\*" />
<ProjectReference Include="$(MSBuildThisFileDirectory)*\src\*.*proj"
Condition="'$(BuildAllConfigurations)' == 'true'"
Exclude="$(MSBuildThisFileDirectory)*\src\**\*.shproj"/>
Exclude="$(MSBuildThisFileDirectory)*\src\**\*.shproj" />
<!-- Don't build *projs again during the Pack task that have already been built. -->
<ProjectReference Update="@(ProjectReference)"
AdditionalProperties="NoBuild=true" />
</ItemGroup>

<!-- Need the PackageIndexFile file property from baseline.props -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project DefaultTargets="Build">
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />

<ItemGroup Condition="'$(BuildAllConfigurations)' == 'true'">
<ItemGroup>
<!-- identity project built in AllConfigurations leg, runtime specific projects are included through netcoreapp.rids.props -->
<Project Include="$(MSBuildProjectName).pkgproj" />
</ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/libraries/src.proj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
<ItemGroup>
<_allSrc Include="$(MSBuildThisFileDirectory)*\src\*.csproj"
Exclude="@(ProjectExclusions)" />
<!-- Don't build ProjectReferences of the compat pack in a traversal build to avoid unnecessary incremental builds. -->
<_allSrc Update="$(MSBuildThisFileDirectory)Microsoft.Windows.Compatibility\src\Microsoft.Windows.Compatibility.csproj"
AdditionalProperties="BuildProjectReferences=false" />
<!-- Only build the compat pack in the allconfigurations leg. -->
<_allSrc Remove="$(MSBuildThisFileDirectory)Microsoft.Windows.Compatibility\src\Microsoft.Windows.Compatibility.csproj"
Condition="'$(BuildAllConfigurations)' != 'true'" />
<NonNetCoreAppProject Include="@(_allSrc)"
Exclude="@(NetCoreAppLibrary->'%(Identity)\src\%(Identity).csproj')" />
<NetCoreAppProject Include="$(CoreLibProject);
Expand Down

0 comments on commit e1f3ed9

Please sign in to comment.