![]() |
VOOZH | about |
dotnet add package Aksio.Defaults.Specs --version 1.6.10
NuGet\Install-Package Aksio.Defaults.Specs -Version 1.6.10
<PackageReference Include="Aksio.Defaults.Specs" Version="1.6.10" />
<PackageVersion Include="Aksio.Defaults.Specs" Version="1.6.10" />Directory.Packages.props
<PackageReference Include="Aksio.Defaults.Specs" />Project file
paket add Aksio.Defaults.Specs --version 1.6.10
#r "nuget: Aksio.Defaults.Specs, 1.6.10"
#:package Aksio.Defaults.Specs@1.6.10
#addin nuget:?package=Aksio.Defaults.Specs&version=1.6.10Install as a Cake Addin
#tool nuget:?package=Aksio.Defaults.Specs&version=1.6.10Install as a Cake Tool
This repository contains the default setup for projects with properties for how they should build and also static code analysis for projects. It contains custom rules and the default rule-sets with the tuned rules we care about.
Read more about the custom analyzers .
In your project all you need is to add a PackageReference to the package.
The dotnet tool-chain will during build include any .props or .targets files found in the package by convention.
From the .props file you'll get a lot of default configuration set up, it will put in package information saying it is an Aksio package
and all the defaults of Aksio. This can be overridden if you're only interested in parts of the configuration.
If you're using an IDE such as Visual Studio, add a reference to the Aksio.Defaults package from the UI.
If you're using the dotnet tool you add the reference by doing the following from your terminal:
$ dotnet add package Aksio.Defaults
Or manually add the following to your .csproj - obviously for good measure,
you should just add the <PackageReference> inside an existing <ItemGroup>
with package references.
<ItemGroup>
<PackageReference Include="Aksio.Defaults" Version="1.*" PrivateAssets="All"/>
</ItemGroup>
Note: The
PrivateAssets="All"is important to not let the rules and setup affect any consumer of your package.
By using a wildcard for minor in the version of the packages, you're guaranteed to have the latest of the package.
For your spec projects there is a second package with specific rules for that context as we tend to write the
specs differently; Aksio.Defaults.Specs.
This project relies heavily on MSBuild and its capabilities. It leverages both reserved well known properties and common project properties. It takes advantage of a feature in MSBuild that by convention will include props from a file named the same as its package name in any consumers. In our case this is the and .
The props files configures a default behavior for builds with a and . In addition to this it provides a set of default NuGet metadata properties to ease the creation of projects that are to be published as NuGet packages.
Read more about the ruleset format and the default rulset. In addition, we leverage a 3rd party ruleset - read more about the different rules here.
This repository also adds custom Aksio rules. Read the on the different rules.
With the introduction of Global AnalyserConfig one can
take typical things one would hav ein .editorconfig files and package for reuse. This project does so as well by adding a global editorconfig.
For examples on how these can be set up look here or here.
The default behavior of the static code analysis is to have it disabled while building with the Debug Configuration. Typically for CI/CD pipelines we run in Release and will therefor run all rules there.
If one wants to check things before committing or finalizing a pull request for instance, one could run the build with Release configuration
$ dotnet build --configuration Release
You can still enable the static code analysis rules by adding the following PropertyGroup to your .csproj or Directory.Build.props file:
<PropertyGroup>
<RunAnalyzers>True</RunAnalyzers>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<MSBuildTreatWarningsAsErrors>True</MSBuildTreatWarningsAsErrors>
</PropertyGroup>
Note: It is also possible to run this command as a Git Hook either on commit, pre-push or pre-receive for instance, read more here. Since most hooks run on the client and is not configured for the repository, its harder to share in a team. Recommend reading this.
NuGet packages that are published on the public NuGet feed should adhere to the defined best practices. The default props file puts in most of the metadata, but some of it is specific to each project and should be included specifically in the .csproj or Directory.Build.props.
Add the following properties and configure them according to your project:
<PropertyGroup>
<IsPackable>true</IsPackable>
<RepositoryUrl>https://github.com/aksio-system/{repository}</RepositoryUrl>
<PackageProjectUrl>https://github.com/aksio-system/{repository}</PackageProjectUrl>
</PropertyGroup>
In addition you might want to include the README file of your project. Add the following with the correct relative filepath to the README file:
<PropertyGroup>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<Content Include="../README.md" PackagePath="/" />
</ItemGroup>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.6.10 | 16,422 | 5/11/2023 |
| 1.6.9 | 236 | 5/11/2023 |
| 1.6.8 | 2,229 | 10/14/2022 |
| 1.6.7 | 284 | 9/30/2022 |
| 1.6.6 | 509 | 9/6/2022 |
| 1.6.6-pr83.33f98e0 | 246 | 9/30/2022 |
| 1.6.5 | 269 | 9/6/2022 |
| 1.6.4 | 505 | 5/24/2022 |
| 1.6.3 | 359 | 5/4/2022 |
| 1.6.2 | 298 | 5/4/2022 |
| 1.6.1 | 296 | 5/4/2022 |
| 1.6.0 | 301 | 5/4/2022 |
| 1.5.15 | 323 | 4/24/2022 |
| 1.5.14 | 293 | 4/18/2022 |
| 1.5.13 | 304 | 4/18/2022 |
| 1.5.12 | 288 | 4/17/2022 |
| 1.5.11 | 308 | 4/16/2022 |
| 1.5.10 | 449 | 3/25/2022 |
| 1.5.9 | 290 | 3/25/2022 |
| 1.5.8 | 349 | 1/15/2022 |