Skip to content

Version bump Amazon.Lambda.Annotations to 1.6.0 #1867

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

Merged
merged 2 commits into from
Nov 12, 2024
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Release 2024-11-12

### Amazon.Lambda.Annotations (1.6.0)
* Eagerly build Function Handler inside the Generated class's constructor

## Release 2024-11-06

### Amazon.Lambda.Core (2.4.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<IncludeBuildOutput>false</IncludeBuildOutput>

<Version>1.5.3</Version>
<Version>1.6.0</Version>
</PropertyGroup>

<!-- Delay setting the package id till after resolving dependencies to avoid ambigious errors. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Amazon.Lambda.Annotations.SourceGenerator.Templates
/// Class to produce the template output
/// </summary>

#line 1 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 1 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class FieldsAndConstructor : FieldsAndConstructorBase
{
Expand All @@ -30,7 +30,7 @@ public partial class FieldsAndConstructor : FieldsAndConstructorBase
public virtual string TransformText()
{

#line 7 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 7 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"

if (_model.LambdaMethod.UsingDependencyInjection)
{
Expand All @@ -40,7 +40,7 @@ public virtual string TransformText()
#line hidden
this.Write(" private readonly ServiceProvider serviceProvider;\r\n");

#line 12 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 12 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"

}
else
Expand All @@ -51,28 +51,28 @@ public virtual string TransformText()
#line hidden
this.Write(" private readonly ");

#line 17 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 17 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_model.LambdaMethod.ContainingType.Name));

#line default
#line hidden
this.Write(" ");

#line 17 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 17 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_model.LambdaMethod.ContainingType.Name.ToCamelCase()));

#line default
#line hidden
this.Write(";\r\n private readonly ");

#line 18 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 18 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_model.SerializerInfo.SerializerName));

#line default
#line hidden
this.Write(" serializer;\r\n");

#line 19 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 19 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"

}

Expand All @@ -87,14 +87,14 @@ public virtual string TransformText()
/// </summary>
public ");

#line 28 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 28 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_model.GeneratedMethod.ContainingType.Name));

#line default
#line hidden
this.Write("()\r\n {\r\n SetExecutionEnvironment();\r\n");

#line 31 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 31 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"

if (_model.LambdaMethod.UsingDependencyInjection)
{
Expand All @@ -108,29 +108,45 @@ public virtual string TransformText()
// To use a different lifetime, specify the lifetime in Startup.ConfigureServices(IServiceCollection) method.
services.AddSingleton<");

#line 39 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 39 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_model.LambdaMethod.ContainingType.Name));

#line default
#line hidden
this.Write(">();\r\n services.AddSingleton<");

#line 40 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 40 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_model.SerializerInfo.SerializerName));

#line default
#line hidden
this.Write(">();\r\n\r\n var startup = new ");

#line 42 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 42 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_model.StartupType.FullName));

#line default
#line hidden
this.Write("();\r\n startup.ConfigureServices(services);\r\n serviceProvide" +
"r = services.BuildServiceProvider();\r\n");
"r = services.BuildServiceProvider();\r\n\r\n // Intentionally eagerly bui" +
"ld ");

#line 45 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 46 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_model.LambdaMethod.ContainingType.Name));

#line default
#line hidden
this.Write(" and its dependencies.\r\n // This causes time spent in the Constructor " +
"to appear on INIT_REPORTs\r\n _ = serviceProvider.GetRequiredService<");

#line 48 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_model.LambdaMethod.ContainingType.Name));

#line default
#line hidden
this.Write(">();\r\n");

#line 49 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"

}
else
Expand All @@ -141,28 +157,28 @@ public virtual string TransformText()
#line hidden
this.Write(" ");

#line 50 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 54 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_model.LambdaMethod.ContainingType.Name.ToCamelCase()));

#line default
#line hidden
this.Write(" = new ");

#line 50 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 54 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_model.LambdaMethod.ContainingType.Name));

#line default
#line hidden
this.Write("();\r\n serializer = new ");

#line 51 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 55 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_model.SerializerInfo.SerializerName));

#line default
#line hidden
this.Write("();\r\n");

#line 52 "C:\codebase\V3\HLL\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"
#line 56 "C:\projects\aws\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator\Templates\FieldsAndConstructor.tt"

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
var startup = new <#= _model.StartupType.FullName #>();
startup.ConfigureServices(services);
serviceProvider = services.BuildServiceProvider();

// Intentionally eagerly build <#= _model.LambdaMethod.ContainingType.Name #> and its dependencies.
// This causes time spent in the Constructor to appear on INIT_REPORTs
_ = serviceProvider.GetRequiredService<<#= _model.LambdaMethod.ContainingType.Name #>>();
<#
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<AssemblyOriginatorKeyFile>..\..\..\buildtools\public.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>

<Version>1.5.3</Version>
<Version>1.6.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public FunctionsZipOutput_ToLower_Generated()
var startup = new TestServerlessApp.Startup();
startup.ConfigureServices(services);
serviceProvider = services.BuildServiceProvider();

// Intentionally eagerly build FunctionsZipOutput and its dependencies.
// This causes time spent in the Constructor to appear on INIT_REPORTs
_ = serviceProvider.GetRequiredService<FunctionsZipOutput>();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public Functions_ToUpper_Generated()
var startup = new TestServerlessApp.Startup();
startup.ConfigureServices(services);
serviceProvider = services.BuildServiceProvider();

// Intentionally eagerly build Functions and its dependencies.
// This causes time spent in the Constructor to appear on INIT_REPORTs
_ = serviceProvider.GetRequiredService<Functions>();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public Greeter_SayHelloAsync_Generated()
var startup = new TestServerlessApp.Startup();
startup.ConfigureServices(services);
serviceProvider = services.BuildServiceProvider();

// Intentionally eagerly build Greeter and its dependencies.
// This causes time spent in the Constructor to appear on INIT_REPORTs
_ = serviceProvider.GetRequiredService<Greeter>();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public Greeter_SayHello_Generated()
var startup = new TestServerlessApp.Startup();
startup.ConfigureServices(services);
serviceProvider = services.BuildServiceProvider();

// Intentionally eagerly build Greeter and its dependencies.
// This causes time spent in the Constructor to appear on INIT_REPORTs
_ = serviceProvider.GetRequiredService<Greeter>();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public SimpleCalculator_Add_Generated()
var startup = new TestServerlessApp.Startup();
startup.ConfigureServices(services);
serviceProvider = services.BuildServiceProvider();

// Intentionally eagerly build SimpleCalculator and its dependencies.
// This causes time spent in the Constructor to appear on INIT_REPORTs
_ = serviceProvider.GetRequiredService<SimpleCalculator>();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public SimpleCalculator_DivideAsync_Generated()
var startup = new TestServerlessApp.Startup();
startup.ConfigureServices(services);
serviceProvider = services.BuildServiceProvider();

// Intentionally eagerly build SimpleCalculator and its dependencies.
// This causes time spent in the Constructor to appear on INIT_REPORTs
_ = serviceProvider.GetRequiredService<SimpleCalculator>();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public SimpleCalculator_Multiply_Generated()
var startup = new TestServerlessApp.Startup();
startup.ConfigureServices(services);
serviceProvider = services.BuildServiceProvider();

// Intentionally eagerly build SimpleCalculator and its dependencies.
// This causes time spent in the Constructor to appear on INIT_REPORTs
_ = serviceProvider.GetRequiredService<SimpleCalculator>();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public SimpleCalculator_Pi_Generated()
var startup = new TestServerlessApp.Startup();
startup.ConfigureServices(services);
serviceProvider = services.BuildServiceProvider();

// Intentionally eagerly build SimpleCalculator and its dependencies.
// This causes time spent in the Constructor to appear on INIT_REPORTs
_ = serviceProvider.GetRequiredService<SimpleCalculator>();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public SimpleCalculator_Random_Generated()
var startup = new TestServerlessApp.Startup();
startup.ConfigureServices(services);
serviceProvider = services.BuildServiceProvider();

// Intentionally eagerly build SimpleCalculator and its dependencies.
// This causes time spent in the Constructor to appear on INIT_REPORTs
_ = serviceProvider.GetRequiredService<SimpleCalculator>();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public SimpleCalculator_Randoms_Generated()
var startup = new TestServerlessApp.Startup();
startup.ConfigureServices(services);
serviceProvider = services.BuildServiceProvider();

// Intentionally eagerly build SimpleCalculator and its dependencies.
// This causes time spent in the Constructor to appear on INIT_REPORTs
_ = serviceProvider.GetRequiredService<SimpleCalculator>();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public SimpleCalculator_Subtract_Generated()
var startup = new TestServerlessApp.Startup();
startup.ConfigureServices(services);
serviceProvider = services.BuildServiceProvider();

// Intentionally eagerly build SimpleCalculator and its dependencies.
// This causes time spent in the Constructor to appear on INIT_REPORTs
_ = serviceProvider.GetRequiredService<SimpleCalculator>();
}

/// <summary>
Expand Down
Loading