From 63cee21bbf16338e512807ec5a4e4ca2f153eadb Mon Sep 17 00:00:00 2001 From: sja26 Date: Thu, 11 Aug 2022 12:35:37 +0100 Subject: [PATCH 1/3] Fix compiler warning 'MyLambda' was identified as an executable target given the presence of a 'main.swift' file. Starting with tools version 5.4.0 executable targets should be declared as 'executableTarget()' --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index a76016b7..77f82165 100644 --- a/readme.md +++ b/readme.md @@ -30,7 +30,7 @@ First, create a SwiftPM project and pull Swift AWS Lambda Runtime as dependency .package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "0.1.0"), ], targets: [ - .target(name: "MyLambda", dependencies: [ + .executableTarget(name: "MyLambda", dependencies: [ .product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"), ]), ] @@ -94,7 +94,7 @@ First, add a dependency on the event packages: .package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "0.1.0"), ], targets: [ - .target(name: "MyLambda", dependencies: [ + .executableTarget(name: "MyLambda", dependencies: [ .product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"), .product(name: "AWSLambdaEvents", package: "swift-aws-lambda-events"), ]), From 59c55ec6fff4424ac7df3e6f6b1f266b64b6b028 Mon Sep 17 00:00:00 2001 From: sja26 Date: Thu, 11 Aug 2022 12:36:03 +0100 Subject: [PATCH 2/3] Fix package dependency for swift-aws-lambda-events The swift-aws-lambda-events repo has not yet pushed tag 0.1.0 so the build fails, see output from swift build: Computing version for https://github.com/swift-server/swift-aws-lambda-events.git error: Dependencies could not be resolved because no versions of 'swift-aws-lambda-events' match the requirement 0.1.0..<1.0.0 and root depends on 'swift-aws-lambda-events' 0.1.0..<1.0.0. This commit adds the workaround mentioned in the issue for the missing tag https://github.com/swift-server/swift-aws-lambda-events/issues/3 --- readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 77f82165..abed6d77 100644 --- a/readme.md +++ b/readme.md @@ -91,7 +91,9 @@ First, add a dependency on the event packages: ], dependencies: [ .package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "0.1.0"), - .package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "0.1.0"), +// Uncomment and replace with the line below when tag "0.1.0" is published, until then use `branch` parameter. +// .package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "0.1.0"), + .package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", branch: "main"), ], targets: [ .executableTarget(name: "MyLambda", dependencies: [ From 35920aca3018fd69b5cf55abe5fa81e619e2f6f3 Mon Sep 17 00:00:00 2001 From: sja26 Date: Thu, 11 Aug 2022 14:19:14 +0100 Subject: [PATCH 3/3] Fix multiple products and targets build error --- readme.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/readme.md b/readme.md index abed6d77..1fef39e2 100644 --- a/readme.md +++ b/readme.md @@ -91,14 +91,11 @@ First, add a dependency on the event packages: ], dependencies: [ .package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "0.1.0"), -// Uncomment and replace with the line below when tag "0.1.0" is published, until then use `branch` parameter. -// .package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "0.1.0"), - .package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", branch: "main"), ], targets: [ .executableTarget(name: "MyLambda", dependencies: [ .product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"), - .product(name: "AWSLambdaEvents", package: "swift-aws-lambda-events"), + .product(name: "AWSLambdaEvents", package: "swift-aws-lambda-runtime"), ]), ] )