File tree 2 files changed +8
-16
lines changed
Plugins/AWSLambdaPackager
2 files changed +8
-16
lines changed Original file line number Diff line number Diff line change 3
3
import Foundation
4
4
import PackageDescription
5
5
6
- // this is the dependency on the swift-aws-lambda-runtime library
7
- var dependencies = [ Package . Dependency] ( )
8
- if FileManager . default. fileExists ( atPath: " ../../Package.swift " ) {
9
- dependencies. append ( Package . Dependency. package ( name: " swift-aws-lambda-runtime " , path: " ../.. " ) )
10
- } else {
11
- dependencies. append ( Package . Dependency. package ( url: " https://github.com/swift-server/swift-aws-lambda-runtime.git " , branch: " main " ) )
12
- }
13
-
14
6
let package = Package (
15
7
name: " swift-aws-lambda-runtime-example " ,
16
8
platforms: [
@@ -19,7 +11,12 @@ let package = Package(
19
11
products: [
20
12
. executable( name: " MyLambda " , targets: [ " MyLambda " ] ) ,
21
13
] ,
22
- dependencies: dependencies,
14
+ dependencies: [
15
+ // this is the dependency on the swift-aws-lambda-runtime library
16
+ // in real-world projects this would say
17
+ // .package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0")
18
+ . package ( name: " swift-aws-lambda-runtime " , path: " ../.. " ) ,
19
+ ] ,
23
20
targets: [
24
21
. executableTarget(
25
22
name: " MyLambda " ,
Original file line number Diff line number Diff line change @@ -315,8 +315,8 @@ private struct Configuration: CustomStringConvertible {
315
315
throw Errors . invalidArgument ( " --swift-version and --base-docker-image are mutually exclusive " )
316
316
}
317
317
318
- let swiftVersion = swiftVersionArgument. first ?? Self . getSwiftVersion ( )
319
- self . baseDockerImage = baseDockerImageArgument. first ?? " swift: \( swiftVersion) - amazonlinux2"
318
+ let swiftVersion = swiftVersionArgument. first ?? . none // undefined version will yield the latest docker image
319
+ self . baseDockerImage = baseDockerImageArgument. first ?? " swift: \( swiftVersion. map { $0 + " - " } ?? " " ) amazonlinux2 "
320
320
321
321
if self . verboseLogging {
322
322
print ( " ------------------------------------------------------------------------- " )
@@ -336,11 +336,6 @@ private struct Configuration: CustomStringConvertible {
336
336
}
337
337
"""
338
338
}
339
-
340
- #warning("FIXME: read this programmatically")
341
- private static func getSwiftVersion( ) -> String {
342
- " 5.6 "
343
- }
344
339
}
345
340
346
341
private enum Errors : Error {
You can’t perform that action at this time.
0 commit comments