Skip to content

Require package readmes for shipping packages #105019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
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: 15 additions & 4 deletions eng/packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
<!-- Don't treat the TPM as an input to APICompat PackageValidation's reference assembly calculation. -->
<ApiCompatIgnoreTargetPlatformMoniker Condition="'$(SuppressDependenciesWhenPacking)' == 'true'">true</ApiCompatIgnoreTargetPlatformMoniker>
<PackageDesignerMarkerFile>$(MSBuildThisFileDirectory)useSharedDesignerContext.txt</PackageDesignerMarkerFile>
<PackageReadmeFile Condition="'$(PackageReadmeFile)' == '' and Exists('PACKAGE.md')">PACKAGE.md</PackageReadmeFile>

<!-- PackageReadmeFile specifies the package readme file name in the package. PackageReadmeFilePath points to the package readme file on disk. -->
<PackageReadmeFile Condition="'$(PackageReadmeFile)' == '' and '$(EnableDefaultPackageReadmeFile)' == 'true'">PACKAGE.md</PackageReadmeFile>
<PackageReadmeFilePath Condition="'$(PackageReadmeFilePath)' == '' and '$(EnableDefaultPackageReadmeFile)' == 'true'">PACKAGE.md</PackageReadmeFilePath>
<BeforePack>$(BeforePack);ValidatePackageReadmeExists</BeforePack>

<!-- Non-shipping packages shouldn't incrementally serviced. -->
<PackageUseIncrementalServicingVersion Condition="'$(IsShipping)' != 'true'">false</PackageUseIncrementalServicingVersion>
<!-- Generate packages for rid specific projects or for allconfigurations during build. -->
Expand Down Expand Up @@ -83,9 +88,9 @@
TargetFramework="$(NetFrameworkMinimum)" />
</ItemGroup>

<!-- Add a package README file from. -->
<ItemGroup Condition="'$(PackageReadmeFile)' != ''">
<None Include="$(PackageReadmeFile)" Pack="true" PackagePath="\" />
<!-- Add a package README file -->
<ItemGroup Condition="'$(PackageReadmeFilePath)' != ''">
<None Include="$(PackageReadmeFilePath)" Pack="true" PackagePath="\" />
</ItemGroup>

<Choose>
Expand Down Expand Up @@ -312,4 +317,10 @@
<Error Condition="'$(ServicingVersion)' == '0'" Text="ServicingVersion is set to 0 and it should be an increment of the patch version from the last released package." />
</Target>

<Target Name="ValidatePackageReadmeExists"
Condition="'$(PackageReadmeFilePath)' != '' and
!Exists('$(PackageReadmeFilePath)')">
<Error Text="$(PackageId) is a shipping package and is missing a required package README file. Add a 'PACKAGE.md' file into to the source project folder." />
</Target>

</Project>
3 changes: 3 additions & 0 deletions src/libraries/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@
'$(IsTestProject)' != 'true' and
'$(IsTestSupportProject)' != 'true' and
'$(IsGeneratorProject)' != 'true'">true</SkipTargetingPackShimReferences>

<!-- Make libraries packages use and require a package readme file. -->
<EnableDefaultPackageReadmeFile Condition="'$(EnableDefaultPackageReadmeFile)' == '' and '$(IsShipping)' == 'true'">true</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<Import Project="$(RepositoryEngineeringDir)codeOptimization.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
System.Index
System.Range
</PackageDescription>
<!-- TODO: Add package README file: https://github.com/dotnet/runtime/issues/99358 -->
<EnableDefaultPackageReadmeFile>false</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<PackageDescription>Suite of xUnit.net tests to check for container compatibility with Microsoft.Extensions.DependencyInjection.</PackageDescription>
<!-- this assembly doesn't need to be binplaced -->
<EnableBinPlacing>false</EnableBinPlacing>
<!-- TODO: Add package README file: https://github.com/dotnet/runtime/issues/99358 -->
<EnableDefaultPackageReadmeFile>false</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Microsoft.Extensions.Diagnostics.Metrics.InstrumentRule
Microsoft.Extensions.Diagnostics.Metrics.MeterScope
Microsoft.Extensions.Diagnostics.Metrics.MetricsBuilderExtensions
Microsoft.Extensions.Diagnostics.Metrics.MetricsOptions</PackageDescription>
<!-- TODO: Add package README file: https://github.com/dotnet/runtime/issues/99358 -->
<EnableDefaultPackageReadmeFile>false</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<DisablePackageBaselineValidation>true</DisablePackageBaselineValidation>
<IsPackable>true</IsPackable>
<PackageDescription>This package includes the default implementation of IMeterFactory and additional extension methods to easily register it with the Dependency Injection framework.</PackageDescription>
<!-- TODO: Add package README file: https://github.com/dotnet/runtime/issues/99358 -->
<EnableDefaultPackageReadmeFile>false</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<EnableDefaultItems>true</EnableDefaultItems>
<IsPackable>true</IsPackable>
<PackageDescription>Composite file and directory providers for Microsoft.Extensions.FileProviders.</PackageDescription>
<!-- TODO: Add package README file: https://github.com/dotnet/runtime/issues/99358 -->
<EnableDefaultPackageReadmeFile>false</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<EnableConfigurationBindingGenerator>true</EnableConfigurationBindingGenerator>
<IsPackable>true</IsPackable>
<PackageDescription>Configuration support for Microsoft.Extensions.Logging.</PackageDescription>
<!-- TODO: Add package README file: https://github.com/dotnet/runtime/issues/99358 -->
<EnableDefaultPackageReadmeFile>false</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<EnableDefaultItems>true</EnableDefaultItems>
<IsPackable>true</IsPackable>
<PackageDescription>Windows Event Log logger provider implementation for Microsoft.Extensions.Logging.</PackageDescription>
<!-- TODO: Add package README file: https://github.com/dotnet/runtime/issues/99358 -->
<EnableDefaultPackageReadmeFile>false</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPackable>true</IsPackable>
<PackageDescription>EventSource/EventListener logger provider implementation for Microsoft.Extensions.Logging.</PackageDescription>
<!-- TODO: Add package README file: https://github.com/dotnet/runtime/issues/99358 -->
<EnableDefaultPackageReadmeFile>false</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<NoWarn>$(NoWarn);NU5128;NU5131;PKV004</NoWarn>
<!-- Place assemblies in the nuget ref folder -->
<BuildOutputTargetFolder>ref</BuildOutputTargetFolder>
<!-- TODO: Add package README file: https://github.com/dotnet/runtime/issues/99358 -->
<EnableDefaultPackageReadmeFile>false</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand Down
44 changes: 0 additions & 44 deletions src/libraries/Microsoft.NET.WebAssembly.Threading/src/PACKAGE.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>dotnet-Microsoft.XmlSerializer.Generator</AssemblyName>
Expand All @@ -16,6 +17,8 @@
<!-- this assembly doesn't need to be binplaced -->
<EnableBinPlacing>false</EnableBinPlacing>
<IsTrimmable>false</IsTrimmable>
<!-- TODO: Add package README file: https://github.com/dotnet/runtime/issues/99358 -->
<EnableDefaultPackageReadmeFile>false</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading
Loading