feat(sdk): integrate NuGet packaging metadata defaults
This commit is contained in:
parent
9929b2db36
commit
cf08e29397
6 changed files with 73 additions and 25 deletions
|
|
@ -4,6 +4,8 @@
|
|||
<NoBuild>true</NoBuild>
|
||||
<IncludeBuildOutput>false</IncludeBuildOutput>
|
||||
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
|
||||
<IncludeSymbols>false</IncludeSymbols>
|
||||
<Description>MSBuild SDK for test projects with standardized build, analyzer, and editor configuration defaults.</Description>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
<NoBuild>true</NoBuild>
|
||||
<IncludeBuildOutput>false</IncludeBuildOutput>
|
||||
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
|
||||
<IncludeSymbols>false</IncludeSymbols>
|
||||
<Description>MSBuild SDK for ASP.NET Core web projects with standardized build, analyzer, and editor configuration defaults.</Description>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
<NoBuild>true</NoBuild>
|
||||
<IncludeBuildOutput>false</IncludeBuildOutput>
|
||||
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
|
||||
<IncludeSymbols>false</IncludeSymbols>
|
||||
<Description>MSBuild SDK for .NET projects with standardized build, analyzer, and editor configuration defaults.</Description>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -1 +1,22 @@
|
|||
# Geekeey.Arcade.Sdk
|
||||
# Geekeey.Arcade.NET.Sdk
|
||||
|
||||
Opinionated MSBuild SDKs for .NET projects with standardized build, analyzer, and editor configuration defaults:
|
||||
|
||||
- `Geekeey.Arcade.NET.Sdk` — base SDK
|
||||
- `Geekeey.Arcade.NET.Sdk.Web` — ASP.NET Core web projects
|
||||
- `Geekeey.Arcade.NET.Sdk.Test` — test projects
|
||||
|
||||
## Packaging metadata
|
||||
|
||||
Set these properties in your project file or a directory-level props file. Unless stated otherwise, defaults apply only when the property is empty.
|
||||
|
||||
| Property | Default | Description |
|
||||
| --- | --- | --- |
|
||||
| `Authors` | `The Geekeey Team` | Default authors when no value is set. |
|
||||
| `Copyright` | `Copyright (c) The Geekeey Team` | Default copyright when no value is set. |
|
||||
| `PublishRepositoryUrl` | `true` | Publishes the repository URL in packages. |
|
||||
| `IncludeSymbols` | `true` | Packs a symbol package. |
|
||||
| `SymbolPackageFormat` | `snupkg` | Format of the symbol package. |
|
||||
| `PackageReadmeFile` | `README.md` when found | Packs a README file from the project directory as the package readme. |
|
||||
| `SearchReadmeFileAbove` | `false` | When `true`, searches parent directories for a README to pack. |
|
||||
| `PackageLicenseFile` | Detected license file | Packs and declares a `LICENSE.txt`, `LICENSE.md` or `LICENSE` file found in the project directory or a parent directory. Skipped when the project sets `PackageLicenseExpression` or `PackageLicenseFile`. |
|
||||
|
|
|
|||
|
|
@ -18,11 +18,13 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="NuGet Package Info">
|
||||
<Authors>The Geekeey Team</Authors>
|
||||
<Copyright>Copyright (c) The Geekeey Team</Copyright>
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
<Authors Condition="'$(Authors)' == ''">The Geekeey Team</Authors>
|
||||
<Copyright Condition="'$(Copyright)' == ''">Copyright (c) The Geekeey Team</Copyright>
|
||||
|
||||
<PublishRepositoryUrl Condition="'$(PublishRepositoryUrl)' == ''">true</PublishRepositoryUrl>
|
||||
|
||||
<IncludeSymbols Condition="'$(IncludeSymbols)' == ''">true</IncludeSymbols>
|
||||
<SymbolPackageFormat Condition="'$(SymbolPackageFormat)' == ''">snupkg</SymbolPackageFormat>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
@ -38,7 +40,7 @@
|
|||
<PropertyGroup>
|
||||
<NuGetAudit>false</NuGetAudit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Audit)' == 'true'">
|
||||
<PropertyGroup Condition="'$(Audit)' != ''">
|
||||
<NuGetAudit>true</NuGetAudit>
|
||||
<NuGetAuditLevel>low</NuGetAuditLevel>
|
||||
<NuGetAuditMode>all</NuGetAuditMode>
|
||||
|
|
|
|||
|
|
@ -36,4 +36,38 @@
|
|||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!-- NuGet Package -->
|
||||
<PropertyGroup>
|
||||
<!-- Detect a README file in the project directory to pack as the package readme.
|
||||
Set 'SearchReadmeFileAbove' to 'true' to also search the parent directories. -->
|
||||
<_PackageReadmeFilePath Condition="'$(_PackageReadmeFilePath)' == '' AND Exists('$(MSBuildProjectDirectory)/README.md')">$(MSBuildProjectDirectory)/README.md</_PackageReadmeFilePath>
|
||||
<_PackageReadmeFilePath Condition="'$(_PackageReadmeFilePath)' == '' AND Exists('$(MSBuildProjectDirectory)/readme.md')">$(MSBuildProjectDirectory)/readme.md</_PackageReadmeFilePath>
|
||||
<_PackageReadmeFilePath Condition="'$(_PackageReadmeFilePath)' == '' AND Exists('$(MSBuildProjectDirectory)/Readme.md')">$(MSBuildProjectDirectory)/Readme.md</_PackageReadmeFilePath>
|
||||
<_PackageReadmeFilePath Condition="'$(_PackageReadmeFilePath)' == '' AND Exists('$(MSBuildProjectDirectory)/ReadMe.md')">$(MSBuildProjectDirectory)/ReadMe.md</_PackageReadmeFilePath>
|
||||
|
||||
<_PackageReadmeFilePath Condition="'$(SearchReadmeFileAbove)' == 'true' AND '$(_PackageReadmeFilePath)' == '' AND Exists($([MSBuild]::GetPathOfFileAbove('README.md', '$(MSBuildProjectDirectory)')))">$([MSBuild]::GetPathOfFileAbove('README.md', '$(MSBuildProjectDirectory)'))</_PackageReadmeFilePath>
|
||||
<_PackageReadmeFilePath Condition="'$(SearchReadmeFileAbove)' == 'true' AND '$(_PackageReadmeFilePath)' == '' AND Exists($([MSBuild]::GetPathOfFileAbove('readme.md', '$(MSBuildProjectDirectory)')))">$([MSBuild]::GetPathOfFileAbove('readme.md', '$(MSBuildProjectDirectory)'))</_PackageReadmeFilePath>
|
||||
<_PackageReadmeFilePath Condition="'$(SearchReadmeFileAbove)' == 'true' AND '$(_PackageReadmeFilePath)' == '' AND Exists($([MSBuild]::GetPathOfFileAbove('Readme.md', '$(MSBuildProjectDirectory)')))">$([MSBuild]::GetPathOfFileAbove('Readme.md', '$(MSBuildProjectDirectory)'))</_PackageReadmeFilePath>
|
||||
<_PackageReadmeFilePath Condition="'$(SearchReadmeFileAbove)' == 'true' AND '$(_PackageReadmeFilePath)' == '' AND Exists($([MSBuild]::GetPathOfFileAbove('ReadMe.md', '$(MSBuildProjectDirectory)')))">$([MSBuild]::GetPathOfFileAbove('ReadMe.md', '$(MSBuildProjectDirectory)'))</_PackageReadmeFilePath>
|
||||
|
||||
<_PackageThirdPartyNoticesPath Condition="'$(_PackageThirdPartyNoticesPath)' == '' AND Exists('$(MSBuildProjectDirectory)/THIRD-PARTY-NOTICES.TXT')">$(MSBuildProjectDirectory)/THIRD-PARTY-NOTICES.TXT</_PackageThirdPartyNoticesPath>
|
||||
<_PackageThirdPartyNoticesPath Condition="'$(_PackageThirdPartyNoticesPath)' == '' AND Exists('$(MSBuildProjectDirectory)/THIRD-PARTY-NOTICES.txt')">$(MSBuildProjectDirectory)/THIRD-PARTY-NOTICES.txt</_PackageThirdPartyNoticesPath>
|
||||
<_PackageThirdPartyNoticesPath Condition="'$(_PackageThirdPartyNoticesPath)' == '' AND Exists('$(MSBuildProjectDirectory)/THIRD-PARTY-NOTICES.MD')">$(MSBuildProjectDirectory)/THIRD-PARTY-NOTICES.MD</_PackageThirdPartyNoticesPath>
|
||||
<_PackageThirdPartyNoticesPath Condition="'$(_PackageThirdPartyNoticesPath)' == '' AND Exists('$(MSBuildProjectDirectory)/THIRD-PARTY-NOTICES.md')">$(MSBuildProjectDirectory)/THIRD-PARTY-NOTICES.md</_PackageThirdPartyNoticesPath>
|
||||
|
||||
<!-- Detect a license file in the project directory or a parent directory to pack with the package. -->
|
||||
<_LicensePath Condition="'$(_LicensePath)' == '' AND Exists($([MSBuild]::GetPathOfFileAbove('LICENSE.txt', '$(MSBuildProjectDirectory)')))">$([MSBuild]::GetPathOfFileAbove('LICENSE.txt', '$(MSBuildProjectDirectory)'))</_LicensePath>
|
||||
<_LicensePath Condition="'$(_LicensePath)' == '' AND Exists($([MSBuild]::GetPathOfFileAbove('LICENSE.md', '$(MSBuildProjectDirectory)')))">$([MSBuild]::GetPathOfFileAbove('LICENSE.md', '$(MSBuildProjectDirectory)'))</_LicensePath>
|
||||
<_LicensePath Condition="'$(_LicensePath)' == '' AND Exists($([MSBuild]::GetPathOfFileAbove('LICENSE', '$(MSBuildProjectDirectory)')))">$([MSBuild]::GetPathOfFileAbove('LICENSE', '$(MSBuildProjectDirectory)'))</_LicensePath>
|
||||
|
||||
<PackageReadmeFile Condition="'$(PackageReadmeFile)' == '' AND '$(_PackageReadmeFilePath)' != ''">README.md</PackageReadmeFile>
|
||||
<!-- Declare the detected license file in the nuspec, unless the project already declares a license expression or file -->
|
||||
<PackageLicenseFile Condition="'$(PackageLicenseFile)' == '' AND '$(PackageLicenseExpression)' == '' AND '$(_LicensePath)' != ''">$([System.IO.Path]::GetFileName($(_LicensePath)))</PackageLicenseFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="$(_PackageReadmeFilePath)" Pack="true" PackagePath="README.md" Condition="'$(_PackageReadmeFilePath)' != ''" />
|
||||
<None Include="$(_PackageThirdPartyNoticesPath)" Pack="true" PackagePath="" Condition="'$(_PackageThirdPartyNoticesPath)' != ''" />
|
||||
<None Include="$(_LicensePath)" Pack="true" PackagePath="" Visible="false" Condition="'$(_LicensePath)' != ''" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Reference in a new issue