|
| 1 | +// swift-tools-version:5.7 |
| 2 | + |
| 3 | +import PackageDescription |
| 4 | + |
| 5 | +let package = Package( |
| 6 | + name: "swift-aws-lambda-runtime", |
| 7 | + platforms: [ |
| 8 | + .macOS(.v12), |
| 9 | + .iOS(.v15), |
| 10 | + .tvOS(.v15), |
| 11 | + .watchOS(.v8), |
| 12 | + ], |
| 13 | + products: [ |
| 14 | + // this library exports `AWSLambdaRuntimeCore` and adds Foundation convenience methods |
| 15 | + .library(name: "AWSLambdaRuntime", targets: ["AWSLambdaRuntime"]), |
| 16 | + // this has all the main functionality for lambda and it does not link Foundation |
| 17 | + .library(name: "AWSLambdaRuntimeCore", targets: ["AWSLambdaRuntimeCore"]), |
| 18 | + // plugin to package the lambda, creating an archive that can be uploaded to AWS |
| 19 | + .plugin(name: "AWSLambdaPackager", targets: ["AWSLambdaPackager"]), |
| 20 | + // for testing only |
| 21 | + .library(name: "AWSLambdaTesting", targets: ["AWSLambdaTesting"]), |
| 22 | + ], |
| 23 | + dependencies: [ |
| 24 | + .package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.43.1")), |
| 25 | + .package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.4.2")), |
| 26 | + .package(url: "https://github.com/swift-server/swift-backtrace.git", .upToNextMajor(from: "1.2.3")), |
| 27 | + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"), |
| 28 | + ], |
| 29 | + targets: [ |
| 30 | + .target(name: "AWSLambdaRuntime", dependencies: [ |
| 31 | + .byName(name: "AWSLambdaRuntimeCore"), |
| 32 | + .product(name: "NIOCore", package: "swift-nio"), |
| 33 | + .product(name: "NIOFoundationCompat", package: "swift-nio"), |
| 34 | + ]), |
| 35 | + .target(name: "AWSLambdaRuntimeCore", dependencies: [ |
| 36 | + .product(name: "Logging", package: "swift-log"), |
| 37 | + .product(name: "Backtrace", package: "swift-backtrace"), |
| 38 | + .product(name: "NIOHTTP1", package: "swift-nio"), |
| 39 | + .product(name: "NIOCore", package: "swift-nio"), |
| 40 | + .product(name: "NIOConcurrencyHelpers", package: "swift-nio"), |
| 41 | + .product(name: "NIOPosix", package: "swift-nio"), |
| 42 | + ]), |
| 43 | + .plugin( |
| 44 | + name: "AWSLambdaPackager", |
| 45 | + capability: .command( |
| 46 | + intent: .custom( |
| 47 | + verb: "archive", |
| 48 | + description: "Archive the Lambda binary and prepare it for uploading to AWS. Requires docker on macOS or non Amazonlinux 2 distributions." |
| 49 | + ) |
| 50 | + ) |
| 51 | + ), |
| 52 | + .testTarget(name: "AWSLambdaRuntimeCoreTests", dependencies: [ |
| 53 | + .byName(name: "AWSLambdaRuntimeCore"), |
| 54 | + .product(name: "NIOTestUtils", package: "swift-nio"), |
| 55 | + .product(name: "NIOFoundationCompat", package: "swift-nio"), |
| 56 | + ]), |
| 57 | + .testTarget(name: "AWSLambdaRuntimeTests", dependencies: [ |
| 58 | + .byName(name: "AWSLambdaRuntimeCore"), |
| 59 | + .byName(name: "AWSLambdaRuntime"), |
| 60 | + ]), |
| 61 | + // testing helper |
| 62 | + .target(name: "AWSLambdaTesting", dependencies: [ |
| 63 | + .byName(name: "AWSLambdaRuntime"), |
| 64 | + .product(name: "NIO", package: "swift-nio"), |
| 65 | + ]), |
| 66 | + .testTarget(name: "AWSLambdaTestingTests", dependencies: ["AWSLambdaTesting"]), |
| 67 | + // for perf testing |
| 68 | + .executableTarget(name: "MockServer", dependencies: [ |
| 69 | + .product(name: "NIOHTTP1", package: "swift-nio"), |
| 70 | + .product(name: "NIO", package: "swift-nio"), |
| 71 | + ]), |
| 72 | + ] |
| 73 | +) |
0 commit comments