Skip to content

Commit 0e494ce

Browse files
committed
chore: update package references and convert to project references
- Update Amazon.Lambda.Core from 2.5.0 to 2.8.0 across documentation and examples - Convert AWS Lambda Powertools PackageReferences to ProjectReferences in AOT examples (Logging, Metrics, Tracing) - Update CI/CD workflow to handle both PackageReference updates and ProjectReference conversions - Consolidate ItemGroup elements in example project files for better organization - Update migration guide and AOT documentation with latest dependency versions - Align all example projects to use local project references instead of NuGet packages for development consistency
1 parent d081d3b commit 0e494ce

File tree

18 files changed

+68
-33
lines changed

18 files changed

+68
-33
lines changed

.github/workflows/publish-artifacts-examples-tests.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,18 @@ jobs:
9292
packageName=$(basename $package .nupkg | sed -E 's/(.*)\.([0-9]+\.[0-9]+\.[0-9]+.*)$/\1/')
9393
packageVersion=$(basename $package .nupkg | sed -E 's/(.*)\.([0-9]+\.[0-9]+\.[0-9]+.*)$/\2/')
9494
95-
# Check if project references this package
95+
# Check if project references this package via PackageReference
9696
if grep -q "<PackageReference.*Include=\"$packageName\"" "$project"; then
97-
echo " - Updating $packageName to version $packageVersion"
98-
# Use --no-restore to avoid restoring during each add
97+
echo " - Updating PackageReference $packageName to version $packageVersion"
98+
dotnet add "$project" package "$packageName" --version "$packageVersion" --source "local" --no-restore
99+
fi
100+
101+
# Check if project references this package via ProjectReference and convert to PackageReference
102+
if grep -q "<ProjectReference.*$packageName.csproj" "$project"; then
103+
echo " - Converting ProjectReference $packageName to PackageReference version $packageVersion"
104+
# Remove the ProjectReference line
105+
sed -i "/<ProjectReference.*$packageName.csproj/d" "$project"
106+
# Add PackageReference
99107
dotnet add "$project" package "$packageName" --version "$packageVersion" --source "local" --no-restore
100108
fi
101109
done

docs/getting-started/logger/aot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public partial class LambdaFunctionJsonSerializerContext : JsonSerializerContext
173173

174174
<ItemGroup>
175175
<PackageReference Include="Amazon.Lambda.RuntimeSupport" Version="1.12.0"/>
176-
<PackageReference Include="Amazon.Lambda.Core" Version="2.5.0"/>
176+
<PackageReference Include="Amazon.Lambda.Core" Version="2.8.0"/>
177177
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.4"/>
178178
<PackageReference Include="AWS.Lambda.Powertools.Logging" Version="2.0.0"/>
179179
</ItemGroup>

docs/migration-guide-v3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Migrate from AWS SDK v3 to v4. Update package references in your `.csproj`:
5656
**After (v3):**
5757
```xml
5858
<ItemGroup>
59-
<PackageReference Include="Amazon.Lambda.Core" Version="2.7.0" />
59+
<PackageReference Include="Amazon.Lambda.Core" Version="2.8.0" />
6060
<PackageReference Include="AWSSDK.Core" Version="4.0.*" />
6161
<PackageReference Include="AWSSDK.DynamoDBv2" Version="4.0.*" />
6262
<PackageReference Include="AWSSDK.S3" Version="4.0.*" />

examples/AOT/AOT_Logging/src/AOT_Logging/AOT_Logging.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<PackageReference Include="Amazon.Lambda.RuntimeSupport" Version="1.14.1" />
2121
<PackageReference Include="Amazon.Lambda.Core" Version="2.8.0" />
2222
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.4"/>
23-
<PackageReference Include="AWS.Lambda.Powertools.Logging" Version="3.0.2" />
23+
</ItemGroup>
24+
<ItemGroup>
25+
<ProjectReference Include="..\..\..\..\..\libraries\src\AWS.Lambda.Powertools.Logging\AWS.Lambda.Powertools.Logging.csproj" />
2426
</ItemGroup>
2527
</Project>

examples/AOT/AOT_Metrics/src/AOT_Metrics/AOT_Metrics.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<PackageReference Include="Amazon.Lambda.RuntimeSupport" Version="1.14.1" />
2121
<PackageReference Include="Amazon.Lambda.Core" Version="2.8.0" />
2222
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.4"/>
23-
<PackageReference Include="AWS.Lambda.Powertools.Metrics" Version="3.0.2" />
23+
</ItemGroup>
24+
<ItemGroup>
25+
<ProjectReference Include="..\..\..\..\..\libraries\src\AWS.Lambda.Powertools.Metrics\AWS.Lambda.Powertools.Metrics.csproj" />
2426
</ItemGroup>
2527
</Project>

examples/AOT/AOT_Tracing/src/AOT_Tracing/AOT_Tracing.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<PackageReference Include="Amazon.Lambda.RuntimeSupport" Version="1.14.1" />
2121
<PackageReference Include="Amazon.Lambda.Core" Version="2.8.0" />
2222
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.4"/>
23-
<PackageReference Include="AWS.Lambda.Powertools.Tracing" Version="3.0.2" />
23+
</ItemGroup>
24+
<ItemGroup>
25+
<ProjectReference Include="..\..\..\..\..\libraries\src\AWS.Lambda.Powertools.Tracing\AWS.Lambda.Powertools.Tracing.csproj" />
2426
</ItemGroup>
2527
</Project>

examples/BatchProcessing/src/HelloWorld/HelloWorld.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
<ItemGroup>
88
<PackageReference Include="Amazon.Lambda.Core" Version="2.8.0" />
99
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.4" />
10-
<!-- <PackageReference Include="AWS.Lambda.Powertools.BatchProcessing" Version="3.0.0" />-->
11-
<PackageReference Include="AWS.Lambda.Powertools.Logging" Version="3.0.0" />
1210
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
1311
</ItemGroup>
1412
<ItemGroup>
15-
<ProjectReference Include="..\..\..\..\libraries\src\AWS.Lambda.Powertools.BatchProcessing\AWS.Lambda.Powertools.BatchProcessing.csproj" />
13+
<ProjectReference Include="..\..\..\..\libraries\src\AWS.Lambda.Powertools.BatchProcessing\AWS.Lambda.Powertools.BatchProcessing.csproj" />
14+
<ProjectReference Include="..\..\..\..\libraries\src\AWS.Lambda.Powertools.Logging\AWS.Lambda.Powertools.Logging.csproj" />
1615
</ItemGroup>
1716
</Project>

examples/Event Handler/BedrockAgentFunction/src/BedrockAgentFunction.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
</PropertyGroup>
1414
<ItemGroup>
1515
<PackageReference Include="Amazon.Lambda.RuntimeSupport" Version="1.12.0" />
16-
<PackageReference Include="Amazon.Lambda.Core" Version="2.5.0" />
16+
<PackageReference Include="Amazon.Lambda.Core" Version="2.8.0" />
1717
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.4" />
18-
<PackageReference Include="AWS.Lambda.Powertools.EventHandler.Resolvers.BedrockAgentFunction" Version="1.0.0-alpha.3" />
1918
<PackageReference Include="AWSSDK.GeoPlaces" Version="4.0.0.4" />
20-
<PackageReference Include="AWS.Lambda.Powertools.Logging" Version="2.0.0" />
19+
</ItemGroup>
20+
<ItemGroup>
21+
<ProjectReference Include="..\..\..\..\..\libraries\src\AWS.Lambda.Powertools.EventHandler.Resolvers.BedrockAgentFunction\AWS.Lambda.Powertools.EventHandler.Resolvers.BedrockAgentFunction.csproj" />
22+
<ProjectReference Include="..\..\..\..\..\libraries\src\AWS.Lambda.Powertools.Logging\AWS.Lambda.Powertools.Logging.csproj" />
2123
</ItemGroup>
2224
</Project>

examples/Idempotency/src/HelloWorld/HelloWorld.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
<PackageReference Include="Amazon.Lambda.Core" Version="2.8.0" />
99
<PackageReference Include="Amazon.Lambda.APIGatewayEvents" Version="2.7.3" />
1010
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.4" />
11-
<PackageReference Include="AWS.Lambda.Powertools.Idempotency" Version="3.0.2" />
12-
<PackageReference Include="AWS.Lambda.Powertools.Logging" Version="3.0.2" />
11+
</ItemGroup>
12+
<ItemGroup>
13+
<ProjectReference Include="..\..\..\..\libraries\src\AWS.Lambda.Powertools.Idempotency\AWS.Lambda.Powertools.Idempotency.csproj" />
14+
<ProjectReference Include="..\..\..\..\libraries\src\AWS.Lambda.Powertools.Logging\AWS.Lambda.Powertools.Logging.csproj" />
1315
</ItemGroup>
1416
</Project>

examples/Kafka/Avro/src/Avro.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
<PackageReference Include="Amazon.Lambda.RuntimeSupport" Version="1.14.1" />
1919
<PackageReference Include="Amazon.Lambda.Core" Version="2.8.0" />
2020
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.4"/>
21-
<PackageReference Include="AWS.Lambda.Powertools.Logging" Version="3.0.2" />
22-
<PackageReference Include="AWS.Lambda.Powertools.Kafka.Avro" Version="3.0.2" />
21+
</ItemGroup>
22+
<ItemGroup>
23+
<ProjectReference Include="..\..\..\..\libraries\src\AWS.Lambda.Powertools.Logging\AWS.Lambda.Powertools.Logging.csproj" />
24+
<ProjectReference Include="..\..\..\..\libraries\src\AWS.Lambda.Powertools.Kafka.Avro\AWS.Lambda.Powertools.Kafka.Avro.csproj" />
2325
</ItemGroup>
2426
<Target Name="GenerateAvroClasses" BeforeTargets="CoreCompile">
2527
<Exec Command="avrogen -s $(ProjectDir)CustomerProfile.avsc $(ProjectDir)Generated"/>

0 commit comments

Comments
 (0)