Skip to content

Commit bf75870

Browse files
authored
Prepare Amazon.Lambda.Annotations for upcoming .NET 10 managed runtime (#2219)
1 parent 61048ce commit bf75870

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"Projects": [
3+
{
4+
"Name": "Amazon.Lambda.Annotations",
5+
"Type": "Minor",
6+
"ChangelogMessages": [
7+
"Prepare Amazon.Lambda.Annotations for upcoming .NET 10 managed runtime"
8+
]
9+
}
10+
]
11+
}

Libraries/src/Amazon.Lambda.Annotations.SourceGenerator/Generator.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ namespace Amazon.Lambda.Annotations.SourceGenerator
1616
[Generator]
1717
public class Generator : ISourceGenerator
1818
{
19-
private const string DEFAULT_LAMBDA_SERIALIZER = "Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer";
2019
private readonly IFileManager _fileManager = new FileManager();
2120
private readonly IDirectoryManager _directoryManager = new DirectoryManager();
2221

@@ -26,15 +25,17 @@ public class Generator : ISourceGenerator
2625
internal static readonly Dictionary<string, string> _targetFrameworksToRuntimes = new Dictionary<string, string>(2)
2726
{
2827
{ "net6.0", "dotnet6" },
29-
{ "net8.0", "dotnet8" }
28+
{ "net8.0", "dotnet8" },
29+
{ "net10.0", "dotnet10" }
3030
};
3131

3232
internal static readonly List<string> _allowedRuntimeValues = new List<string>(4)
3333
{
3434
"dotnet6",
3535
"provided.al2",
3636
"provided.al2023",
37-
"dotnet8"
37+
"dotnet8",
38+
"dotnet10"
3839
};
3940

4041
public Generator()

Libraries/src/Amazon.Lambda.Annotations/LambdaGlobalPropertiesAttribute.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-

1+
22
using System;
33

44
namespace Amazon.Lambda.Annotations
@@ -17,8 +17,8 @@ public class LambdaGlobalPropertiesAttribute : Attribute
1717
public bool GenerateMain { get; set; }
1818

1919
/// <summary>
20-
/// The runtime to set in the generated CloudFormation template. Either 'dotnet6', 'provided.al2', 'provided.al2023', or 'dotnet8'.
20+
/// The runtime to set in the generated CloudFormation template. Either 'dotnet6', 'provided.al2', 'provided.al2023', 'dotnet8', or 'dotnet10'.
2121
/// </summary>
2222
public string Runtime { get; set; }
2323
}
24-
}
24+
}

Libraries/test/Amazon.Lambda.Annotations.SourceGenerators.Tests/SourceGeneratorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public async Task TestInvalidGlobalRuntime_ShouldError()
264264
},
265265
ExpectedDiagnostics =
266266
{
267-
new DiagnosticResult("AWSLambda0112", DiagnosticSeverity.Error).WithMessage("The runtime selected in the Amazon.Lambda.Annotations.LambdaGlobalPropertiesAttribute is not a supported value. The valid values are: dotnet6, provided.al2, provided.al2023, dotnet8"),
267+
new DiagnosticResult("AWSLambda0112", DiagnosticSeverity.Error).WithMessage("The runtime selected in the Amazon.Lambda.Annotations.LambdaGlobalPropertiesAttribute is not a supported value. The valid values are: dotnet6, provided.al2, provided.al2023, dotnet8, dotnet10"),
268268
}
269269
}
270270
};

0 commit comments

Comments
 (0)