-
Notifications
You must be signed in to change notification settings - Fork 478
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
Add support for .NET 8 to Lambda Annotations #1658
Changes from 3 commits
357bf99
729f019
c504187
1646e3a
e6ec280
dc0ce30
6de53aa
a1aac5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
; Shipped analyzer releases | ||
; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md | ||
|
||
## Release 1.1.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated to this change, just moving the errors we added in 1.1.0 to the shipped file. |
||
### New Rules | ||
|
||
Rule ID | Category | Severity | Notes | ||
--------|----------|----------|------- | ||
AWSLambda0111 | AWSLambdaCSharpGenerator | Error | If the GenerateMain global property is set to true but the project OutputType is not set to 'exe' | ||
AWSLambda0112 | AWSLambdaCSharpGenerator | Error | An invalid runtime is selected in the LambdaGlobalProperties attribute | ||
AWSLambda0113 | AWSLambdaCSharpGenerator | Error | The GenerateMain global property is set to true and the OutputType is set to 'exe', but no Lambda Function attributes are used | ||
AWSLambda0114 | AWSLambdaCSharpGenerator | Error | The GenerateMain global property is set to true, but the project already contains a static Main method | ||
|
||
## Release 1.0.0 | ||
Rule ID | Category | Severity | Notes | ||
--------|----------|----------|------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,2 @@ | ||
; Unshipped analyzer release | ||
; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md | ||
|
||
### New Rules | ||
|
||
Rule ID | Category | Severity | Notes | ||
--------|----------|----------|------- | ||
AWSLambda0111|AWSLambdaCSharpGenerator|Error|If the GenerateMain global property is set to true but the project OutputType is not set to 'exe' | ||
AWSLambda0112|AWSLambdaCSharpGenerator|Error|An invalid runtime is selected in the LambdaGlobalProperties attribute | ||
AWSLambda0113|AWSLambdaCSharpGenerator|Error|The GenerateMain global property is set to true and the OutputType is set to 'exe', but no Lambda Function attributes are used | ||
AWSLambda0114|AWSLambdaCSharpGenerator|Error|The GenerateMain global property is set to true, but the project already contains a static Main method |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.IO; | ||
using Amazon.Lambda.Core; | ||
|
||
namespace TestServerlessApp.NET8 | ||
{ | ||
public class Functions_ToUpper_Generated | ||
{ | ||
private readonly Functions functions; | ||
private readonly Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer serializer; | ||
|
||
public Functions_ToUpper_Generated() | ||
{ | ||
SetExecutionEnvironment(); | ||
functions = new Functions(); | ||
serializer = new Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer(); | ||
} | ||
|
||
public string ToUpper(string text) | ||
{ | ||
return functions.ToUpper(text); | ||
} | ||
|
||
private static void SetExecutionEnvironment() | ||
{ | ||
const string envName = "AWS_EXECUTION_ENV"; | ||
|
||
var envValue = new StringBuilder(); | ||
|
||
// If there is an existing execution environment variable add the annotations package as a suffix. | ||
if(!string.IsNullOrEmpty(Environment.GetEnvironmentVariable(envName))) | ||
{ | ||
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_"); | ||
} | ||
|
||
envValue.Append("amazon-lambda-annotations_1.1.0.0"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we just increment the version to the one we intend to release this PR in? (and do it for all the other snaphsot files) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given the churn we've had with .NET 8, I didn't want to tie this to a version yet so would just do the separate versioning PR. |
||
|
||
Environment.SetEnvironmentVariable(envName, envValue.ToString()); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi: I was only adding line 14, my VS sorted the list.