Skip to content

Commit

Permalink
Use the new Microsoft.DotNet.PackageValidation on Microsoft.Extension…
Browse files Browse the repository at this point in the history
…s* packages. (dotnet#52741)

* enabling the new validation on extensions packages

* use most recent version namespace fixes

* use the new pacakge version with the path fix

* editing the comments
  • Loading branch information
Anipik authored May 24, 2021
1 parent f318f32 commit fda04b9
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
"msbuild-sdks": {
"Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "6.0.0-beta.21271.3",
"Microsoft.DotNet.PackageValidation" : "1.0.0-preview.6.21274.7",
"Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.21271.3",
"Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.21271.3",
"Microsoft.DotNet.SharedFramework.Sdk": "6.0.0-beta.21271.3",
Expand Down
2 changes: 2 additions & 0 deletions src/libraries/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
<!-- Import packaging props -->
<Import Project="$(RepositoryEngineeringDir)packaging.props" />

<Import Sdk="Microsoft.DotNet.PackageValidation" Project="Sdk.props" Condition="'$(IsSourceProject)' == 'true'" />

<PropertyGroup>
<RefRootPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'ref'))</RefRootPath>
</PropertyGroup>
Expand Down
7 changes: 7 additions & 0 deletions src/libraries/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@
<PackageReference Include="Microsoft.DotNet.GenFacades" Version="$(MicrosoftDotNetGenFacadesVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
</ItemGroup>

<Import Sdk="Microsoft.DotNet.PackageValidation" Project="Sdk.targets" Condition="'$(IsSourceProject)' == 'true' and !Exists('$(PkgProjPath)')" />

<PropertyGroup>
<PackageValidationBaselineVersion Condition="'$(PackageValidationBaselineVersion)' == ''">$([MSBuild]::Subtract($(MajorVersion), 1)).0.0</PackageValidationBaselineVersion>
<EnablePackageBaselineValidation Condition="'$(IsPackable)' == 'true' and '$(MSBuildProjectExtension)' != '.pkgproj' and '$(EnablePackageBaselineValidation)' == ''">true</EnablePackageBaselineValidation>
</PropertyGroup>

<Target Name="SetGenApiProperties"
BeforeTargets="GenerateReferenceAssemblySource">
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<EnableDefaultItems>true</EnableDefaultItems>
<CLSCompliant>false</CLSCompliant>
<IsRuntimeAssembly>false</IsRuntimeAssembly>
<PackageValidationBaselineVersion>3.1.15</PackageValidationBaselineVersion>
<PackageDescription>Suite of xUnit.net tests to check for container compatibility with Microsoft.Extensions.DependencyInjection.</PackageDescription>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<!-- Debug IL generation -->
<ILEmitBackendSaveAssemblies>False</ILEmitBackendSaveAssemblies>
<Nullable>Annotations</Nullable>
<!-- Type 'Microsoft.Extensions.DependencyInjection.ServiceCollection' has been forwaded down.-->
<NoWarn>$(NoWarn);CP0001</NoWarn>
<PackageDescription>Default implementation of dependency injection for Microsoft.Extensions.DependencyInjection.</PackageDescription>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<EnableDefaultItems>true</EnableDefaultItems>
<!-- PKV006 is due to intentional removal of .NETFramework,Version=v4.5.1, .NETStandard,Version=v1.3 and NETStandard,Version=v1.6 target frameworks from the package as they are no longer supported. -->
<NoWarn>$(NoWarn);PKV006</NoWarn>
<PackageDescription>Abstractions for reading `.deps` files.

Commonly Used Types:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<IsShipping>false</IsShipping>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<IsSourcePackage>true</IsSourcePackage>
<!-- This is non-shipping package. -->
<EnablePackageBaselineValidation>false</EnablePackageBaselineValidation>
<PackageDescription>Internal package for sharing Microsoft.Extensions.Hosting.HostFactoryResolver type.</PackageDescription>
</PropertyGroup>

Expand Down

0 comments on commit fda04b9

Please sign in to comment.