Skip to content

Commit

Permalink
Swift: Update getting started example to build on Mac (awsdocs#6061)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shepazon authored and DavidSouther committed Feb 19, 2024
1 parent 2823a44 commit 568fdff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion swift/example_code/s3/ListBuckets-Simple/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 568fdff

Please sign in to comment.