Centralized infrastructure elements for SixLabors projects. (msbuild, linting, shared internals)
Перейти к файлу
Stefan Nikolei cd97d9119b Update testproject to net8 and c# to 12 2023-12-01 13:18:08 +01:00
.github Update testproject to net8 and c# to 12 2023-12-01 13:18:08 +01:00
branding@e4597cdbe9 Update branding 2021-05-11 18:19:22 +01:00
msbuild Update testproject to net8 and c# to 12 2023-12-01 13:18:08 +01:00
src Add nullable annotation for NotNullOrWhiteSpace 2023-03-07 06:40:44 +01:00
tests Update testproject to net8 and c# to 12 2023-12-01 13:18:08 +01:00
.editorconfig Use File-Scoped namespaces and Implicit Global Usings 2022-09-15 10:15:45 +10:00
.gitattributes Update .gitattributes 2023-11-13 18:48:39 +08:00
.gitignore Use compiled result 2020-03-09 19:34:58 +11:00
.gitmodules Add branding for package icons 2020-01-16 20:11:36 +11:00
Directory.Build.props Add shared props/targets and update per rules 2020-11-30 18:38:17 +00:00
Directory.Build.targets Add shared props/targets and update per rules 2020-11-30 18:38:17 +00:00
LICENSE Update license in files. 2022-07-16 13:14:49 +10:00
README.md Fixed build status shield 2022-12-26 21:57:10 +01:00
SharedInfrastructure.sln Fix casing 2020-12-14 12:30:40 +00:00
SixLabors.snk Adding a strong name key file to support strong-name signing. 2019-05-28 09:03:50 -07:00
THIRD-PARTY-NOTICES.TXT Added Third Party Notices document 2020-06-18 18:17:35 +09:30
ci-build.ps1 Add CI + Tests 2020-09-01 21:36:31 +01:00
ci-test.ps1 Add CI + Tests 2020-09-01 21:36:31 +01:00
codecov.yml update library and config 2021-11-11 12:38:07 +11:00
sixlabors.ruleset Update sixlabors.ruleset 2022-09-06 23:16:55 +10:00
sixlabors.tests.ruleset Update license, lang-version and style config 2022-07-15 21:54:44 +10:00
stylecop.json Update license, lang-version and style config 2022-07-15 21:54:44 +10:00

README.md

SixLabors.SharedInfrastructure
SixLabors.SharedInfrastructure

Build Status Code coverage License: Six Labors Split

This repository contains:

  • Configuration and guidelines for automated linting of C# projects.
  • Standardized internal C# utility classes to be reused across SixLabors projects (like Guard, DebugGuard)
  • SixLabors.snk to support strong-name signing of SixLabors assemblies
  • Centralized msbuild configuration and utilities for SixLabors projects

It is designed to be installed as a git submodule into Six Labors solutions.

Installation.

This installation guide assumes that your solution conforms to the following structure:

solution.sln
readme.md
.gitignore
+---> src
+      +
+      +---> project
+      +   +
+      +   +---> project.csproj
+      +
+      +---> project
+          +
+          +---> project.csproj
+
+---> tests
       +
       +---> project.tests
       +   +
       +   +---> project.tests.csproj
       +
       +---> project.tests
           +
           +---> project.tests.csproj

If the solution does not conform to this structure you will have to update it to do so.

Adding the Submodule

To add SixLabors.SharedInfrastructure as a submodule of your project. In the project repository type:

git submodule add https://github.com/SixLabors/SharedInfrastructure shared-infrastructure

At this point, youll have a shared-infrastructure folder inside your project, but if you were to peek inside that folder, depending on your version of Git, you might see… nothing.

Newer versions of Git will do this automatically, but older versions will require you to explicitly tell Git to download the contents of shared-infrastructure:

git submodule update --init --recursive

If everything looks good, you can commit this change and youll have a shared-infrastructure folder in your project repository with all the content from the SixLabors.SharedInfrastructure repository.

Updating the Submodule.

Since the submodule is stored in a separate repository you may find at times updates have been made to the linting rules that require you to update your copy. The command below will allow you to do so:

git submodule update --init --recursive
git submodule foreach git pull origin main

Linting Tools

There are three tools contained within the submodule that will help to automatically promote and enforce coding standards and consistency:

These tools are automatically installed into your solution by referencing the .props and .targets files found in the /msbuild folder.

MsBuild

Within the aforementioned folder there are separate .props and .targets files designed for shared, src, and test scenarios. These files control the build process and are responsible for automatically referencing all the required projects for versioning, linting and testing. An example use case and installation can be found at the ImageSharp repository.