File tree Expand file tree Collapse file tree 2 files changed +8
-16
lines changed
Plugins/AWSLambdaPackager Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Original file line number Diff line number Diff line change 33import Foundation
44import PackageDescription
55
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-
146let package = Package (
157 name: " swift-aws-lambda-runtime-example " ,
168 platforms: [
@@ -19,7 +11,12 @@ let package = Package(
1911 products: [
2012 . executable( name: " MyLambda " , targets: [ " MyLambda " ] ) ,
2113 ] ,
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+ ] ,
2320 targets: [
2421 . executableTarget(
2522 name: " MyLambda " ,
Original file line number Diff line number Diff line change @@ -315,8 +315,8 @@ private struct Configuration: CustomStringConvertible {
315315 throw Errors . invalidArgument ( " --swift-version and --base-docker-image are mutually exclusive " )
316316 }
317317
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 "
320320
321321 if self . verboseLogging {
322322 print ( " ------------------------------------------------------------------------- " )
@@ -336,11 +336,6 @@ private struct Configuration: CustomStringConvertible {
336336 }
337337 """
338338 }
339-
340- #warning("FIXME: read this programmatically")
341- private static func getSwiftVersion( ) -> String {
342- " 5.6 "
343- }
344339}
345340
346341private enum Errors : Error {
You can’t perform that action at this time.
0 commit comments