Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Annnoations version to 1.1.0 and add provided.al2023 #1609

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ public static class DiagnosticDescriptors
public static readonly DiagnosticDescriptor InvalidRuntimeSelection = new DiagnosticDescriptor(id: "AWSLambda0112",
title: "Invalid runtime selection",
messageFormat: "The runtime selected in the Amazon.Lambda.Annotations.LambdaGlobalPropertiesAttribute is not a supported value. " +
$"It should be set to one of {string.Join(" or ", Generator._allowdRuntimeValues.ToArray())}.",
$"The valid values are: {string.Join(", ", Generator._allowdRuntimeValues.ToArray())}",
category: "AWSLambdaCSharpGenerator",
DiagnosticSeverity.Error,
isEnabledByDefault: true);

public static readonly DiagnosticDescriptor ExecutableWithNoFunctions = new DiagnosticDescriptor(id: "AWSLambda0113",
title: "Executable output with no LambdaFunction annotations",
messageFormat: "Your project is configured to output an executable and generate a static Main method, but you have not configured any methods with the 'LambdaFunction' attribute.",
messageFormat: "Your project is configured to output an executable and generate a static Main method, but you have not configured any methods with the 'LambdaFunction' attribute",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The period was removed because there is compiler warning that single sentence diagnostic messages should not end with a period.

category: "AWSLambdaCSharpGenerator",
DiagnosticSeverity.Error,
isEnabledByDefault: true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public class Generator : ISourceGenerator
internal static readonly List<string> _allowdRuntimeValues = new List<string>(2)
{
"dotnet6",
"provided.al2"
"provided.al2",
"provided.al2023"
};

// Only allow alphanumeric characters
Expand Down
2 changes: 1 addition & 1 deletion Libraries/src/Amazon.Lambda.Annotations.nuspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Amazon.Lambda.Annotations</id>
<version>1.0.0</version>
<version>1.1.0</version>
<authors>Amazon Web Services</authors>
<tags>AWS Amazon Lambda</tags>
<description>Annotations that can be added to Lambda projects to generate C# code and CloudFormation templates. This library is currently in dev preview.</description>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyVersion>1.0.0</AssemblyVersion>
<AssemblyVersion>1.1.0</AssemblyVersion>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public class LambdaGlobalPropertiesAttribute : Attribute
/// Deploying as an executable versus a class library is required when compiling functions with Native AOT. It can also be useful to deploy as an executable to include specific versions of `Amazon.Lambda.RuntimeSupport` the .NET Lambda runtime client.
/// </summary>
public bool GenerateMain { get; set; }

/// <summary>
/// The runtime to set in the generated CloudFormation template. Either 'dotnet6' or 'provided.al2'.
/// The runtime to set in the generated CloudFormation template. Either 'dotnet6', 'provided.al2' or 'provided.al2023'.
/// </summary>
public string Runtime { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

envValue.Append("amazon-lambda-annotations_1.0.0.0");
envValue.Append("amazon-lambda-annotations_1.1.0.0");

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public async Task TestInvalidGlobalRuntime_ShouldError()
},
ExpectedDiagnostics =
{
new DiagnosticResult("AWSLambda0112", DiagnosticSeverity.Error).WithMessage("The runtime selected in the Amazon.Lambda.Annotations.LambdaGlobalPropertiesAttribute is not a supported value. It should be set to one of dotnet6 or provided.al2."),
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"),
},
ReferenceAssemblies = ReferenceAssemblies.Net.Net60
}
Expand Down
Loading