Skip to content

Commit 621f592

Browse files
authored
Bump the Swift version to 6.0 (#8)
* Bump the Swift version to 6.0 * Update `ci.yml` * Update `CHANGELOG.md` * Update `README.md`
1 parent 1b9bf18 commit 621f592

File tree

10 files changed

+159
-52
lines changed

10 files changed

+159
-52
lines changed

.github/workflows/ci.yml

Lines changed: 70 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ jobs:
3434
fail-fast: false
3535
matrix:
3636
include:
37+
- xcode: "Xcode_16.0"
38+
runsOn: macOS-14
39+
name: "macOS 14, Xcode 16.0, Swift 6.0"
40+
- xcode: "Xcode_15.4"
41+
runsOn: macOS-14
42+
name: "macOS 14, Xcode 15.4, Swift 5.10"
3743
- xcode: "Xcode_15.0"
3844
runsOn: macos-13
3945
name: "macOS 13, Xcode 15.0, Swift 5.9.0"
@@ -44,16 +50,12 @@ jobs:
4450
- uses: actions/checkout@v3
4551
- name: ${{ matrix.name }}
4652
run: xcodebuild test -scheme "Log" -destination "platform=macOS" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1
47-
- name: Upload coverage reports to Codecov
48-
uses: codecov/[email protected]
53+
- name: Upload test coverage reports to Codecov
54+
uses: space-code/oss-common-actions/.github/actions/upload_test_coverage_report@main
4955
with:
56+
scheme_name: Log
57+
filename: ${{ matrix.name }}
5058
token: ${{ secrets.CODECOV_TOKEN }}
51-
xcode: true
52-
xcode_archive_path: test_output/${{ matrix.name }}.xcresult
53-
- uses: actions/upload-artifact@v4
54-
with:
55-
name: ${{ matrix.name }}
56-
path: test_output
5759

5860
iOS:
5961
name: ${{ matrix.name }}
@@ -65,6 +67,18 @@ jobs:
6567
fail-fast: false
6668
matrix:
6769
include:
70+
- destination: "OS=18.1,name=iPhone 16 Pro"
71+
name: "iOS 18.1"
72+
xcode: "Xcode_16.1"
73+
runsOn: macOS-14
74+
- destination: "OS=18.0,name=iPhone 16 Pro"
75+
name: "iOS 18.0"
76+
xcode: "Xcode_16.0"
77+
runsOn: macOS-14
78+
- destination: "OS=17.5,name=iPhone 15 Pro"
79+
name: "iOS 17.5"
80+
xcode: "Xcode_15.4"
81+
runsOn: macOS-14
6882
- destination: "OS=17.0.1,name=iPhone 14 Pro"
6983
name: "iOS 17.0.1"
7084
xcode: "Xcode_15.0"
@@ -77,10 +91,12 @@ jobs:
7791
- uses: actions/checkout@v3
7892
- name: ${{ matrix.name }}
7993
run: xcodebuild test -scheme "Log" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1
80-
- uses: actions/upload-artifact@v4
94+
- name: Upload test coverage reports to Codecov
95+
uses: space-code/oss-common-actions/.github/actions/upload_test_coverage_report@main
8196
with:
82-
name: ${{ matrix.name }}
83-
path: test_output
97+
scheme_name: Log
98+
filename: ${{ matrix.name }}
99+
token: ${{ secrets.CODECOV_TOKEN }}
84100

85101
tvOS:
86102
name: ${{ matrix.name }}
@@ -92,6 +108,18 @@ jobs:
92108
fail-fast: false
93109
matrix:
94110
include:
111+
- destination: "OS=18.1,name=Apple TV"
112+
name: "tvOS 18.1"
113+
xcode: "Xcode_16.1"
114+
runsOn: macOS-14
115+
- destination: "OS=18.0,name=Apple TV"
116+
name: "tvOS 18.0"
117+
xcode: "Xcode_16.0"
118+
runsOn: macOS-14
119+
- destination: "OS=17.5,name=Apple TV"
120+
name: "tvOS 17.5"
121+
xcode: "Xcode_15.4"
122+
runsOn: macOS-14
95123
- destination: "OS=17.0,name=Apple TV"
96124
name: "tvOS 17.0"
97125
xcode: "Xcode_15.0"
@@ -104,16 +132,12 @@ jobs:
104132
- uses: actions/checkout@v3
105133
- name: ${{ matrix.name }}
106134
run: xcodebuild test -scheme "Log" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1
107-
- name: Upload coverage reports to Codecov
108-
uses: codecov/[email protected]
135+
- name: Upload test coverage reports to Codecov
136+
uses: space-code/oss-common-actions/.github/actions/upload_test_coverage_report@main
109137
with:
138+
scheme_name: Log
139+
filename: ${{ matrix.name }}
110140
token: ${{ secrets.CODECOV_TOKEN }}
111-
xcode: true
112-
xcode_archive_path: test_output/${{ matrix.name }}.xcresult
113-
- uses: actions/upload-artifact@v4
114-
with:
115-
name: ${{ matrix.name }}
116-
path: test_output
117141

118142
watchOS:
119143
name: ${{ matrix.name }}
@@ -125,6 +149,18 @@ jobs:
125149
fail-fast: false
126150
matrix:
127151
include:
152+
- destination: "OS=11.1,name=Apple Watch Series 10 (46mm)"
153+
name: "watchOS 11.1"
154+
xcode: "Xcode_16.1"
155+
runsOn: macOS-14
156+
- destination: "OS=11.0,name=Apple Watch Series 10 (46mm)"
157+
name: "watchOS 11.0"
158+
xcode: "Xcode_16.0"
159+
runsOn: macOS-14
160+
- destination: "OS=10.5,name=Apple Watch Series 9 (45mm)"
161+
name: "watchOS 10.5"
162+
xcode: "Xcode_15.4"
163+
runsOn: macOS-14
128164
- destination: "OS=10.0,name=Apple Watch Series 9 (45mm)"
129165
name: "watchOS 10.0"
130166
xcode: "Xcode_15.0"
@@ -137,16 +173,12 @@ jobs:
137173
- uses: actions/checkout@v3
138174
- name: ${{ matrix.name }}
139175
run: xcodebuild test -scheme "Log" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1
140-
- name: Upload coverage reports to Codecov
141-
uses: codecov/[email protected]
176+
- name: Upload test coverage reports to Codecov
177+
uses: space-code/oss-common-actions/.github/actions/upload_test_coverage_report@main
142178
with:
179+
scheme_name: Log
180+
filename: ${{ matrix.name }}
143181
token: ${{ secrets.CODECOV_TOKEN }}
144-
xcode: true
145-
xcode_archive_path: test_output/${{ matrix.name }}.xcresult
146-
- uses: actions/upload-artifact@v4
147-
with:
148-
name: ${{ matrix.name }}
149-
path: test_output
150182

151183
spm:
152184
name: ${{ matrix.name }}
@@ -158,10 +190,16 @@ jobs:
158190
fail-fast: false
159191
matrix:
160192
include:
161-
- name: "Xcode 15"
193+
- name: "macOS 14, SPM 6.0.2 Test"
194+
xcode: "Xcode_16.1"
195+
runsOn: macOS-14
196+
- name: "macOS 14, SPM 6.0.0 Test"
197+
xcode: "Xcode_16.0"
198+
runsOn: macOS-14
199+
- name: "macOS 14, SPM 5.9.0 Test"
162200
xcode: "Xcode_15.0"
163-
runsOn: macos-13
164-
- name: "Xcode 14"
201+
runsOn: macos-14
202+
- name: "macOS 13, SPM 5.8.1 Test"
165203
xcode: "Xcode_14.3.1"
166204
runsOn: macos-13
167205
steps:
@@ -186,11 +224,11 @@ jobs:
186224

187225
discover-typos:
188226
name: Discover Typos
189-
runs-on: macOS-12
227+
runs-on: macOS-13
190228
env:
191229
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
192230
steps:
193-
- uses: actions/checkout@v2
231+
- uses: actions/checkout@v4
194232
- name: Discover typos
195233
run: |
196234
export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.11/bin"

.swiftlint.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
excluded:
22
- Tests
33
- Package.swift
4+
5+
6+
7+
48
- .build
59

610
# Rules
@@ -130,4 +134,4 @@ nesting:
130134
type_name:
131135
max_length:
132136
warning: 40
133-
error: 50
137+
error: 50

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@
22
All notable changes to this project will be documented in this file.
33

44
#### 1.x Releases
5+
- `1.2.x` Releases - [1.2.0](#120)
56
- `1.1.x` Releases - [1.1.0](#110)
67
- `1.0.x` Releases - [1.0.0](#100)
78

9+
## [1.2.0](https://github.com/space-code/log/releases/tag/1.2.0)
10+
Released on 2024-12-25.
11+
12+
#### Added
13+
- Bump the Swift version to 6.0.
14+
- Added in Pull Request [#5](https://github.com/space-code/log/pull/6).
15+
816
## [1.1.0](https://github.com/space-code/log/releases/tag/1.1.0)
17+
918
#### Added
1019
- Make the `logLevel` property changeable
1120
- Added in Pull Request [#5](https://github.com/space-code/log/pull/5).

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.9
1+
// swift-tools-version: 6.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription

[email protected]

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// swift-tools-version: 5.10
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "Log",
8+
platforms: [
9+
.macOS(.v10_15),
10+
.iOS(.v13),
11+
.watchOS(.v7),
12+
.tvOS(.v13),
13+
.visionOS(.v1),
14+
],
15+
products: [
16+
.library(name: "Log", targets: ["Log"]),
17+
],
18+
dependencies: [],
19+
targets: [
20+
.target(name: "Log", dependencies: []),
21+
.testTarget(name: "LogTests", dependencies: ["Log"]),
22+
]
23+
)

[email protected]

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// swift-tools-version: 5.7
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
3-
// swiftlint:disable all
43

54
import PackageDescription
65

@@ -21,4 +20,3 @@ let package = Package(
2120
.testTarget(name: "LogTests", dependencies: ["Log"]),
2221
]
2322
)
24-
// swiftlint:enable all

[email protected]

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// swift-tools-version: 5.8
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
3-
// swiftlint:disable all
43

54
import PackageDescription
65

@@ -21,4 +20,3 @@ let package = Package(
2120
.testTarget(name: "LogTests", dependencies: ["Log"]),
2221
]
2322
)
24-
// swiftlint:enable all

[email protected]

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// swift-tools-version: 5.9
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "Log",
8+
platforms: [
9+
.macOS(.v10_15),
10+
.iOS(.v13),
11+
.watchOS(.v7),
12+
.tvOS(.v13),
13+
.visionOS(.v1),
14+
],
15+
products: [
16+
.library(name: "Log", targets: ["Log"]),
17+
],
18+
dependencies: [],
19+
targets: [
20+
.target(name: "Log", dependencies: []),
21+
.testTarget(name: "LogTests", dependencies: ["Log"]),
22+
]
23+
)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Once you have your Swift package set up, adding `log` as a dependency is as easy
9191

9292
```swift
9393
dependencies: [
94-
.package(url: "https://github.com/space-code/log.git", .upToNextMajor(from: "1.0.0"))
94+
.package(url: "https://github.com/space-code/log.git", .upToNextMajor(from: "1.2.0"))
9595
]
9696
```
9797

Sources/Log/Classes/Models/LogLevel.swift

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,33 @@ public struct LogLevel: OptionSet {
2222

2323
public typealias RawValue = UInt
2424

25-
/// Creates a new default `.off` instance with a bitmask of `1 << 0`.
26-
public static let off = LogLevel(rawValue: offBitmask)
27-
/// Creates a new default `.debug` instance with a bitmask of `1 << 1`.
28-
public static let debug = LogLevel(rawValue: debugBitmask)
29-
/// Creates a new default `.info` instance with a bitmask of `1 << 2`.
30-
public static let info = LogLevel(rawValue: infoBitmask)
31-
/// Creates a new default `.error` instance with a bitmask of `1 << 3`.
32-
public static let error = LogLevel(rawValue: errorBitmask)
33-
/// Creates a new default `.fault` instance with a bitmask of `1 << 4`.
34-
public static let fault = LogLevel(rawValue: faultBitmask)
35-
/// Creates a new default `.error` instance.
36-
public static let all = LogLevel(rawValue: allBitmask)
37-
25+
#if swift(>=6.0)
26+
/// Creates a new default `.off` instance with a bitmask of `1 << 0`.
27+
public nonisolated(unsafe) static let off = LogLevel(rawValue: offBitmask)
28+
/// Creates a new default `.debug` instance with a bitmask of `1 << 1`.
29+
public nonisolated(unsafe) static let debug = LogLevel(rawValue: debugBitmask)
30+
/// Creates a new default `.info` instance with a bitmask of `1 << 2`.
31+
public nonisolated(unsafe) static let info = LogLevel(rawValue: infoBitmask)
32+
/// Creates a new default `.error` instance with a bitmask of `1 << 3`.
33+
public nonisolated(unsafe) static let error = LogLevel(rawValue: errorBitmask)
34+
/// Creates a new default `.fault` instance with a bitmask of `1 << 4`.
35+
public nonisolated(unsafe) static let fault = LogLevel(rawValue: faultBitmask)
36+
/// Creates a new default `.error` instance.
37+
public nonisolated(unsafe) static let all = LogLevel(rawValue: allBitmask)
38+
#else
39+
/// Creates a new default `.off` instance with a bitmask of `1 << 0`.
40+
public static let off = LogLevel(rawValue: offBitmask)
41+
/// Creates a new default `.debug` instance with a bitmask of `1 << 1`.
42+
public static let debug = LogLevel(rawValue: debugBitmask)
43+
/// Creates a new default `.info` instance with a bitmask of `1 << 2`.
44+
public static let info = LogLevel(rawValue: infoBitmask)
45+
/// Creates a new default `.error` instance with a bitmask of `1 << 3`.
46+
public static let error = LogLevel(rawValue: errorBitmask)
47+
/// Creates a new default `.fault` instance with a bitmask of `1 << 4`.
48+
public static let fault = LogLevel(rawValue: faultBitmask)
49+
/// Creates a new default `.error` instance.
50+
public static let all = LogLevel(rawValue: allBitmask)
51+
#endif
3852
/// Returns the raw bitmask value of the LogLevel and satisfies the `RawRepresentable` protocol.
3953
public let rawValue: RawValue
4054

0 commit comments

Comments
 (0)