-
Notifications
You must be signed in to change notification settings - Fork 113
Apply package traits #490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply package traits #490
Changes from all commits
534b34a
789792a
3403c59
d106ab2
df50337
438f4cb
b21fffa
7ea52d2
ac1b2fb
c4255e9
137ff13
8bf647d
3271584
701141c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version: 1 | ||
builder: | ||
configs: | ||
- documentation_targets: [AWSLambdaRuntimeCore, AWSLambdaRuntime] | ||
- documentation_targets: [AWSLambdaRuntime] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// swift-tools-version:6.0 | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "swift-aws-lambda-runtime", | ||
platforms: [.macOS(.v15)], | ||
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"]), | ||
// for testing only | ||
.library(name: "AWSLambdaTesting", targets: ["AWSLambdaTesting"]), | ||
], | ||
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.6.3"), | ||
], | ||
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"), | ||
], | ||
swiftSettings: [ | ||
.define("FoundationJSONSupport"), | ||
.define("ServiceLifecycleSupport"), | ||
.define("LocalServerSupport"), | ||
] | ||
), | ||
.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: "AWSLambdaRuntimeCoreTests", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that AWSLambdaRuntimeCore doesn't exist, we should merge the tests too There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's do this in a follow up to keep the changes as small as possible. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, let be sure we file an issue to track this otherwise it might stay like this forever :-) |
||
dependencies: [ | ||
.byName(name: "AWSLambdaRuntime"), | ||
.product(name: "NIOTestUtils", package: "swift-nio"), | ||
.product(name: "NIOFoundationCompat", package: "swift-nio"), | ||
] | ||
), | ||
.testTarget( | ||
name: "AWSLambdaRuntimeTests", | ||
dependencies: [ | ||
.byName(name: "AWSLambdaRuntime") | ||
] | ||
), | ||
// testing helper | ||
.target( | ||
name: "AWSLambdaTesting", | ||
dependencies: [ | ||
.byName(name: "AWSLambdaRuntime"), | ||
.product(name: "NIOCore", package: "swift-nio"), | ||
.product(name: "NIOPosix", package: "swift-nio"), | ||
] | ||
), | ||
.testTarget( | ||
name: "AWSLambdaTestingTests", | ||
dependencies: [ | ||
.byName(name: "AWSLambdaTesting") | ||
] | ||
), | ||
// 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"), | ||
] | ||
), | ||
] | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# ``AWSLambdaRuntimeCore`` | ||
# ``AWSLambdaRuntime`` | ||
|
||
An AWS Lambda runtime for the Swift programming language | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
2025-01-02T14:59:29+0100 info LocalLambdaServer : [AWSLambdaRuntimeCore] | ||
2025-01-02T14:59:29+0100 info LocalLambdaServer : [AWSLambdaRuntime] | ||
LocalLambdaServer started and listening on 127.0.0.1:7000, receiving events on /invoke |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I don't know if this needs the
support
suffix but not feeling too strongly