Files
Sébastien Stormacq 748ced263c update dependencies (#651)
Update dependencies to fetch swift-async-algorithms 1.1.2

Co-authored-by: Sebastien Stormacq <stormacq@amazon.lu>
2026-02-24 10:50:07 +01:00

96 lines
3.5 KiB
Swift

// swift-tools-version:6.2
import PackageDescription
let defaultSwiftSettings: [SwiftSetting] =
[
.enableExperimentalFeature(
"AvailabilityMacro=LambdaSwift 2.0:macOS 15.0"
)
]
let package = Package(
name: "swift-aws-lambda-runtime",
products: [
.library(name: "AWSLambdaRuntime", targets: ["AWSLambdaRuntime"]),
// plugin to package the lambda, creating an archive that can be uploaded to AWS
// requires Linux or at least macOS v15
.plugin(name: "AWSLambdaPackager", targets: ["AWSLambdaPackager"]),
],
traits: [
"ManagedRuntimeSupport",
"FoundationJSONSupport",
"ServiceLifecycleSupport",
"LocalServerSupport",
.default(
enabledTraits: [
"ManagedRuntimeSupport",
"FoundationJSONSupport",
"ServiceLifecycleSupport",
"LocalServerSupport",
]
),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.95.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.10.1"),
.package(url: "https://github.com/apple/swift-collections.git", from: "1.3.0"),
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.10.1"),
],
targets: [
.target(
name: "AWSLambdaRuntime",
dependencies: [
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "DequeModule", package: "swift-collections"),
.product(name: "Logging", package: "swift-log"),
.product(name: "NIOHTTP1", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(
name: "ServiceLifecycle",
package: "swift-service-lifecycle",
condition: .when(traits: ["ServiceLifecycleSupport"])
),
],
swiftSettings: defaultSwiftSettings
),
.plugin(
name: "AWSLambdaPackager",
capability: .command(
intent: .custom(
verb: "archive",
description:
"Archive the Lambda binary and prepare it for uploading to AWS. Requires docker on macOS or non Amazonlinux 2 distributions."
),
permissions: [
.allowNetworkConnections(
scope: .docker,
reason: "This plugin uses Docker to create the AWS Lambda ZIP package."
)
]
)
),
.testTarget(
name: "AWSLambdaRuntimeTests",
dependencies: [
.byName(name: "AWSLambdaRuntime"),
.product(name: "NIOTestUtils", package: "swift-nio"),
.product(name: "NIOFoundationCompat", package: "swift-nio"),
],
swiftSettings: defaultSwiftSettings
),
// for perf testing
.executableTarget(
name: "MockServer",
dependencies: [
.product(name: "Logging", package: "swift-log"),
.product(name: "NIOHTTP1", package: "swift-nio"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
],
swiftSettings: defaultSwiftSettings
),
]
)