/DgmjrSdk

Primary LanguageC#OtherNOASSERTION

title authors type slug project description version lastmod date license keywords
DGMJR-IO SDK
dgmjr
readme
dgmjr-io-sdk
shared
The DGMJR-IO SDK is a collection of `.props` and `.targets` files that are used to build and package the DGMJR projects. It sets a whole boatload of default values and does a shit ton of stuff automagically.
0.0.1-Local
2023-07-14 07:49:58 UTC
2023-07-14 07:49:16 UTC
MIT
dotnet
sdk
dgmjrsdk
defaults
default-values

DGMJR-IO SDK

The DGMJR-IO SDK is a collection of .props and .targets files that are used to build and package the DGMJR projects. It sets a whole boatload of default values and does a shit ton of stuff automagically.

Getting Started

Put the following code in your Directory.Build.props file:

<Include Sdk="DgmjrSdk" File="Sdk.props" />

And put the following code in your Directory.Build.targets file:

<Include Sdk="DgmjrSdk" File="Sdk.targets" />

And make sure to add the following to your global.json file:

"msbuild-sdks":{
  "DgmjrSdk": "0.0.1" // (or the current package version)
}

Then compile and run your project and it will have all the DGMJR-IO SDK defaults. These include the following:

Item Definitions

  • Author - with Initials and Email metadata, which populate the Authors property of the MSBuild (and NuGet) project
  • Owner - with Initials and Email metadata, which populate the Owners and Copyright properties of the MSBuild (and NuGet) project
  • PackageTag - which concatenates all instances of it and populates the PackageTags property of the MSBuild (and NuGet) project
  • SourceCodeReference, which behaves just like a PackageReference except it just pulls the ContentFiles and Build assets from the package
  • SourceGenerator, which behaves just like a PackageReference except it just pulls the Analyzers and Build assets from the package
  • NoWarn, which adds all instances to the NoWarn property

Targets

  • EnsurePackageReadme, which ensures the package contains a README.md file at the root; if not, it generates one from the Title and Description properties and embeds it into the NuGet package
  • EnsurePackageIcon, which ensures the package contains an icon file; if theres no file named Icon.(png/jpg/jpeg) at the root, it will use a default icon
  • RemoveDuplicateUsings, which removes any duplicate Using items from the project
  • RemoveDuplicatePackageReferences, which removes any duplicate Using items from the project
  • PackageProjectName.targets - a file that packages any file in the root directory named [MSBuildProjectName].targets into the build folder of the NuGet package
  • PackageProjectName.props - a file that packages any file in the root directory named [MSBuildProjectName].props into the build folder of the NuGet package

Properties

  • PackageVersionOverride, which allows you to override the package version calculated by MinVer
  • A default UserSecrets property
  • Default AssetTargetFallbacks for all .NET versions from .NETStandard 2.0 through .NET 8.0
  • Default values for generating XML documentation as well as pulling the XML docs from referenced packages
  • All Include[Whatever]OutputGroup properties set to true
  • JustInTimeVersioning enabled
  • NuGetPush enabled

Miscellaneous

  • Assembly signing - ensures the assembly is signed by a key called dgmjr.snk located in the Assets folder. There's also dgmjr.pub (the binary version of the public key) and dgmjr.pub.asc, which contains the plain text public key and token.
  • TestingLocal - Overrides the AssemblyVersion attribute to always be 0.0.1-Local when the Configuration is set to Local
  • Icon.png, a default icon file, which will be applied to any package that doesn't have one.
  • NuGetizer enabled by default