Skip to content

Commit 7258a03

Browse files
authored
Bump Minimum Swift Version to 5.9 (#218)
Bumping to Swift 5.9 introduces some particularly helpful new features, namely the `package` access modifier ([SE-386](https://github.com/apple/swift-evolution/blob/main/proposals/0386-package-access-modifier.md)). Bumping to Swift 5.9 is a breaking change for consumers of `XcbeautifyLib`, such as Tuist, since their packages will also require Swift 5.9 too. It is not a breaking change if a consumer simply uses the `xcbeautify` CLI. The `package` access modifier will be particularly helpful to introduce new logic into `XcbeautifyLib` that the executable, `xcbeautify`, needs, without unnecessarily making the additions public to third-party consumers.
1 parent 083aedf commit 7258a03

File tree

7 files changed

+12
-11
lines changed

7 files changed

+12
-11
lines changed

.github/workflows/ci.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
platform: [macos-latest, ubuntu-latest]
22-
swift_version: [5.7, 5.8, 5.9]
22+
swift_version: [5.9]
2323
steps:
2424
- uses: swift-actions/setup-swift@61a116f4030ac34fb5731aab0eff5a0aed94ba29
2525
with:
@@ -32,14 +32,15 @@ jobs:
3232
runs-on: ${{ matrix.platform }}
3333
strategy:
3434
matrix:
35-
platform: [macos-latest, ubuntu-latest]
35+
platform: [macos-13, ubuntu-latest]
3636
steps:
3737
- uses: actions/checkout@v4
38+
- name: Load Swift Version
39+
run: echo "SWIFT_VERSION=$(<.swift-version)" >> $GITHUB_ENV
3840
- name: Install Swift and Tools
39-
if: matrix.platform == 'ubuntu-latest'
4041
uses: swift-actions/setup-swift@cdbe0f7f4c77929b6580e71983e8606e55ffe7e4
4142
with:
42-
swift-version: 5.9.2
43+
swift-version: ${{ env.SWIFT_VERSION }}
4344
- run: swift test --enable-code-coverage
4445
- name: Prepare Code Coverage
4546
run: ./tools/export_coverage

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
name: Release
66

77
env:
8-
SWIFT_VERSION: 5.7
8+
SWIFT_VERSION: 5.9
99

1010
jobs:
1111

.swift-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.7.1
1+
5.9

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ package-linux-x86_64:
5858
$(eval SWIFT_BUILD_FLAGS := $(SHARED_SWIFT_BUILD_FLAGS) --triple $(TARGET_TRIPLE))
5959
$(eval BUILD_DIRECTORY := $(shell swift build --show-bin-path $(SWIFT_BUILD_FLAGS)))
6060
docker run --rm --volume `pwd`:/workdir --workdir /workdir \
61-
swift:5.7-bionic swift build $(SWIFT_BUILD_FLAGS)
61+
swift:5.9 swift build $(SWIFT_BUILD_FLAGS)
6262
tar --directory "$(BUILD_DIRECTORY)" --create --xz --file \
6363
"$(PRODUCT_NAME).tar.xz" "$(PRODUCT_NAME)"
6464

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.7
1+
// swift-tools-version:5.9
22
import PackageDescription
33

44
let package = Package(

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ In that directory, create a `Package.swift` file with the following contents.
5353
In addition, add an empty file named `Empty.swift` to the same location.
5454

5555
```swift
56-
// swift-tools-version: 5.6
56+
// swift-tools-version: 5.9
5757
import PackageDescription
5858

5959
let package = Package(

Sources/XcbeautifyLib/Renderers/TerminalRenderer.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ struct TerminalRenderer: OutputRendering {
197197

198198
func format(testSummary: TestSummary) -> String {
199199
if testSummary.isSuccess() {
200-
return colored ? "Tests Passed: \(testSummary.description)".s.Bold.f.Green : "Tests Passed: \(testSummary.description)"
200+
colored ? "Tests Passed: \(testSummary.description)".s.Bold.f.Green : "Tests Passed: \(testSummary.description)"
201201
} else {
202-
return colored ? "Tests Failed: \(testSummary.description)".s.Bold.f.Red : "Tests Failed: \(testSummary.description)"
202+
colored ? "Tests Failed: \(testSummary.description)".s.Bold.f.Red : "Tests Failed: \(testSummary.description)"
203203
}
204204
}
205205
}

0 commit comments

Comments
 (0)