From 90e3eb1581ab6967e5b1dbe0084e831e11d888ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zsolt=20Va=CC=81radi?= Date: Wed, 15 Nov 2023 13:15:11 +0100 Subject: [PATCH] Add support for Swift 5.9.1 --- README.md | 8 +++--- bin/compile | 2 +- swiftenv/share/swiftenv-install/5.9.1 | 38 +++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 swiftenv/share/swiftenv-install/5.9.1 diff --git a/README.md b/README.md index 24ec47f5..83421aef 100644 --- a/README.md +++ b/README.md @@ -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 ... ``` @@ -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. diff --git a/bin/compile b/bin/compile index 98d023a9..32466f64 100755 --- a/bin/compile +++ b/bin/compile @@ -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="" diff --git a/swiftenv/share/swiftenv-install/5.9.1 b/swiftenv/share/swiftenv-install/5.9.1 new file mode 100644 index 00000000..d8237804 --- /dev/null +++ b/swiftenv/share/swiftenv-install/5.9.1 @@ -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