From ff6f1e8c79849537be43a7a5350bf687f64b8854 Mon Sep 17 00:00:00 2001 From: Eric Shepherd Date: Tue, 6 Feb 2024 21:14:42 +0000 Subject: [PATCH] Update example for getting started to build on Mac Fixed some minor issues preventing Mac builds of the ListBuckets-Simple S3 example. These changes will need to be replicated across all examples, but this is being pushed first because it is a dependency of a documentation update. This example is embedded in fragments inline in the Swift SDK developer guide's "Get started" page. *Changes* * Added the `platforms` block to the `Package.swift` file. This is needed to build for Apple platforms, and was removed from all examples by mistake during a cleanup pass many months ago. * Renamed the `main.swift` file to `entry.swift`. This works around a known bug in the Swift build chain when the main program uses asynchronous code. --- swift/example_code/s3/ListBuckets-Simple/Package.swift | 9 ++++++++- .../Sources/{main.swift => entry.swift} | 0 2 files changed, 8 insertions(+), 1 deletion(-) rename swift/example_code/s3/ListBuckets-Simple/Sources/{main.swift => entry.swift} (100%) diff --git a/swift/example_code/s3/ListBuckets-Simple/Package.swift b/swift/example_code/s3/ListBuckets-Simple/Package.swift index 9c7910ce516..94634a9265c 100644 --- a/swift/example_code/s3/ListBuckets-Simple/Package.swift +++ b/swift/example_code/s3/ListBuckets-Simple/Package.swift @@ -11,12 +11,19 @@ import PackageDescription let package = Package( name: "ListBuckets-Simple", + // snippet-start:[s3.swift.intro.package-platforms] + // Let Xcode know the minimum Apple platforms supported. + platforms: [ + .macOS(.v11), + .iOS(.v13) + ], + // snippet-end:[s3.swift.intro.package-platforms] // snippet-start:[s3.swift.intro.package-dependencies] dependencies: [ // Dependencies declare other packages that this package depends on. .package( url: "https://github.com/awslabs/aws-sdk-swift", - from: "0.17.0" + from: "0.32.0" ) ], // snippet-end:[s3.swift.intro.package-dependencies] diff --git a/swift/example_code/s3/ListBuckets-Simple/Sources/main.swift b/swift/example_code/s3/ListBuckets-Simple/Sources/entry.swift similarity index 100% rename from swift/example_code/s3/ListBuckets-Simple/Sources/main.swift rename to swift/example_code/s3/ListBuckets-Simple/Sources/entry.swift