Skip to content

Commit

Permalink
Update to .net8 sdk (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
jviau authored Nov 14, 2023
1 parent eb18611 commit 4aa4efd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- Common build settings -->
<PropertyGroup>
<LangVersion>10.0</LangVersion>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"sdk": {
"version": "6.0.401",
"version": "8.0.100",
"rollForward": "latestFeature"
},
"msbuild-sdks": {
"Microsoft.Build.NoTargets": "3.5.6",
"Microsoft.Build.Traversal": "3.2.0"
"Microsoft.Build.NoTargets": "3.7.0",
"Microsoft.Build.Traversal": "4.1.0"
}
}
25 changes: 15 additions & 10 deletions src/Generators/AzureFunctions/SyntaxNodeUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ namespace Microsoft.DurableTask.Generators.AzureFunctions
{
static class SyntaxNodeUtility
{
public static bool TryGetFunctionName(SemanticModel model, MethodDeclarationSyntax method, out string? functionName)
public static bool TryGetFunctionName(
SemanticModel model, MethodDeclarationSyntax method, out string? functionName)
{
if (TryGetAttributeByName(method, "Function", out AttributeSyntax? functionNameAttribute) && functionNameAttribute != null)
if (TryGetAttributeByName(
method, "Function", out AttributeSyntax? functionNameAttribute) && functionNameAttribute != null)
{
if (functionNameAttribute.ArgumentList?.Arguments.Count == 1)
{
Expand Down Expand Up @@ -42,11 +44,11 @@ public static bool TryGetFunctionKind(MethodDeclarationSyntax method, out Durabl
{
SeparatedSyntaxList<ParameterSyntax> parameters = method.ParameterList.Parameters;

foreach (var parameterSyntax in parameters)
foreach (ParameterSyntax parameterSyntax in parameters)
{
IEnumerable<AttributeSyntax> parameterAttributes = parameterSyntax.AttributeLists.SelectMany(a => a.Attributes);

foreach (var attribute in parameterAttributes)
IEnumerable<AttributeSyntax> parameterAttributes = parameterSyntax.AttributeLists
.SelectMany(a => a.Attributes);
foreach (AttributeSyntax attribute in parameterAttributes)
{
if (attribute.ToString().Equals("OrchestrationTrigger", StringComparison.Ordinal))
{
Expand All @@ -66,13 +68,14 @@ public static bool TryGetFunctionKind(MethodDeclarationSyntax method, out Durabl
return false;
}

public static bool TryGetRequiredNamespaces(List<INamedTypeSymbol> types, out HashSet<string>? requiredNamespaces)
public static bool TryGetRequiredNamespaces(
List<INamedTypeSymbol> types, out HashSet<string>? requiredNamespaces)
{
requiredNamespaces = new HashSet<string>();

var remaining = new Queue<INamedTypeSymbol>(types);

while (remaining.Any())
while (remaining.Count > 0)
{
INamedTypeSymbol typeInfo = remaining.Dequeue();
if (typeInfo is null)
Expand Down Expand Up @@ -139,7 +142,8 @@ public static bool TryGetParameter(
return false;
}

public static bool TryGetQualifiedTypeName(SemanticModel model, MethodDeclarationSyntax method, out string? fullTypeName)
public static bool TryGetQualifiedTypeName(
SemanticModel model, MethodDeclarationSyntax method, out string? fullTypeName)
{
ISymbol? symbol = model.GetEnclosingSymbol(method.SpanStart);
if (symbol == null)
Expand Down Expand Up @@ -175,7 +179,8 @@ public static string GetRenderedTypeExpression(ITypeSymbol? symbol, bool support
return expression;
}

static bool TryGetAttributeByName(MethodDeclarationSyntax method, string attributeName, out AttributeSyntax? attribute)
static bool TryGetAttributeByName(
MethodDeclarationSyntax method, string attributeName, out AttributeSyntax? attribute)
{
attribute = method.AttributeLists.SelectMany(a => a.Attributes).FirstOrDefault(
a => a.Name.NormalizeWhitespace().ToFullString().Equals(attributeName, StringComparison.Ordinal));
Expand Down
6 changes: 1 addition & 5 deletions src/Worker/Grpc/GrpcOrchestrationRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ public static string LoadAndRun<TInput, TOutput>(
Func<TaskOrchestrationContext, TInput?, Task<TOutput?>> orchestratorFunc,
IServiceProvider? services = null)
{
if (orchestratorFunc == null)
{
throw new ArgumentNullException(nameof(orchestratorFunc));
}

Check.NotNull(orchestratorFunc);
return LoadAndRun(encodedOrchestratorRequest, FuncTaskOrchestrator.Create(orchestratorFunc), services);
}

Expand Down

0 comments on commit 4aa4efd

Please sign in to comment.