mirror of
https://github.com/swift-server/swift-aws-lambda-runtime.git
synced 2026-05-03 07:22:27 +00:00
a1ab8df708
In preparation for the 2.0.0 GA release, - Update `.swift-version`, `Package.swift` and all examples' `package.swift` to Swift 6.2 - Update all references to `2.0.0-beta.3` to `2.0.0`. This includes the doc and readme, but also the dependencies in the examples `Package.swift`. This will temporary break the build of the examples, until we tag v2.0.0. Note the CI will not be affected as its consumes the local version of the library - [CI] Use Swift-6.2-noble for all testing tasks - Reinstate the script to generate the contributors list and update the list
94 lines
3.4 KiB
Swift
94 lines
3.4 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: [
|
|
"FoundationJSONSupport",
|
|
"ServiceLifecycleSupport",
|
|
"LocalServerSupport",
|
|
.default(
|
|
enabledTraits: [
|
|
"FoundationJSONSupport",
|
|
"ServiceLifecycleSupport",
|
|
"LocalServerSupport",
|
|
]
|
|
),
|
|
],
|
|
dependencies: [
|
|
.package(url: "https://github.com/apple/swift-nio.git", from: "2.81.0"),
|
|
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.4"),
|
|
.package(url: "https://github.com/apple/swift-collections.git", from: "1.1.4"),
|
|
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.8.0"),
|
|
],
|
|
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
|
|
),
|
|
]
|
|
)
|