Skip to content

Commit

Permalink
Add support for Swift 5.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vzsg committed Nov 15, 2023
1 parent 74b0bce commit 90e3eb1
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ $ heroku create --buildpack vapor/vapor

$ git push heroku master
remote: -----> Swift app detected
remote: -----> Using Swift 5.9 (default)
remote: -----> Using built-in clang (Swift 5.9)
remote: -----> Using Swift 5.9.1 (default)
remote: -----> Using built-in clang (Swift 5.9.1)
remote: -----> Installing swiftenv
remote: -----> Installing Swift 5.9
remote: -----> Installing Swift 5.9.1
...
```

Expand Down Expand Up @@ -50,7 +50,7 @@ web: Run --env=production --port=$PORT

### Specify a Swift version

The buildpack defaults to Swift 5.9 and will be updated when new Swift versions are released.
The buildpack defaults to Swift 5.9.1 and will be updated when new Swift versions are released.

If you need to use a specific version of the Swift toolchain, including older versions – for example Swift 4.2.x to retain compatibility with Swift 3 projects, or a previous version as you run into issues with the latest – you can pin any version number using a file called `.swift-version` in the root of the project folder, or by setting a `SWIFT_VERSION` configuration variable on Heroku, then deploying again.

Expand Down
2 changes: 1 addition & 1 deletion bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ENV_DIR=$3

CLANG_VERSION=7.0.1

SWIFT_VERSION="5.9"
SWIFT_VERSION="5.9.1"
SWIFT_BUILD_CONFIGURATION="release"
SWIFT_BUILD_FLAGS=""

Expand Down
38 changes: 38 additions & 0 deletions swiftenv/share/swiftenv-install/5.9.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
case "$PLATFORM" in
'osx' )
URL="https://swift.org/builds/swift-5.9.1-release/xcode/swift-5.9.1-RELEASE/swift-5.9.1-RELEASE-osx.pkg"
;;

'ubuntu14.04' )
echo
echo " ! Swift 5.9.1 does not support Ubuntu 14.04."
echo " ! Please upgrade your stack using the 'heroku stack:set' command or via the dashboard."
echo " ! If that is not an option, pin an older version of Swift."
echo
exit 1
;;

'ubuntu16.04' )
echo
echo " ! Swift 5.9.1 does not support Ubuntu 16.04."
echo " ! Please upgrade your stack using the 'heroku stack:set' command or via the dashboard."
echo " ! If that is not an option, pin an older version of Swift."
echo
exit 1
;;

'ubuntu18.04' )
URL="https://swift.org/builds/swift-5.9.1-release/ubuntu1804/swift-5.9.1-RELEASE/swift-5.9.1-RELEASE-ubuntu18.04.tar.gz"
;;

'ubuntu20.04' )
URL="https://swift.org/builds/swift-5.9.1-release/ubuntu2004/swift-5.9.1-RELEASE/swift-5.9.1-RELEASE-ubuntu20.04.tar.gz"
;;

'ubuntu22.04' )
URL="https://swift.org/builds/swift-5.9.1-release/ubuntu2204/swift-5.9.1-RELEASE/swift-5.9.1-RELEASE-ubuntu22.04.tar.gz"
;;

* )
;;
esac

0 comments on commit 90e3eb1

Please sign in to comment.