зеркало из https://github.com/dotnet/msbuild.git
2d924ca8c2
Fixes #9915 Context #9789 added a template for custom analyzer. In order for that to be usable by our customers - we need to be publishing this to nuget feed along with our other binaries. So we should have the package produced from our repo - ideally as part of our build script Changes Made Create a template package project with property <GeneratePackageOnBuild>true</GeneratePackageOnBuild>that pack the templates into a nuget package when build. Add the package project in the msbuild solution in order to build the project. Testing https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=9602998&view=artifacts&pathAsName=false&type=publishedArtifacts in the packageArtifacts folder. image |
||
---|---|---|
.. | ||
.template.config | ||
Analyzer1.cs | ||
Company.AnalyzerTemplate.csproj | ||
Company.AnalyzerTemplate.props | ||
README.md |
README.md
MSBuild Custom Analyzer Template
Overview
MSBuild Custom Analyzer Template is a .NET template designed to streamline the creation of MSBuild analyzer libraries. This template facilitates the development of custom analyzers targeting .NET Standard, enabling developers to inspect and enforce conventions, standards, or patterns within their MSBuild builds.
Features
- Simplified template for creating MSBuild analyzer libraries.
- Targeting .NET Standard for cross-platform compatibility.
- Provides a starting point for implementing custom analysis rules.
Getting Started
To use the MSBuild Custom Analyzer Template, follow these steps:
- Install the template using the following command:
dotnet new install msbuildanalyzer
- Instantiate a custom template:
dotnet new msbuildanalyzer -n <ProjectName>
Prerequisites
- .NET SDK installed on your machine.