Skip to content

Commit 98a23b6

Browse files
authored
DocC setup (#270)
1 parent 568897c commit 98a23b6

13 files changed

+534
-78
lines changed

Package.swift

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.4
1+
// swift-tools-version:5.6
22

33
import PackageDescription
44

@@ -9,13 +9,16 @@ let package = Package(
99
.library(name: "AWSLambdaRuntime", targets: ["AWSLambdaRuntime"]),
1010
// this has all the main functionality for lambda and it does not link Foundation
1111
.library(name: "AWSLambdaRuntimeCore", targets: ["AWSLambdaRuntimeCore"]),
12+
// plugin to package the lambda, creating an archive that can be uploaded to AWS
13+
.plugin(name: "AWSLambdaPackager", targets: ["AWSLambdaPackager"]),
1214
// for testing only
1315
.library(name: "AWSLambdaTesting", targets: ["AWSLambdaTesting"]),
1416
],
1517
dependencies: [
1618
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.33.0")),
1719
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.4.2")),
1820
.package(url: "https://github.com/swift-server/swift-backtrace.git", .upToNextMajor(from: "1.2.3")),
21+
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
1922
],
2023
targets: [
2124
.target(name: "AWSLambdaRuntime", dependencies: [
@@ -31,6 +34,15 @@ let package = Package(
3134
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
3235
.product(name: "NIOPosix", package: "swift-nio"),
3336
]),
37+
.plugin(
38+
name: "AWSLambdaPackager",
39+
capability: .command(
40+
intent: .custom(
41+
verb: "archive",
42+
description: "Archive the Lambda binary and prepare it for uploading to AWS. Requires docker on macOS or non Amazonlinux 2 distributions."
43+
)
44+
)
45+
),
3446
.testTarget(name: "AWSLambdaRuntimeCoreTests", dependencies: [
3547
.byName(name: "AWSLambdaRuntimeCore"),
3648
.product(name: "NIOTestUtils", package: "swift-nio"),
@@ -47,7 +59,7 @@ let package = Package(
4759
]),
4860
.testTarget(name: "AWSLambdaTestingTests", dependencies: ["AWSLambdaTesting"]),
4961
// for perf testing
50-
.target(name: "MockServer", dependencies: [
62+
.executableTarget(name: "MockServer", dependencies: [
5163
.product(name: "NIOHTTP1", package: "swift-nio"),
5264
.product(name: "NIO", package: "swift-nio"),
5365
]),

Package@swift-5.6.swift renamed to Package@swift-5.4.swift

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.6
1+
// swift-tools-version:5.4
22

33
import PackageDescription
44

@@ -9,8 +9,6 @@ let package = Package(
99
.library(name: "AWSLambdaRuntime", targets: ["AWSLambdaRuntime"]),
1010
// this has all the main functionality for lambda and it does not link Foundation
1111
.library(name: "AWSLambdaRuntimeCore", targets: ["AWSLambdaRuntimeCore"]),
12-
// plugin to package the lambda, creating an archive that can be uploaded to AWS
13-
.plugin(name: "AWSLambdaPackager", targets: ["AWSLambdaPackager"]),
1412
// for testing only
1513
.library(name: "AWSLambdaTesting", targets: ["AWSLambdaTesting"]),
1614
],
@@ -33,15 +31,6 @@ let package = Package(
3331
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
3432
.product(name: "NIOPosix", package: "swift-nio"),
3533
]),
36-
.plugin(
37-
name: "AWSLambdaPackager",
38-
capability: .command(
39-
intent: .custom(
40-
verb: "archive",
41-
description: "Archive the Lambda binary and prepare it for uploading to AWS. Requires docker on macOS or non Amazonlinux 2 distributions."
42-
)
43-
)
44-
),
4534
.testTarget(name: "AWSLambdaRuntimeCoreTests", dependencies: [
4635
.byName(name: "AWSLambdaRuntimeCore"),
4736
.product(name: "NIOTestUtils", package: "swift-nio"),
@@ -58,7 +47,7 @@ let package = Package(
5847
]),
5948
.testTarget(name: "AWSLambdaTestingTests", dependencies: ["AWSLambdaTesting"]),
6049
// for perf testing
61-
.executableTarget(name: "MockServer", dependencies: [
50+
.target(name: "MockServer", dependencies: [
6251
.product(name: "NIOHTTP1", package: "swift-nio"),
6352
.product(name: "NIO", package: "swift-nio"),
6453
]),

Package@swift-5.5.swift

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// swift-tools-version:5.4
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "swift-aws-lambda-runtime",
7+
products: [
8+
// this library exports `AWSLambdaRuntimeCore` and adds Foundation convenience methods
9+
.library(name: "AWSLambdaRuntime", targets: ["AWSLambdaRuntime"]),
10+
// this has all the main functionality for lambda and it does not link Foundation
11+
.library(name: "AWSLambdaRuntimeCore", targets: ["AWSLambdaRuntimeCore"]),
12+
// for testing only
13+
.library(name: "AWSLambdaTesting", targets: ["AWSLambdaTesting"]),
14+
],
15+
dependencies: [
16+
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.33.0")),
17+
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.4.2")),
18+
.package(url: "https://github.com/swift-server/swift-backtrace.git", .upToNextMajor(from: "1.2.3")),
19+
],
20+
targets: [
21+
.target(name: "AWSLambdaRuntime", dependencies: [
22+
.byName(name: "AWSLambdaRuntimeCore"),
23+
.product(name: "NIOCore", package: "swift-nio"),
24+
.product(name: "NIOFoundationCompat", package: "swift-nio"),
25+
]),
26+
.target(name: "AWSLambdaRuntimeCore", dependencies: [
27+
.product(name: "Logging", package: "swift-log"),
28+
.product(name: "Backtrace", package: "swift-backtrace"),
29+
.product(name: "NIOHTTP1", package: "swift-nio"),
30+
.product(name: "NIOCore", package: "swift-nio"),
31+
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
32+
.product(name: "NIOPosix", package: "swift-nio"),
33+
]),
34+
.testTarget(name: "AWSLambdaRuntimeCoreTests", dependencies: [
35+
.byName(name: "AWSLambdaRuntimeCore"),
36+
.product(name: "NIOTestUtils", package: "swift-nio"),
37+
.product(name: "NIOFoundationCompat", package: "swift-nio"),
38+
]),
39+
.testTarget(name: "AWSLambdaRuntimeTests", dependencies: [
40+
.byName(name: "AWSLambdaRuntimeCore"),
41+
.byName(name: "AWSLambdaRuntime"),
42+
]),
43+
// testing helper
44+
.target(name: "AWSLambdaTesting", dependencies: [
45+
.byName(name: "AWSLambdaRuntime"),
46+
.product(name: "NIO", package: "swift-nio"),
47+
]),
48+
.testTarget(name: "AWSLambdaTestingTests", dependencies: ["AWSLambdaTesting"]),
49+
// for perf testing
50+
.target(name: "MockServer", dependencies: [
51+
.product(name: "NIOHTTP1", package: "swift-nio"),
52+
.product(name: "NIO", package: "swift-nio"),
53+
]),
54+
]
55+
)

0 commit comments

Comments
 (0)