Skip to content

Commit b17f6c0

Browse files
committed
Allow Swift 6.0 again
1 parent 7a57b74 commit b17f6c0

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed

[email protected]

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
// swift-tools-version:6.0
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "swift-aws-lambda-runtime",
7+
platforms: [.macOS(.v15)],
8+
products: [
9+
// this library exports `AWSLambdaRuntimeCore` and adds Foundation convenience methods
10+
.library(name: "AWSLambdaRuntime", targets: ["AWSLambdaRuntime"]),
11+
// plugin to package the lambda, creating an archive that can be uploaded to AWS
12+
// requires Linux or at least macOS v15
13+
.plugin(name: "AWSLambdaPackager", targets: ["AWSLambdaPackager"]),
14+
// for testing only
15+
.library(name: "AWSLambdaTesting", targets: ["AWSLambdaTesting"]),
16+
],
17+
traits: [
18+
"FoundationJSONSupport",
19+
"ServiceLifecycleSupport",
20+
"LocalServerSupport",
21+
.default(
22+
enabledTraits: [
23+
"FoundationJSONSupport",
24+
"ServiceLifecycleSupport",
25+
"LocalServerSupport",
26+
]
27+
)
28+
],
29+
dependencies: [
30+
.package(url: "https://github.com/apple/swift-nio.git", from: "2.81.0"),
31+
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.4"),
32+
.package(url: "https://github.com/apple/swift-collections.git", from: "1.1.4"),
33+
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.6.3"),
34+
],
35+
targets: [
36+
.target(
37+
name: "AWSLambdaRuntime",
38+
dependencies: [
39+
.product(name: "NIOCore", package: "swift-nio"),
40+
.product(name: "DequeModule", package: "swift-collections"),
41+
.product(name: "Logging", package: "swift-log"),
42+
.product(name: "NIOHTTP1", package: "swift-nio"),
43+
.product(name: "NIOPosix", package: "swift-nio"),
44+
.product(name: "ServiceLifecycle", package: "swift-service-lifecycle")
45+
],
46+
swiftSettings: [
47+
.define("FoundationJSONSupport"),
48+
.define("ServiceLifecycleSupport"),
49+
.define("LocalServerSupport"),
50+
]
51+
),
52+
.plugin(
53+
name: "AWSLambdaPackager",
54+
capability: .command(
55+
intent: .custom(
56+
verb: "archive",
57+
description:
58+
"Archive the Lambda binary and prepare it for uploading to AWS. Requires docker on macOS or non Amazonlinux 2 distributions."
59+
),
60+
permissions: [
61+
.allowNetworkConnections(
62+
scope: .docker,
63+
reason: "This plugin uses Docker to create the AWS Lambda ZIP package."
64+
)
65+
]
66+
)
67+
),
68+
.testTarget(
69+
name: "AWSLambdaRuntimeCoreTests",
70+
dependencies: [
71+
.byName(name: "AWSLambdaRuntime"),
72+
.product(name: "NIOTestUtils", package: "swift-nio"),
73+
.product(name: "NIOFoundationCompat", package: "swift-nio"),
74+
]
75+
),
76+
.testTarget(
77+
name: "AWSLambdaRuntimeTests",
78+
dependencies: [
79+
// .byName(name: "AWSLambdaRuntimeCore"),
80+
.byName(name: "AWSLambdaRuntime"),
81+
]
82+
),
83+
// testing helper
84+
.target(
85+
name: "AWSLambdaTesting",
86+
dependencies: [
87+
.byName(name: "AWSLambdaRuntime"),
88+
.product(name: "NIOCore", package: "swift-nio"),
89+
.product(name: "NIOPosix", package: "swift-nio"),
90+
]
91+
),
92+
.testTarget(
93+
name: "AWSLambdaTestingTests",
94+
dependencies: [
95+
.byName(name: "AWSLambdaTesting")
96+
]
97+
),
98+
// for perf testing
99+
.executableTarget(
100+
name: "MockServer",
101+
dependencies: [
102+
.product(name: "Logging", package: "swift-log"),
103+
.product(name: "NIOHTTP1", package: "swift-nio"),
104+
.product(name: "NIOCore", package: "swift-nio"),
105+
.product(name: "NIOPosix", package: "swift-nio"),
106+
]
107+
),
108+
]
109+
)

0 commit comments

Comments
 (0)