Skip to content

Commit

Permalink
Added support for .NET 6 SDK (#4345)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib authored Oct 26, 2021
1 parent db8d3a2 commit 71fdf09
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 781 deletions.
2 changes: 1 addition & 1 deletion .build/Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
Expand Down
762 changes: 0 additions & 762 deletions .nuke/temp/All.Test.sln

This file was deleted.

9 changes: 6 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
###########################################################################

BUILD_PROJECT_FILE="$SCRIPT_DIR/.build/Build.csproj"
TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp"
TEMP_DIRECTORY="$SCRIPT_DIR/.nuke/temp"

DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh"
Expand Down Expand Up @@ -38,8 +38,12 @@ else
curl -Lsfo "$DOTNET_INSTALL_FILE" "$DOTNET_INSTALL_URL"
chmod +x "$DOTNET_INSTALL_FILE"

DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix"

# install older frameworks for tests
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "2.1.816" --no-path
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "3.1.409" --no-path
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "5.0.401" --no-path

# If global.json exists, load expected version
if [[ -f "$DOTNET_GLOBAL_FILE" ]]; then
Expand All @@ -50,7 +54,6 @@ else
fi

# Install by channel or version
DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix"
if [[ -z ${DOTNET_VERSION+x} ]]; then
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --channel "$DOTNET_CHANNEL" --no-path
else
Expand All @@ -62,4 +65,4 @@ fi
echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)"

"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"
"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "5.0.300",
"version": "6.0.100-rc.2.21505.57",
"rollForward": "latestMinor"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private async Task HandleRequestAsync(HttpContext context)
{
// in any case we will have a valid GraphQL result at this point that can be written
// to the HTTP response stream.
Debug.Assert(result is not null!, "No GraphQL result was created.");
Debug.Assert(result is not null, "No GraphQL result was created.");
await WriteResultAsync(context.Response, result, statusCode,
context.RequestAborted);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected async Task HandleRequestAsync(
{
// in any case we will have a valid GraphQL result at this point that can be written
// to the HTTP response stream.
Debug.Assert(result is not null!, "No GraphQL result was created.");
Debug.Assert(result is not null, "No GraphQL result was created.");
await WriteResultAsync(context.Response, result, statusCode,
context.RequestAborted);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public ExecutorWarmupService(
IRequestExecutorResolver executorResolver,
IEnumerable<WarmupSchema> schemas)
{
if (executorResolver is null!)
if (executorResolver is null)
{
throw new ArgumentNullException(nameof(executorResolver));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public ResultValue(string name, object? value, bool isNullable = true)
/// <summary>
/// Specifies if this entry is fully initialized.
/// </summary>
public bool IsInitialized => Name is not null!;
public bool IsInitialized => Name is not null;

/// <summary>Indicates whether this instance and a specified object are equal.</summary>
/// <param name="obj">The object to compare with the current instance.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ internal class ArgumentParameterExpressionBuilder : IParameterExpressionBuilder
static ArgumentParameterExpressionBuilder()
{
_getArgumentValue = PureContextType.GetMethods().First(IsArgumentValueMethod)!;
Debug.Assert(_getArgumentValue is not null!, "ArgumentValue method is missing." );
Debug.Assert(_getArgumentValue is not null, "ArgumentValue method is missing." );

_getArgumentLiteral = PureContextType.GetMethods().First(IsArgumentLiteralMethod);
Debug.Assert(_getArgumentValue is not null!, "ArgumentLiteral method is missing." );
Debug.Assert(_getArgumentValue is not null, "ArgumentLiteral method is missing." );

_getArgumentOptional = PureContextType.GetMethods().First(IsArgumentOptionalMethod);
Debug.Assert(_getArgumentValue is not null!, "ArgumentOptional method is missing." );
Debug.Assert(_getArgumentValue is not null, "ArgumentOptional method is missing." );

static bool IsArgumentValueMethod(MethodInfo method)
=> method.Name.Equals(_argumentValue, StringComparison.Ordinal) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal sealed class CancellationTokenParameterExpressionBuilder : IParameterEx

static CancellationTokenParameterExpressionBuilder()
{
Debug.Assert(_cancellationToken is not null!, "RequestAborted property is missing." );
Debug.Assert(_cancellationToken is not null, "RequestAborted property is missing." );
}

public ArgumentKind Kind => ArgumentKind.CancellationToken;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal sealed class DocumentParameterExpressionBuilder : IParameterExpressionB
static DocumentParameterExpressionBuilder()
{
_document = ContextType.GetProperty(nameof(IResolverContext.Document))!;
Debug.Assert(_document is not null!, "Document property is missing." );
Debug.Assert(_document is not null, "Document property is missing." );
}

public ArgumentKind Kind => ArgumentKind.DocumentSyntax;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal sealed class ParentParameterExpressionBuilder : IParameterExpressionBui
static ParentParameterExpressionBuilder()
{
_getParentMethod = PureContextType.GetMethods().First(IsParentMethod);
Debug.Assert(_getParentMethod is not null!, "Parent method is missing." );
Debug.Assert(_getParentMethod is not null, "Parent method is missing." );

static bool IsParentMethod(MethodInfo method)
=> method.Name.Equals(_parent, StringComparison.Ordinal) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal sealed class SchemaParameterExpressionBuilder : IParameterExpressionBui
static SchemaParameterExpressionBuilder()
{
_schema = PureContextType.GetProperty(nameof(IPureResolverContext.Schema))!;
Debug.Assert(_schema is not null!, "Schema property is missing." );
Debug.Assert(_schema is not null, "Schema property is missing." );
}

public ArgumentKind Kind => ArgumentKind.Schema;
Expand Down
2 changes: 1 addition & 1 deletion src/HotChocolate/Core/src/Types/Types/Directive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public T ToObject<T>()

public DirectiveNode ToNode(bool removeNullArguments)
{
if (_parsedDirective is null!)
if (_parsedDirective is null)
{
_parsedDirective = ParseValue(Type, _customDirective!);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private bool IsRelevant(TypeInfo typeInfo)
}

Type? runtimeType = typeInfo.Definition.RuntimeType;
return runtimeType is not null! && runtimeType != typeof(object);
return runtimeType is not null && runtimeType != typeof(object);
}

private Type GetRuntimeType(TypeInfo typeInfo)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public async Task InvokeAsync(IMiddlewareContext context)

if (source is not null &&
context.Field.Arguments[_contextData.ArgumentName].Type is InputObjectType iot &&
iot is ISortInputType { EntityType: not null! } fit)
iot is ISortInputType { EntityType: not null } fit)
{
var visitorCtx = new QueryableSortVisitorContext(
context.Service<InputParser>(),
Expand Down

0 comments on commit 71fdf09

Please sign in to comment.