-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPackage.swift
81 lines (77 loc) · 3.15 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// swift-tools-version:5.9
// ===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftAWSLambdaRuntime open source project
//
// Copyright (c) 2021 Apple Inc. and the SwiftAWSLambdaRuntime project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftAWSLambdaRuntime project authors
//
// SPDX-License-Identifier: Apache-2.0
//
// ===----------------------------------------------------------------------===//
import class Foundation.ProcessInfo // needed for CI to test the local version of the library
import PackageDescription
let package = Package(
name: "swift-aws-lambda-runtime-example",
platforms: [
.macOS(.v12),
],
products: [
.executable(name: "HttpApiLambda", targets: ["HttpApiLambda"]),
.executable(name: "SQSLambda", targets: ["SQSLambda"]),
.executable(name: "UrlLambda", targets: ["UrlLambda"]),
],
dependencies: [
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", branch: "main"),
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", branch: "main"),
],
targets: [
.executableTarget(
name: "HttpApiLambda",
dependencies: [
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"),
.product(name: "AWSLambdaEvents", package: "swift-aws-lambda-events"),
],
path: "./HttpApiLambda"
),
.executableTarget(
name: "UrlLambda",
dependencies: [
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"),
.product(name: "AWSLambdaEvents", package: "swift-aws-lambda-events"),
],
path: "./UrlLambda"
),
.executableTarget(
name: "SQSLambda",
dependencies: [
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"),
.product(name: "AWSLambdaEvents", package: "swift-aws-lambda-events"),
],
path: "./SQSLambda"
),
.testTarget(
name: "LambdaTests",
dependencies: [
"HttpApiLambda", "SQSLambda",
.product(name: "AWSLambdaTesting", package: "swift-aws-lambda-runtime"),
],
// testing data
resources: [
.process("data/apiv2.json"),
.process("data/sqs.json"),
]
),
]
)
// for CI to test the local version of the library
if ProcessInfo.processInfo.environment["LAMBDA_USE_LOCAL_DEPS"] != nil {
package.dependencies = [
.package(name: "swift-aws-lambda-runtime", path: "../.."),
// .package(url: "../../../swift-aws-lambda-runtime", branch: "sebsto/use_local_deps"), // to have the LAMBDA_USE_LOCAL_DEPS env var on plugin archive (temp until https://github.com/swift-server/swift-aws-lambda-runtime/pull/325 is merged)
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", branch: "main"),
]
}