diff options
Diffstat (limited to 'src/libraries/System.Text.Json')
3 files changed, 25 insertions, 0 deletions
diff --git a/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Roslyn4.0.cs b/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Roslyn4.0.cs index 8f4cd15e2df..1a7df0e821e 100644 --- a/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Roslyn4.0.cs +++ b/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Roslyn4.0.cs @@ -13,7 +13,9 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Text; +#if !ROSLYN4_4_OR_GREATER using Microsoft.CodeAnalysis.DotnetRuntime.Extensions; +#endif namespace System.Text.Json.SourceGeneration { @@ -27,7 +29,9 @@ namespace System.Text.Json.SourceGeneration { IncrementalValuesProvider<ClassDeclarationSyntax> classDeclarations = context.SyntaxProvider .ForAttributeWithMetadataName( +#if !ROSLYN4_4_OR_GREATER context, +#endif Parser.JsonSerializableAttributeFullName, (node, _) => node is ClassDeclarationSyntax, (context, _) => (ClassDeclarationSyntax)context.TargetNode); diff --git a/src/libraries/System.Text.Json/gen/System.Text.Json.SourceGeneration.Roslyn4.4.csproj b/src/libraries/System.Text.Json/gen/System.Text.Json.SourceGeneration.Roslyn4.4.csproj new file mode 100644 index 00000000000..c88568a7b52 --- /dev/null +++ b/src/libraries/System.Text.Json/gen/System.Text.Json.SourceGeneration.Roslyn4.4.csproj @@ -0,0 +1,20 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <AnalyzerRoslynVersion>4.4</AnalyzerRoslynVersion> + <RoslynApiVersion>$(MicrosoftCodeAnalysisVersion_4_X)</RoslynApiVersion> + <DefineConstants>$(DefineConstants);ROSLYN4_0_OR_GREATER;ROSLYN4_4_OR_GREATER</DefineConstants> + </PropertyGroup> + + <Import Project="System.Text.Json.SourceGeneration.targets" /> + + <ItemGroup> + <Compile Include="JsonSourceGenerator.Roslyn4.0.cs" /> + </ItemGroup> + + <ItemGroup> + <Compile Include="$(CoreLibSharedDir)System\Collections\Generic\ValueListBuilder.cs" Link="Production\ValueListBuilder.cs" /> + <Compile Include="$(CoreLibSharedDir)System\Collections\Generic\ValueListBuilder.Pop.cs" Link="Production\ValueListBuilder.Pop.cs" /> + </ItemGroup> + +</Project> diff --git a/src/libraries/System.Text.Json/src/System.Text.Json.csproj b/src/libraries/System.Text.Json/src/System.Text.Json.csproj index e17ce01c770..092d8ed2d93 100644 --- a/src/libraries/System.Text.Json/src/System.Text.Json.csproj +++ b/src/libraries/System.Text.Json/src/System.Text.Json.csproj @@ -384,5 +384,6 @@ The System.Text.Json library is built-in as part of the shared framework in .NET <ItemGroup> <AnalyzerReference Include="..\gen\System.Text.Json.SourceGeneration.Roslyn3.11.csproj" Pack="true" ReferenceAnalyzer="false" Condition="'$(DotNetBuildFromSource)' != 'true'" /> <AnalyzerReference Include="..\gen\System.Text.Json.SourceGeneration.Roslyn4.0.csproj" Pack="true" ReferenceAnalyzer="false" /> + <AnalyzerReference Include="..\gen\System.Text.Json.SourceGeneration.Roslyn4.4.csproj" Pack="true" ReferenceAnalyzer="false" /> </ItemGroup> </Project> |