Skip to content

Commit

Permalink
Added Support for .NET 8 (#6366)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib authored Jul 20, 2023
1 parent b4c3ac0 commit dcf3f24
Show file tree
Hide file tree
Showing 716 changed files with 40,167 additions and 63 deletions.
3 changes: 3 additions & 0 deletions .build/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": ".build.sln"
}
25 changes: 25 additions & 0 deletions .build/Build.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "Build.csproj", "{3E8AEEC4-1691-4805-9F95-15AD8A4FCF41}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3E8AEEC4-1691-4805-9F95-15AD8A4FCF41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E8AEEC4-1691-4805-9F95-15AD8A4FCF41}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E8AEEC4-1691-4805-9F95-15AD8A4FCF41}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E8AEEC4-1691-4805-9F95-15AD8A4FCF41}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E88D3310-24EA-464B-9CBF-790DAF088AE9}
EndGlobalSection
EndGlobal
6 changes: 4 additions & 2 deletions .build/Helpers.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Net;
using System;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -52,7 +53,8 @@ static IEnumerable<string> GetAllProjects(
if (!(include?.Invoke(file) ?? true)
|| file.Contains("benchmark", StringComparison.OrdinalIgnoreCase)
|| file.Contains("demo", StringComparison.OrdinalIgnoreCase)
|| file.Contains("sample", StringComparison.OrdinalIgnoreCase))
|| file.Contains("sample", StringComparison.OrdinalIgnoreCase)
|| file.Contains("examples", StringComparison.OrdinalIgnoreCase))
{
continue;
}
Expand All @@ -73,7 +75,7 @@ public static IReadOnlyCollection<Output> DotNetBuildSonarSolution(

directories ??= Directories;

IEnumerable<string> projects = GetAllProjects(Path.GetDirectoryName(solutionFile), directories, include);
var projects = GetAllProjects(Path.GetDirectoryName(solutionFile), directories, include);
var workingDirectory = Path.GetDirectoryName(solutionFile);
var list = new List<Output>();

Expand Down
20 changes: 0 additions & 20 deletions .devops/azure-pipelines.release-hotchocolate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,6 @@ stages:
displayName: "Pack"
dependsOn: []
steps:
- task: DeleteFiles@1
displayName: "Clean AspNetCore resources"
inputs:
SourceFolder: './src/HotChocolate/AspNetCore/src/AspNetCore/Resources'
Contents: '**/*'
RemoveDotFiles: true
- task: DownloadPipelineArtifact@2
displayName: "Integrate Banana Cake pop"
inputs:
buildType: 'specific'
project: 'aefb2b59-b7d8-48cf-8cb0-30fdea720770'
definition: '84'
buildVersionToDownload: 'latest'
artifactName: 'WebApp'
targetPath: './src/HotChocolate/AspNetCore/src/AspNetCore/Resources'
- task: PublishBuildArtifacts@1
displayName: "Upload AspNetCore Code"
inputs:
artifactName: aspnetcore
pathtoPublish: "./src/HotChocolate/AspNetCore/src/AspNetCore"
- task: CmdLine@2
displayName: "Create Packages"
inputs:
Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ else
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "3.1.424" --no-path
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "5.0.408" --no-path
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "6.0.402" --no-path
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "7.0.306" --no-path

# If global.json exists, load expected version
if [[ -f "$DOTNET_GLOBAL_FILE" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "7.0.100"
"version": "8.0.100-preview.6.23330.14"
}
}
2 changes: 1 addition & 1 deletion src/CookieCrumble/src/CookieCrumble/CookieCrumble.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<ProjectReference Include="..\..\..\HotChocolate\AspNetCore\src\Transport.Abstractions\HotChocolate.Transport.Abstractions.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net8.0'">
<ProjectReference Include="..\..\..\HotChocolate\Fusion\src\Core\HotChocolate.Fusion.csproj" />
</ItemGroup>

Expand Down
5 changes: 5 additions & 0 deletions src/CookieCrumble/src/CookieCrumble/TestEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ public static class TestEnvironment
/// The target framework identifier.
/// </summary>
public const string TargetFramework = "NET7_0";
#elif NET8_0
/// <summary>
/// The target framework identifier.
/// </summary>
public const string TargetFramework = "NET8_0";
#endif
}
13 changes: 7 additions & 6 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@
</PropertyGroup>

<PropertyGroup>
<LibraryTargetFrameworks>net7.0; net6.0; netstandard2.0</LibraryTargetFrameworks>
<Library2TargetFrameworks>net7.0; net6.0</Library2TargetFrameworks>
<TestTargetFrameworks>net7.0; net6.0</TestTargetFrameworks>
<AspNetTargetFrameworks>net7.0; net6.0</AspNetTargetFrameworks>
<LibraryTargetFrameworks>net8.0; net7.0; net6.0; netstandard2.0</LibraryTargetFrameworks>
<Library2TargetFrameworks>net8.0; net7.0; net6.0</Library2TargetFrameworks>
<Library3TargetFrameworks>net8.0; net7.0</Library3TargetFrameworks>
<TestTargetFrameworks>net8.0; net7.0; net6.0</TestTargetFrameworks>
<AspNetTargetFrameworks>net8.0; net7.0; net6.0</AspNetTargetFrameworks>
<AzfTargetFrameworks>net7.0; net6.0</AzfTargetFrameworks>
<AzfIsoProcTargetFrameworks>net7.0; net6.0</AzfIsoProcTargetFrameworks>
<SourceGenTargetFrameworks>net7.0; net6.0; netstandard2.0</SourceGenTargetFrameworks>
<AzfIsoProcTargetFrameworks>net8.0; net7.0; net6.0</AzfIsoProcTargetFrameworks>
<SourceGenTargetFrameworks>netstandard2.0</SourceGenTargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/HotChocolate/AspNetCore/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": "HotChocolate.AspNetCore.sln"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ public GraphQLRequestException(IEnumerable<IError> errors)
{
}

#if NET8_0_OR_GREATER
[Obsolete(
"This API supports obsolete formatter-based serialization. " +
"It should not be called or extended by application code.",
true)]
#endif
protected GraphQLRequestException(
SerializationInfo info,
StreamingContext context)
Expand Down
1 change: 1 addition & 0 deletions src/HotChocolate/AspNetCore/test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.7" Condition="'$(TargetFramework)' == 'net6.0'"/>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.0" Condition="'$(TargetFramework)' == 'net7.0'"/>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0-preview.6.23329.11" Condition="'$(TargetFramework)' == 'net8.0'"/>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
7 changes: 6 additions & 1 deletion src/HotChocolate/Caching/test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@
<Warn>0</Warn>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0-preview.6.23329.7" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0-preview.6.23329.11" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net7.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ public QueryException(IEnumerable<IError> errors)
{
}

#if NET8_0_OR_GREATER
[Obsolete(
"This API supports obsolete formatter-based serialization. " +
"It should not be called or extended by application code.",
true)]
#endif
protected QueryException(
SerializationInfo info,
StreamingContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
namespace HotChocolate.Execution;

[Serializable]
public class QueryRequestBuilderException
: Exception
public class QueryRequestBuilderException : Exception
{
public QueryRequestBuilderException() { }

public QueryRequestBuilderException(string message)
: base(message) { }

public QueryRequestBuilderException(string message, Exception inner)
: base(message, inner) { }

#if NET8_0_OR_GREATER
[Obsolete(
"This API supports obsolete formatter-based serialization. " +
"It should not be called or extended by application code.",
true)]
#endif
protected QueryRequestBuilderException(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context)
Expand Down
6 changes: 6 additions & 0 deletions src/HotChocolate/Core/src/Abstractions/GraphQLException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public GraphQLException(string message, Exception innerException)
};
}

#if NET8_0_OR_GREATER
[Obsolete(
"This API supports obsolete formatter-based serialization. " +
"It should not be called or extended by application code.",
true)]
#endif
protected GraphQLException(
SerializationInfo info,
StreamingContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ public IdSerializationException(
{
}

#if NET8_0_OR_GREATER
[Obsolete(
"This API supports obsolete formatter-based serialization. " +
"It should not be called or extended by application code.",
true)]
#endif
protected IdSerializationException(
SerializationInfo info,
StreamingContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<AssemblyName>HotChocolate.Subscriptions.Nats.Tests</AssemblyName>
<RootNamespace>HotChocolate.Subscriptions.Nats</RootNamespace>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand All @@ -12,7 +11,7 @@
<ProjectReference Include="..\Subscriptions.Tests\HotChocolate.Subscriptions.Tests.csproj" />
<ProjectReference Include="..\Utilities\HotChocolate.Tests.Utilities.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="$(MSBuildProjectDirectory)\__resources__\*.*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand All @@ -21,7 +20,7 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Squadron.Nats" Version="0.18.0-preview.6" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0-preview.6.23329.4" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Properties\EntityFrameworkResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,11 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0-preview.6.23329.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0-preview.6.23329.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.0-preview.6.23329.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0-preview.6.23329.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.0-preview.6.23329.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0-preview.6.23329.4" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Properties\EfResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0-preview.6.23329.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.0-preview.6.23329.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0-preview.6.23329.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
true Result:
---------------
{
"data": {
"root": [
{
"bar": true
}
]
}
}
---------------

true SQL:
---------------
.param set @__p_0 1

SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
WHERE "d"."Bar" = @__p_0
---------------

false Result:
---------------
{
"data": {
"root": [
{
"bar": false
}
]
}
}
---------------

false SQL:
---------------
.param set @__p_0 0

SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
WHERE "d"."Bar" = @__p_0
---------------
Loading

0 comments on commit dcf3f24

Please sign in to comment.