Skip to content

Commit

Permalink
Add support for Swift 5.7.1 and 5.7.2 (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
vzsg authored Jan 15, 2023
1 parent 362576e commit 6442659
Show file tree
Hide file tree
Showing 4 changed files with 71 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.7 (default)
remote: -----> Using built-in clang (Swift 5.7)
remote: -----> Using Swift 5.7.2 (default)
remote: -----> Using built-in clang (Swift 5.7.2)
remote: -----> Installing swiftenv
remote: -----> Installing Swift 5.7
remote: -----> Installing Swift 5.7.2
...
```

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

### Specify a Swift version

The buildpack defaults to Swift 5.7 and will be updated when new Swift versions are released.
The buildpack defaults to Swift 5.7.2 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.7"
SWIFT_VERSION="5.7.2"
SWIFT_BUILD_CONFIGURATION="release"
SWIFT_BUILD_FLAGS=""

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

'ubuntu14.04' )
echo
echo " ! Swift 5.7.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' )
URL="https://swift.org/builds/swift-5.7.1-release/ubuntu1604/swift-5.7.1-RELEASE/swift-5.7.1-RELEASE-ubuntu16.04.tar.gz"
;;

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

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

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

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

'ubuntu14.04' )
echo
echo " ! Swift 5.7.2 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' )
URL="https://swift.org/builds/swift-5.7.2-release/ubuntu1604/swift-5.7.2-RELEASE/swift-5.7.2-RELEASE-ubuntu16.04.tar.gz"
;;

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

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

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

* )
;;
esac

0 comments on commit 6442659

Please sign in to comment.