Skip to content

Commit

Permalink
Replace platform's Logging source generator (#4238)
Browse files Browse the repository at this point in the history
  • Loading branch information
joperezr authored Aug 4, 2023
1 parent 6163ce2 commit 60800f8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions eng/MSBuild/Packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<_NETStandardCompatErrorFileTarget>NETStandardCompatError_$(PackageId.Replace('.', '_'))_$([System.String]::new('%(NETStandardCompatError.Supported)').Replace('.', '_'))</_NETStandardCompatErrorFileTarget>
<_NETStandardCompatErrorFileContent>
<![CDATA[<Project InitialTargets="$(_NETStandardCompatErrorFileTarget)">
$(_AdditionalNETStandardCompatErrorFileContents)
<Target Name="$(_NETStandardCompatErrorFileTarget)"
Condition="'%24(SuppressTfmSupportBuildWarnings)' == ''">
<Warning Text="$(PackageId) $(PackageVersion) doesn't support %24(TargetFramework) and has not been tested with it. Consider upgrading your TargetFramework to %(NETStandardCompatError.Supported) or later. You may also set &lt%3BSuppressTfmSupportBuildWarnings&gt%3Btrue&lt%3B/SuppressTfmSupportBuildWarnings&gt%3B in the project file to ignore this warning and attempt to run in this unsupported configuration at your own risk." />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,22 @@
</ItemGroup>

<ItemGroup>
<None Include="buildTransitive\*" CopyToOutputDirectory="PreserveNewest" Pack="true" PackagePath="buildTransitive\" />
<None Include="buildTransitive\**\*" CopyToOutputDirectory="PreserveNewest" Pack="true" PackagePath="buildTransitive\%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<!-- In netcoreapp3.1 and net462 TFMs we automatically add package buildtransitive target files, so we need to Include
the code that will disable the Microsoft.Extensions.Logging.Abstractions source generator. -->
<PropertyGroup>
<_AdditionalNETStandardCompatErrorFileContents>
<![CDATA[
<!-- This package should replace the Microsoft.Extensions.Logging.Abstractions source generator, so we set the property to remove the source generator from the project. -->
<PropertyGroup>
<DisableMicrosoftExtensionsLoggingSourceGenerator>true</DisableMicrosoftExtensionsLoggingSourceGenerator>
</PropertyGroup>
]]>
</_AdditionalNETStandardCompatErrorFileContents>
</PropertyGroup>

<ItemGroup>
<AnalyzerReference Include="..\..\Generators\Microsoft.Gen.Logging\Microsoft.Gen.Logging.csproj" />
<AnalyzerReference Include="..\..\Generators\Microsoft.Gen.Metering\Microsoft.Gen.Metering.csproj" />
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- This package should replace the Microsoft.Extensions.Logging.Abstractions source generator, so we set the property to remove the source generator from the project. -->
<PropertyGroup>
<DisableMicrosoftExtensionsLoggingSourceGenerator>true</DisableMicrosoftExtensionsLoggingSourceGenerator>
</PropertyGroup>
</Project>

0 comments on commit 60800f8

Please sign in to comment.