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
59 lines
2.2 KiB
Swift
59 lines
2.2 KiB
Swift
// swift-tools-version: 6.2
|
|
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
|
|
|
import PackageDescription
|
|
|
|
// needed for CI to test the local version of the library
|
|
import struct Foundation.URL
|
|
|
|
let package = Package(
|
|
name: "LambdaWithServiceLifecycle",
|
|
platforms: [
|
|
.macOS(.v15)
|
|
],
|
|
dependencies: [
|
|
.package(url: "https://github.com/vapor/postgres-nio.git", from: "1.26.0"),
|
|
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
|
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "1.0.0"),
|
|
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.6.3"),
|
|
],
|
|
targets: [
|
|
.executableTarget(
|
|
name: "LambdaWithServiceLifecycle",
|
|
dependencies: [
|
|
.product(name: "PostgresNIO", package: "postgres-nio"),
|
|
.product(name: "ServiceLifecycle", package: "swift-service-lifecycle"),
|
|
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"),
|
|
.product(name: "AWSLambdaEvents", package: "swift-aws-lambda-events"),
|
|
]
|
|
)
|
|
]
|
|
)
|
|
|
|
if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
|
localDepsPath != "",
|
|
let v = try? URL(fileURLWithPath: localDepsPath).resourceValues(forKeys: [.isDirectoryKey]),
|
|
v.isDirectory == true
|
|
{
|
|
// when we use the local runtime as deps, let's remove the dependency added above
|
|
let indexToRemove = package.dependencies.firstIndex { dependency in
|
|
if case .sourceControl(
|
|
name: _,
|
|
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
|
requirement: _
|
|
) = dependency.kind {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
if let indexToRemove {
|
|
package.dependencies.remove(at: indexToRemove)
|
|
}
|
|
|
|
// then we add the dependency on LAMBDA_USE_LOCAL_DEPS' path (typically ../..)
|
|
print("[INFO] Compiling against swift-aws-lambda-runtime located at \(localDepsPath)")
|
|
package.dependencies += [
|
|
.package(name: "swift-aws-lambda-runtime", path: localDepsPath)
|
|
]
|
|
}
|