feat(sdk): integrate NuGet packaging metadata defaults

This commit is contained in:
Louis Seubert 2026-10-19 18:27:59 +02:00
commit cf08e29397
8 changed files with 73 additions and 25 deletions

View file

@ -1,23 +1,7 @@
<Project> <Project>
<Import Project="$(MSBuildThisFileDirectory)src/sdk/common/Common.props" />
<PropertyGroup> <PropertyGroup>
<ArtifactsPath>$(MSBuildThisFileDirectory)artifacts</ArtifactsPath> <ArtifactsPath>$(MSBuildThisFileDirectory)artifacts</ArtifactsPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<AnalysisMode>Recommended</AnalysisMode>
<AnalysisLevel>latest</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<WarningsAsErrors>nullable</WarningsAsErrors>
<TreatWarningsAsErrors Condition="'$(CI)' != ''">true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<NuGetAuditLevel>moderate</NuGetAuditLevel>
<NuGetAuditMode>all</NuGetAuditMode>
</PropertyGroup>
</Project> </Project>

View file

@ -1,2 +1,3 @@
<Project> <Project>
<Import Project="$(MSBuildThisFileDirectory)src/sdk/common/Common.targets" />
</Project> </Project>

View file

@ -4,6 +4,8 @@
<NoBuild>true</NoBuild> <NoBuild>true</NoBuild>
<IncludeBuildOutput>false</IncludeBuildOutput> <IncludeBuildOutput>false</IncludeBuildOutput>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<IncludeSymbols>false</IncludeSymbols>
<Description>MSBuild SDK for test projects with standardized build, analyzer, and editor configuration defaults.</Description>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View file

@ -4,6 +4,8 @@
<NoBuild>true</NoBuild> <NoBuild>true</NoBuild>
<IncludeBuildOutput>false</IncludeBuildOutput> <IncludeBuildOutput>false</IncludeBuildOutput>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> <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> </PropertyGroup>
<ItemGroup> <ItemGroup>

View file

@ -4,6 +4,8 @@
<NoBuild>true</NoBuild> <NoBuild>true</NoBuild>
<IncludeBuildOutput>false</IncludeBuildOutput> <IncludeBuildOutput>false</IncludeBuildOutput>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<IncludeSymbols>false</IncludeSymbols>
<Description>MSBuild SDK for .NET projects with standardized build, analyzer, and editor configuration defaults.</Description>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View file

@ -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`. |

View file

@ -18,11 +18,13 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="NuGet Package Info"> <PropertyGroup Label="NuGet Package Info">
<Authors>The Geekeey Team</Authors> <Authors Condition="'$(Authors)' == ''">The Geekeey Team</Authors>
<Copyright>Copyright (c) The Geekeey Team</Copyright> <Copyright Condition="'$(Copyright)' == ''">Copyright (c) The Geekeey Team</Copyright>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols> <PublishRepositoryUrl Condition="'$(PublishRepositoryUrl)' == ''">true</PublishRepositoryUrl>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSymbols Condition="'$(IncludeSymbols)' == ''">true</IncludeSymbols>
<SymbolPackageFormat Condition="'$(SymbolPackageFormat)' == ''">snupkg</SymbolPackageFormat>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
@ -38,7 +40,7 @@
<PropertyGroup> <PropertyGroup>
<NuGetAudit>false</NuGetAudit> <NuGetAudit>false</NuGetAudit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Audit)' == 'true'"> <PropertyGroup Condition="'$(Audit)' != ''">
<NuGetAudit>true</NuGetAudit> <NuGetAudit>true</NuGetAudit>
<NuGetAuditLevel>low</NuGetAuditLevel> <NuGetAuditLevel>low</NuGetAuditLevel>
<NuGetAuditMode>all</NuGetAuditMode> <NuGetAuditMode>all</NuGetAuditMode>

View file

@ -36,4 +36,38 @@
</ItemGroup> </ItemGroup>
</Target> </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> </Project>