System.Text.Json.targets 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. <Project>
  2. <Target Name="_System_Text_JsonGatherAnalyzers">
  3. <ItemGroup>
  4. <_System_Text_JsonAnalyzer Include="@(Analyzer)" Condition="'%(Analyzer.NuGetPackageId)' == 'System.Text.Json'" />
  5. </ItemGroup>
  6. </Target>
  7. <Target Name="_System_Text_JsonAnalyzerMultiTargeting"
  8. Condition="'$(SupportsRoslynComponentVersioning)' != 'true'"
  9. AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets"
  10. DependsOnTargets="_System_Text_JsonGatherAnalyzers">
  11. <ItemGroup>
  12. <!-- Remove our analyzers targeting roslyn4.x -->
  13. <Analyzer Remove="@(_System_Text_JsonAnalyzer)"
  14. Condition="$([System.String]::Copy('%(_System_Text_JsonAnalyzer.Identity)').IndexOf('roslyn4')) &gt;= 0"/>
  15. </ItemGroup>
  16. </Target>
  17. <Target Name="_System_Text_JsonRemoveAnalyzers"
  18. Condition="'$(DisableSystemTextJsonSourceGenerator)' == 'true'"
  19. AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets"
  20. DependsOnTargets="_System_Text_JsonGatherAnalyzers">
  21. <!-- Remove all our analyzers -->
  22. <ItemGroup>
  23. <Analyzer Remove="@(_System_Text_JsonAnalyzer)" />
  24. </ItemGroup>
  25. </Target>
  26. </Project>