Skip to content

Commit 1119938

Browse files
committed
test(aot): root libraries for publish analysis
Replace durable workflow smoke code with an empty executable and explicit trimmer roots.
1 parent e179845 commit 1119938

2 files changed

Lines changed: 11 additions & 67 deletions

File tree

src/AotCompatibility.TestApp/AotCompatibility.TestApp.csproj

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,17 @@
99
<TrimmerSingleWarn>false</TrimmerSingleWarn>
1010
<SelfContained>true</SelfContained>
1111
<WarningsAsErrors>IL2026;IL2087;IL2091;IL3050;IL3051</WarningsAsErrors>
12-
<InterceptorsNamespaces>$(InterceptorsNamespaces);MinimalLambda.Generated</InterceptorsNamespaces>
1312
<IsPackable>false</IsPackable>
1413
</PropertyGroup>
1514
<ItemGroup>
16-
<EnvelopeRootAssembly Include="MinimalLambda.Envelopes.Alb" />
17-
<EnvelopeRootAssembly Include="MinimalLambda.Envelopes.ApiGateway" />
18-
<EnvelopeRootAssembly Include="MinimalLambda.Envelopes.CloudWatchLogs" />
19-
<EnvelopeRootAssembly Include="MinimalLambda.Envelopes.Kafka" />
20-
<EnvelopeRootAssembly Include="MinimalLambda.Envelopes.KinesisFirehose" />
21-
<EnvelopeRootAssembly Include="MinimalLambda.Envelopes.Kinesis" />
22-
<EnvelopeRootAssembly Include="MinimalLambda.Envelopes.Sns" />
23-
<EnvelopeRootAssembly Include="MinimalLambda.Envelopes.Sqs" />
24-
<EnvelopeRootAssembly Include="MinimalLambda.Envelopes" />
25-
<CoreRootAssembly Include="MinimalLambda.Abstractions" />
26-
<CoreRootAssembly Include="MinimalLambda.OpenTelemetry" />
27-
<CoreRootAssembly Include="MinimalLambda" />
28-
</ItemGroup>
29-
<ItemGroup>
30-
<ProjectReference
31-
Include="..\MinimalLambda.SourceGenerators\MinimalLambda.SourceGenerators.csproj"
32-
ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
33-
<ProjectReference
34-
Include="..\MinimalLambda.DurableExecution\MinimalLambda.DurableExecution.csproj" />
35-
</ItemGroup>
36-
<ItemGroup>
37-
<TrimmerRootAssembly Include="@(EnvelopeRootAssembly)" />
38-
<TrimmerRootAssembly Include="@(CoreRootAssembly)" />
39-
<TrimmerRootAssembly
40-
Update="@(EnvelopeRootAssembly)"
41-
Path="$(MSBuildThisFileDirectory)..\..\src\Envelopes\%(Identity)\%(Identity).csproj" />
42-
<TrimmerRootAssembly
43-
Update="@(CoreRootAssembly)"
44-
Path="$(MSBuildThisFileDirectory)..\..\src\%(Identity)\%(Identity).csproj" />
45-
<ProjectReference Include="@(TrimmerRootAssembly->'%(Path)')" />
15+
<AotRootProject
16+
Include="MinimalLambda.Envelopes.Alb;MinimalLambda.Envelopes.ApiGateway;MinimalLambda.Envelopes.CloudWatchLogs;MinimalLambda.Envelopes.Kafka;MinimalLambda.Envelopes.KinesisFirehose;MinimalLambda.Envelopes.Kinesis;MinimalLambda.Envelopes.Sns;MinimalLambda.Envelopes.Sqs;MinimalLambda.Envelopes"
17+
ProjectPath="$(MSBuildThisFileDirectory)..\..\src\Envelopes\%(Identity)\%(Identity).csproj" />
18+
<AotRootProject
19+
Include="MinimalLambda.Abstractions;MinimalLambda.OpenTelemetry;MinimalLambda;MinimalLambda.DurableExecution"
20+
ProjectPath="$(MSBuildThisFileDirectory)..\..\src\%(Identity)\%(Identity).csproj" />
21+
22+
<ProjectReference Include="@(AotRootProject->'%(ProjectPath)')" />
23+
<TrimmerRootAssembly Include="@(AotRootProject)" />
4624
</ItemGroup>
4725
</Project>
Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,3 @@
1-
using System.Text.Json.Serialization;
2-
using Amazon.Lambda.DurableExecution;
3-
using Microsoft.Extensions.DependencyInjection;
4-
using Microsoft.Extensions.Hosting;
5-
using MinimalLambda;
6-
using MinimalLambda.Builder;
1+
// This executable exists only to root MinimalLambda assemblies for Native AOT publish analysis.
72

8-
var builder = LambdaApplication.CreateBuilder();
9-
builder.Services.AddLambdaSerializerWithContext<AotJsonSerializerContext>();
10-
11-
await using var lambda = builder.Build();
12-
lambda.MapDurableHandler(HandleAsync);
13-
await lambda.RunAsync();
14-
15-
static async Task<DurableWorkflowOutput> HandleAsync(
16-
[FromEvent] DurableWorkflowInput input,
17-
IDurableContext durable)
18-
{
19-
var stepResult = await durable.StepAsync<DurableStepResult>(
20-
(_, _) => Task.FromResult(new DurableStepResult(input.Name.Trim())),
21-
name: "normalize-name");
22-
23-
return new DurableWorkflowOutput($"Hello, {stepResult.NormalizedName}!");
24-
}
25-
26-
internal sealed record DurableWorkflowInput(string Name);
27-
28-
internal sealed record DurableWorkflowOutput(string Message);
29-
30-
internal sealed record DurableStepResult(string NormalizedName);
31-
32-
[JsonSerializable(typeof(DurableExecutionInvocationInput))]
33-
[JsonSerializable(typeof(DurableExecutionInvocationOutput))]
34-
[JsonSerializable(typeof(DurableWorkflowInput))]
35-
[JsonSerializable(typeof(DurableWorkflowOutput))]
36-
[JsonSerializable(typeof(DurableStepResult))]
37-
internal partial class AotJsonSerializerContext : JsonSerializerContext;
3+
return;

0 commit comments

Comments
 (0)