Skip to content

Commit 2d924ca

Browse files
authored
pack template for custom analyzer (#10155)
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
1 parent d11496b commit 2d924ca

File tree

8 files changed

+65
-1
lines changed

8 files changed

+65
-1
lines changed

MSBuild.sln

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Build.UnitTests.S
8282
EndProject
8383
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Build.BuildCheck.UnitTests", "src\BuildCheck.UnitTests\Microsoft.Build.BuildCheck.UnitTests.csproj", "{434CC6DB-1E66-4FB1-A66C-D5BBE99F0ED8}"
8484
EndProject
85+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Build.Templates", "template_feed\Microsoft.Build.Templates.csproj", "{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}"
86+
EndProject
8587
Global
8688
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8789
Debug|Any CPU = Debug|Any CPU
@@ -890,6 +892,30 @@ Global
890892
{434CC6DB-1E66-4FB1-A66C-D5BBE99F0ED8}.Release|x64.Build.0 = Release|x64
891893
{434CC6DB-1E66-4FB1-A66C-D5BBE99F0ED8}.Release|x86.ActiveCfg = Release|Any CPU
892894
{434CC6DB-1E66-4FB1-A66C-D5BBE99F0ED8}.Release|x86.Build.0 = Release|Any CPU
895+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
896+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
897+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Debug|ARM64.ActiveCfg = Debug|Any CPU
898+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Debug|ARM64.Build.0 = Debug|Any CPU
899+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Debug|x64.ActiveCfg = Debug|Any CPU
900+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Debug|x64.Build.0 = Debug|Any CPU
901+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Debug|x86.ActiveCfg = Debug|Any CPU
902+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Debug|x86.Build.0 = Debug|Any CPU
903+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.MachineIndependent|Any CPU.ActiveCfg = MachineIndependent|Any CPU
904+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.MachineIndependent|Any CPU.Build.0 = MachineIndependent|Any CPU
905+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.MachineIndependent|ARM64.ActiveCfg = MachineIndependent|Any CPU
906+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.MachineIndependent|ARM64.Build.0 = MachineIndependent|Any CPU
907+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.MachineIndependent|x64.ActiveCfg = MachineIndependent|Any CPU
908+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.MachineIndependent|x64.Build.0 = MachineIndependent|Any CPU
909+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.MachineIndependent|x86.ActiveCfg = MachineIndependent|Any CPU
910+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.MachineIndependent|x86.Build.0 = MachineIndependent|Any CPU
911+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
912+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Release|Any CPU.Build.0 = Release|Any CPU
913+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Release|ARM64.ActiveCfg = Release|Any CPU
914+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Release|ARM64.Build.0 = Release|Any CPU
915+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Release|x64.ActiveCfg = Release|Any CPU
916+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Release|x64.Build.0 = Release|Any CPU
917+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Release|x86.ActiveCfg = Release|Any CPU
918+
{A86EE74A-AEF0-42ED-A5A7-7A54BC0773D8}.Release|x86.Build.0 = Release|Any CPU
893919
EndGlobalSection
894920
GlobalSection(SolutionProperties) = preSolution
895921
HideSolutionNode = FALSE
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<PackageId>Microsoft.Build.Templates</PackageId>
5+
<Authors>Microsoft</Authors>
6+
<Description>Common Microsoft Build Templates</Description>
7+
<PackageProjectUrl>https://github.com/dotnet/msbuild</PackageProjectUrl>
8+
<PackageType>Template</PackageType>
9+
<TargetFramework>$(LatestDotNetCoreForMSBuild)</TargetFramework>
10+
<IncludeBuildOutput>false</IncludeBuildOutput>
11+
<NoWarn>$(NoWarn);NU5128</NoWarn>
12+
<IsPackable>true</IsPackable>
13+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
14+
</PropertyGroup>
15+
16+
<PropertyGroup>
17+
<LocalizeTemplates>false</LocalizeTemplates>
18+
</PropertyGroup>
19+
20+
<ItemGroup>
21+
<PackageReference Include="Microsoft.TemplateEngine.Tasks" Version="*" PrivateAssets="all" IsImplicitlyDefined="true"/>
22+
</ItemGroup>
23+
24+
<ItemGroup>
25+
<Content Include="content\**" Exclude="content\**\bin\**;content\**\obj\**" PackagePath="content"/>
26+
<Compile Remove="**\*" />
27+
</ItemGroup>
28+
29+
</Project>

template_feed/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## MSBuild Custom Analyzer Template Package
2+
3+
The package contains the template designed to streamline the creation of MSBuild analyzer libraries.
4+
| Template name | Short name | Description|
5+
|---|---|---|
6+
|MSBuild Custom Analyzer Template|`msbuildanalyzer`|A project for creating a MSBuild analyzer library that targets .NET Standard.|
7+
8+
The package is available for download from nuget.org.
9+
Please feel to contribute or provide the feedback in discussions or via opening the issue in dotnet/msbuild repo.

template_feed/Microsoft.AnalyzerTemplate/.template.config/template.json renamed to template_feed/content/Microsoft.AnalyzerTemplate/.template.config/template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@
4646
"continueOnError": true
4747
}
4848
]
49-
}
49+
}
File renamed without changes.

0 commit comments

Comments
 (0)