Skip to content

Commit

Permalink
Use C# 12
Browse files Browse the repository at this point in the history
  • Loading branch information
pmosk committed Jan 30, 2024
1 parent 39cba5b commit caddf78
Show file tree
Hide file tree
Showing 58 changed files with 112 additions and 798 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,50 +123,6 @@ jobs:
- name: Pack Azure.DurableTask
run: dotnet pack ./src/*/*/Azure.DurableTask.csproj --no-restore -o ~/nuget -c Release

# Azure.KeepWarm.Generator

- name: Restore Azure.KeepWarm.Generator
run: dotnet restore ./src/*/*/Azure.KeepWarm.Generator.csproj

- name: Build Azure.KeepWarm.Generator
run: dotnet build ./src/*/*/Azure.KeepWarm.Generator.csproj --no-restore -c Release

- name: Pack Azure.KeepWarm.Generator
run: dotnet pack ./src/*/*/Azure.KeepWarm.Generator.csproj --no-restore -o ~/nuget -c Release

# Azure.KeepWarm

- name: Restore Azure.KeepWarm
run: dotnet restore ./src/*/*/Azure.KeepWarm.csproj

- name: Build Azure.KeepWarm
run: dotnet build ./src/*/*/Azure.KeepWarm.csproj --no-restore -c Release

- name: Pack Azure.KeepWarm
run: dotnet pack ./src/*/*/Azure.KeepWarm.csproj --no-restore -o ~/nuget -c Release

# Azure.HealthCheck.Generator

- name: Restore Azure.HealthCheck.Generator
run: dotnet restore ./src/*/*/Azure.HealthCheck.Generator.csproj

- name: Build Azure.HealthCheck.Generator
run: dotnet build ./src/*/*/Azure.HealthCheck.Generator.csproj --no-restore -c Release

- name: Pack Azure.HealthCheck.Generator
run: dotnet pack ./src/*/*/Azure.HealthCheck.Generator.csproj --no-restore -o ~/nuget -c Release

# Azure.HealthCheck

- name: Restore Azure.HealthCheck
run: dotnet restore ./src/*/*/Azure.HealthCheck.csproj

- name: Build Azure.HealthCheck
run: dotnet build ./src/*/*/Azure.HealthCheck.csproj --no-restore -c Release

- name: Pack Azure.HealthCheck
run: dotnet pack ./src/*/*/Azure.HealthCheck.csproj --no-restore -o ~/nuget -c Release

# Push

- name: Push Packages
Expand Down
32 changes: 0 additions & 32 deletions src/Infra.Azure.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Handler", "handler\Az
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Handler.Generator", "handler\Azure.Handler.Generator\Azure.Handler.Generator.csproj", "{63CA44BE-1953-4367-B05F-3E1B06BF6A6E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "keep-warm", "keep-warm", "{187BBAAA-B293-46DA-82CA-E20C566170A4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.KeepWarm.Generator", "keep-warm\Azure.KeepWarm.Generator\Azure.KeepWarm.Generator.csproj", "{93F9146A-12D4-4CDD-B014-D9AEFCB6327F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.KeepWarm", "keep-warm\Azure.KeepWarm\Azure.KeepWarm.csproj", "{39E7426A-CE75-4178-B76C-F802DC1083ED}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "swagger", "swagger", "{EAE08C3A-D84B-4AAE-AB6F-9D0F71ABC333}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Swagger", "swagger\Azure.Swagger\Azure.Swagger.csproj", "{A4E2FD90-B0AC-4E58-8AF4-1F17D1016206}"
Expand All @@ -31,12 +25,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Endpoint.Generator",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Endpoint", "endpoint\Azure.Endpoint\Azure.Endpoint.csproj", "{3FD09394-45D0-4DD9-899C-8AB05926E103}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "health-check", "health-check", "{6971B67D-D70D-488E-B64B-D6240B520A27}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.HealthCheck", "health-check\Azure.HealthCheck\Azure.HealthCheck.csproj", "{8F6FFF47-F4B6-4D12-8D87-E3852B37AFBB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.HealthCheck.Generator", "health-check\Azure.HealthCheck.Generator\Azure.HealthCheck.Generator.csproj", "{13773C15-8E0A-4FF7-ACF2-5435749C0F5E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "hosting", "hosting", "{E06F1C49-3CBC-4F24-8178-3A6B78D5B464}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Hosting", "hosting\Azure.Hosting\Azure.Hosting.csproj", "{04DA36C0-C56F-407D-81CE-31CD192BAC50}"
Expand All @@ -63,14 +51,6 @@ Global
{63CA44BE-1953-4367-B05F-3E1B06BF6A6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63CA44BE-1953-4367-B05F-3E1B06BF6A6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63CA44BE-1953-4367-B05F-3E1B06BF6A6E}.Release|Any CPU.Build.0 = Release|Any CPU
{93F9146A-12D4-4CDD-B014-D9AEFCB6327F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{93F9146A-12D4-4CDD-B014-D9AEFCB6327F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{93F9146A-12D4-4CDD-B014-D9AEFCB6327F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{93F9146A-12D4-4CDD-B014-D9AEFCB6327F}.Release|Any CPU.Build.0 = Release|Any CPU
{39E7426A-CE75-4178-B76C-F802DC1083ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39E7426A-CE75-4178-B76C-F802DC1083ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39E7426A-CE75-4178-B76C-F802DC1083ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39E7426A-CE75-4178-B76C-F802DC1083ED}.Release|Any CPU.Build.0 = Release|Any CPU
{A4E2FD90-B0AC-4E58-8AF4-1F17D1016206}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A4E2FD90-B0AC-4E58-8AF4-1F17D1016206}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4E2FD90-B0AC-4E58-8AF4-1F17D1016206}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -83,14 +63,6 @@ Global
{3FD09394-45D0-4DD9-899C-8AB05926E103}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3FD09394-45D0-4DD9-899C-8AB05926E103}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3FD09394-45D0-4DD9-899C-8AB05926E103}.Release|Any CPU.Build.0 = Release|Any CPU
{8F6FFF47-F4B6-4D12-8D87-E3852B37AFBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F6FFF47-F4B6-4D12-8D87-E3852B37AFBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F6FFF47-F4B6-4D12-8D87-E3852B37AFBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F6FFF47-F4B6-4D12-8D87-E3852B37AFBB}.Release|Any CPU.Build.0 = Release|Any CPU
{13773C15-8E0A-4FF7-ACF2-5435749C0F5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13773C15-8E0A-4FF7-ACF2-5435749C0F5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13773C15-8E0A-4FF7-ACF2-5435749C0F5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13773C15-8E0A-4FF7-ACF2-5435749C0F5E}.Release|Any CPU.Build.0 = Release|Any CPU
{04DA36C0-C56F-407D-81CE-31CD192BAC50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{04DA36C0-C56F-407D-81CE-31CD192BAC50}.Debug|Any CPU.Build.0 = Debug|Any CPU
{04DA36C0-C56F-407D-81CE-31CD192BAC50}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -104,13 +76,9 @@ Global
{6A45A9B3-39F3-43C9-B4EB-8EE4A8D4FF92} = {6E30404F-E85C-4518-950F-0CE886843BCA}
{C02257B9-3134-4EDB-BD7A-65F9D8BEE1BB} = {7DFD1749-0C57-4D4E-8F23-1487F5B4640C}
{63CA44BE-1953-4367-B05F-3E1B06BF6A6E} = {7DFD1749-0C57-4D4E-8F23-1487F5B4640C}
{93F9146A-12D4-4CDD-B014-D9AEFCB6327F} = {187BBAAA-B293-46DA-82CA-E20C566170A4}
{39E7426A-CE75-4178-B76C-F802DC1083ED} = {187BBAAA-B293-46DA-82CA-E20C566170A4}
{A4E2FD90-B0AC-4E58-8AF4-1F17D1016206} = {EAE08C3A-D84B-4AAE-AB6F-9D0F71ABC333}
{768CF06F-CD38-4620-A647-E544C02D6128} = {36301971-7705-42B3-A42D-4F4D80CA4B77}
{3FD09394-45D0-4DD9-899C-8AB05926E103} = {36301971-7705-42B3-A42D-4F4D80CA4B77}
{8F6FFF47-F4B6-4D12-8D87-E3852B37AFBB} = {6971B67D-D70D-488E-B64B-D6240B520A27}
{13773C15-8E0A-4FF7-ACF2-5435749C0F5E} = {6971B67D-D70D-488E-B64B-D6240B520A27}
{04DA36C0-C56F-407D-81CE-31CD192BAC50} = {E06F1C49-3CBC-4F24-8178-3A6B78D5B464}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<RootNamespace>GarageGroup.Infra</RootNamespace>
<AssemblyName>GarageGroup.Infra.Azure.DurableTask.Generator</AssemblyName>
<Version>0.3.0</Version>
<Version>0.4.0</Version>
</PropertyGroup>

<ItemGroup>
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="GarageGroup.Infra.Azure.Handler.Generator" Version="0.7.0" />
<PackageReference Include="GarageGroup.Infra.Azure.Handler.Generator" Version="0.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ public sealed class DurableHandlerFunctionSourceGenerator : HandlerFunctionSourc

static DurableHandlerFunctionSourceGenerator()
=>
DataProviders = new IFunctionDataProvider[]
{
DataProviders =
[
new ActivityFunctionDataProvider(),
new EntityFunctionDataProvider(),
new OrchestrationFunctionDataProvider()
};
];

protected override HandlerFunctionProvider GetFunctionProvider()
=>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,31 @@ internal sealed class ActivityFunctionDataProvider : IFunctionDataProvider
}

return new(
namespaces: new[]
{
namespaces:
[
"System.Text.Json",
"System.Threading",
"System.Threading.Tasks"
},
],
responseTypeDisplayName: $"Task<HandlerResultJson<{context.OutputType.DisplayedTypeName}>>",
extensionsMethodName: "RunAzureFunctionAsync",
arguments: new FunctionArgumentMetadata[]
{
arguments:
[
new(
namespaces: default,
typeDisplayName: "JsonElement",
argumentName: "requestData",
orderNumber: int.MinValue,
extensionMethodArgumentOrder: int.MinValue,
resolverMethodArgumentOrder: null,
attributes: new FunctionAttributeMetadata[]
{
attributes:
[
new(
namespaces: default,
typeDisplayName: "ActivityTrigger",
constructorArgumentSourceCodes: default,
propertySourceCodes: default),
}),
]),
new(
namespaces: default,
typeDisplayName: "FunctionContext",
Expand All @@ -53,6 +53,6 @@ internal sealed class ActivityFunctionDataProvider : IFunctionDataProvider
extensionMethodArgumentOrder: int.MaxValue,
resolverMethodArgumentOrder: null,
attributes: default)
});
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ internal sealed class EntityFunctionDataProvider : IFunctionDataProvider
}

return new(
namespaces: new[]
{
namespaces:
[
"System.Threading",
"System.Threading.Tasks",
"Microsoft.Azure.Functions.Worker"
},
],
responseTypeDisplayName: string.Equals("Unit", context.OutputType.DisplayedTypeName, StringComparison.Ordinal) switch
{
true => "Task",
_ => $"Task<{context.OutputType.DisplayedTypeName}>"
},
extensionsMethodName: "RunEntityFunctionAsync",
arguments: new FunctionArgumentMetadata[]
{
arguments:
[
new(
namespaces: default,
typeDisplayName: "TaskEntityDispatcher",
Expand Down Expand Up @@ -67,6 +67,6 @@ internal sealed class EntityFunctionDataProvider : IFunctionDataProvider
extensionMethodArgumentOrder: int.MaxValue,
resolverMethodArgumentOrder: null,
attributes: default)
});
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,35 @@ internal sealed class OrchestrationFunctionDataProvider : IFunctionDataProvider
}

return new(
namespaces: new[]
{
namespaces:
[
"System.Threading",
"System.Threading.Tasks",
"Microsoft.DurableTask"
},
],
responseTypeDisplayName: string.Equals("Unit", context.OutputType.DisplayedTypeName, StringComparison.Ordinal) switch
{
true => "Task",
_ => $"Task<{context.OutputType.DisplayedTypeName}>"
},
extensionsMethodName: "RunOrchestrationFunctionAsync",
arguments: new FunctionArgumentMetadata[]
{
arguments:
[
new(
namespaces: default,
typeDisplayName: "TaskOrchestrationContext",
argumentName: "orchestrationContext",
orderNumber: int.MinValue,
extensionMethodArgumentOrder: int.MinValue,
resolverMethodArgumentOrder: null,
attributes: new FunctionAttributeMetadata[]
{
attributes:
[
new(
namespaces: default,
typeDisplayName: "OrchestrationTrigger",
constructorArgumentSourceCodes: default,
propertySourceCodes: default),
}),
]),
new(
namespaces: default,
typeDisplayName: "FunctionContext",
Expand All @@ -58,6 +58,6 @@ internal sealed class OrchestrationFunctionDataProvider : IFunctionDataProvider
extensionMethodArgumentOrder: int.MaxValue,
resolverMethodArgumentOrder: null,
attributes: default)
});
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
namespace GarageGroup.Infra;

[AttributeUsage(AttributeTargets.Method)]
public sealed class ActivityFunctionAttribute : HandlerFunctionAttribute
public sealed class ActivityFunctionAttribute(string name) : HandlerFunctionAttribute(name)
{
public ActivityFunctionAttribute(string name) : base(name)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
namespace GarageGroup.Infra;

[AttributeUsage(AttributeTargets.Method)]
public sealed class EntityFunctionAttribute : HandlerFunctionAttribute
public sealed class EntityFunctionAttribute(string name) : HandlerFunctionAttribute(name)
{
public EntityFunctionAttribute(string name) : base(name)
{
}

public string? EntityName { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
namespace GarageGroup.Infra;

[AttributeUsage(AttributeTargets.Method)]
public sealed class OrchestrationFunctionAttribute : HandlerFunctionAttribute
public sealed class OrchestrationFunctionAttribute(string name) : HandlerFunctionAttribute(name)
{
public OrchestrationFunctionAttribute(string name) : base(name)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal OrchestrationActivityApi(TaskOrchestrationContext context, Orchestratio
return null;
}

return new TaskOptions(
return new(
retry: new RetryPolicy(
maxNumberOfAttempts: option.MaxNumberOfAttempts,
firstRetryInterval: option.FirstRetryInterval,
Expand Down
7 changes: 4 additions & 3 deletions src/durable-task/Azure.DurableTask/Azure.DurableTask.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

<PropertyGroup>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<InvariantGlobalization>true</InvariantGlobalization>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<RootNamespace>GarageGroup.Infra</RootNamespace>
<AssemblyName>GarageGroup.Infra.Azure.DurableTask</AssemblyName>
<Version>0.5.3</Version>
<Version>0.6.0</Version>
</PropertyGroup>

<ItemGroup>
Expand All @@ -19,11 +20,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GarageGroup.Infra.Azure.Handler" Version="0.12.3" />
<PackageReference Include="GarageGroup.Infra.Azure.Handler" Version="0.13.0" />
<PackageReference Include="GarageGroup.Infra.Orchestration.Api.Activity.Contract" Version="0.2.0" />
<PackageReference Include="GarageGroup.Infra.Orchestration.Api.Entity.Contract" Version="0.1.0" />
<PackageReference Include="GarageGroup.Infra.Orchestration.Api.Instance.Contract" Version="0.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.1.1" />
<PackageReference Include="PrimeFuncPack.Primitives.Strings" Version="2.0.3" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<RootNamespace>GarageGroup.Infra</RootNamespace>
<AssemblyName>GarageGroup.Infra.Azure.Endpoint.Generator</AssemblyName>
<Version>0.6.0</Version>
<Version>0.7.0</Version>
</PropertyGroup>

<ItemGroup>
Expand All @@ -19,7 +19,7 @@

<ItemGroup>
<PackageReference Include="GarageGroup.CodeAnalysis.Extensions" Version="0.5.0" />
<PackageReference Include="GarageGroup.CodeAnalysis.SourceBuilder" Version="0.1.0" />
<PackageReference Include="GarageGroup.CodeAnalysis.SourceBuilder" Version="0.2.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
Loading

0 comments on commit caddf78

Please sign in to comment.