1717 <GeneratedRulesetsDir >$(BaseOutputPath)Rulesets</GeneratedRulesetsDir >
1818 <GeneratedEditorconfigsDir >$(BaseOutputPath)Editorconfig</GeneratedEditorconfigsDir >
1919 <GeneratedGlobalAnalyzerConfigsDir >$(BaseOutputPath)GlobalAnalyzerConfigs</GeneratedGlobalAnalyzerConfigsDir >
20+ <GeneratedDocumentationDir >$(BaseOutputPath)Documentation</GeneratedDocumentationDir >
21+ <GeneratedSarifFilePath >$(GeneratedDocumentationDir)\$(PackageId).sarif</GeneratedSarifFilePath >
2022 <PackagePropsTargetsFileDir >$(BaseOutputPath)Build</PackagePropsTargetsFileDir >
2123 </PropertyGroup >
2224
25+ <ItemGroup >
26+ <PackageReference Include =" Microsoft.DotNet.Build.Tasks.Templating" PrivateAssets =" All" />
27+ </ItemGroup >
28+
2329 <ItemGroup >
2430 <AnalyzerNupkgAssembly Include =" Microsoft.CodeAnalysis.NetAnalyzers.dll" />
2531 <AnalyzerNupkgAssembly Include =" Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll" />
3238 <None Include =" README.md" Pack =" true" PackagePath =" /documentation" />
3339 <None Include =" ..\docs\Analyzer Configuration.md" Pack =" true" PackagePath =" /documentation" />
3440 <None Include =" $(PackageId).md" Pack =" true" PackagePath =" /documentation" />
35- <None Include =" $(PackageId).sarif " Pack =" true" PackagePath =" /documentation" />
41+ <None Include =" $(GeneratedSarifFilePath) " Pack =" true" PackagePath =" /documentation" Visible = " false " />
3642
3743 <None Include =" assets\install.ps1" Pack =" true" PackagePath =" /tools" />
3844 <None Include =" assets\uninstall.ps1" Pack =" true" PackagePath =" /tools" />
7480 <DisableNETAnalyzersPackagePropsFileName >DisableNETAnalyzersForNuGetPackage.props</DisableNETAnalyzersPackagePropsFileName >
7581 <AnalyzerDocumentationFileName >$(PackageId).md</AnalyzerDocumentationFileName >
7682 <AnalyzerSarifFileName >$(PackageId).sarif</AnalyzerSarifFileName >
83+ <AnalyzerSarifTemplateProperties >AnalyzerVersion=$(VersionPrefix)</AnalyzerSarifTemplateProperties >
7784 <AnalyzerConfigurationFileName >Analyzer Configuration.md</AnalyzerConfigurationFileName >
7885
7986 <!-- Only run validate only in CI builds. Running them in local builds will prevent refreshing auto-generated files. -->
8996 <_GenerateDocumentationAndConfigFilesPath >%(_GenerateDocumentationAndConfigFilesPath.Identity)</_GenerateDocumentationAndConfigFilesPath >
9097 </PropertyGroup >
9198
99+ <MakeDir Directories =" $(GeneratedDocumentationDir)" />
100+ <GenerateFileFromTemplate
101+ TemplateFile =" $(AnalyzerSarifFileDir)\$(AnalyzerSarifFileName)"
102+ Properties =" $(AnalyzerSarifTemplateProperties)"
103+ OutputPath =" $(GeneratedSarifFilePath)" />
104+
92105 <Exec Command =' "$(DotNetTool)" "$(_GenerateDocumentationAndConfigFilesPath)" "-validateOnly:$(ValidateOnlyFlag)" "$(GeneratedRulesetsDir)" "$(GeneratedEditorconfigsDir)" "$(GeneratedGlobalAnalyzerConfigsDir)" "$(ArtifactsBinDir)$(EscapeDirectorySuffix)" "$(Configuration)" "$(TargetFramework)" "@(AnalyzerNupkgAssembly)" "$(PackagePropsTargetsFileDir)" "$(PackagePropsFileName)" "$(PackagePropsTargetsFileDir)" "$(PackageTargetsFileName)" "$(DisableNETAnalyzersPackagePropsFileName)" "$(AnalyzerDocumentationFileDir)" "$(AnalyzerDocumentationFileName)" "$(AnalyzerSarifFileDir)" "$(AnalyzerSarifFileName)" "$(VersionPrefix)" $(PackageId) $(ContainsPortedFxCopRules) $(GenerateAnalyzerRulesMissingDocumentationFile) $(ReleaseTrackingOptOut) $(_ValidateOffline)' />
93106 </Target >
94107
95- </Project >
108+ </Project >
0 commit comments