Update shared .targets to also pack code fixer projects
このコミットが含まれているのは:
1 親
afb467f1ff
コミット
a426bb74d7
1ファイル変更
+23
-1
@@ -2,11 +2,18 @@
|
||||
<Project>
|
||||
<Import Project="..\build\Directory.Build.targets" />
|
||||
|
||||
<!-- Check whether there is a source generator that should be packed with the project -->
|
||||
<!-- Check whether any analyzers are available for packing -->
|
||||
<PropertyGroup Condition="$(IsPackagedProject)">
|
||||
|
||||
<!-- Source generator project, if available -->
|
||||
<IsSourceGeneratorAvailableForPacking>false</IsSourceGeneratorAvailableForPacking>
|
||||
<IsSourceGeneratorAvailableForPacking Condition="Exists('..\$(MSBuildProjectName).SourceGenerators')">true</IsSourceGeneratorAvailableForPacking>
|
||||
<SourceGeneratorReferenceTargetFramework Condition="$(IsSourceGeneratorAvailableForPacking)">$(TargetFrameworks.Split(';')[0].Trim())</SourceGeneratorReferenceTargetFramework>
|
||||
|
||||
<!-- Code fixers project, if available -->
|
||||
<IsCodeFixersAvailableForPacking>false</IsCodeFixersAvailableForPacking>
|
||||
<IsCodeFixersAvailableForPacking Condition="Exists('..\$(MSBuildProjectName).CodeFixers')">true</IsCodeFixersAvailableForPacking>
|
||||
<CodeFixersReferenceTargetFramework Condition="$(IsCodeFixersAvailableForPacking)">$(TargetFrameworks.Split(';')[0].Trim())</CodeFixersReferenceTargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Pack the source generator, if present -->
|
||||
@@ -24,6 +31,21 @@
|
||||
Visible="false" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Pack the code fixers, if present -->
|
||||
<ItemGroup Condition="'$(IsCodeFixersAvailableForPacking)' == 'true'" Label="Package">
|
||||
|
||||
<!-- Code fixers reference (to trigger building the project) -->
|
||||
<ProjectReference Condition="'$(TargetFramework)' == '$(CodeFixersReferenceTargetFramework)'"
|
||||
Include="..\$(MSBuildProjectName).CodeFixers\$(MSBuildProjectName).CodeFixers.csproj"
|
||||
ReferenceOutputAssembly="false" />
|
||||
|
||||
<!-- Pack the code fixers project from its output directory -->
|
||||
<None Include="..\$(MSBuildProjectName).CodeFixers\bin\$(Configuration)\$(CodeFixersReferenceTargetFramework)\$(MSBuildProjectName).CodeFixers.dll"
|
||||
PackagePath="analyzers\dotnet\cs"
|
||||
Pack="true"
|
||||
Visible="false" />
|
||||
</ItemGroup>
|
||||
|
||||
<!--
|
||||
Enable trimming support on .NET 6 (we need to use StartsWith since it
|
||||
could be a Windows TFM too). This can't be in a target unlike the other
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする