From 1b9bf184f8183732da7c774c1ade2df8be6a179c Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Wed, 25 Dec 2024 15:21:18 +0100 Subject: [PATCH 1/2] Update `Gemfile` (#9) --- Gemfile.lock | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 15dfc08..485b83d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,9 +1,9 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.8.5) - public_suffix (>= 2.0.2, < 6.0) - base64 (0.1.1) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + base64 (0.2.0) claide (1.1.0) claide-plugins (0.9.2) cork @@ -12,7 +12,8 @@ GEM colored2 (3.1.2) cork (0.3.0) colored2 (~> 3.1) - danger (9.3.2) + danger (9.5.1) + base64 (~> 0.2) claide (~> 1.0) claide-plugins (>= 0.9.2) colored2 (~> 3.1) @@ -22,39 +23,44 @@ GEM git (~> 1.13) kramdown (~> 2.3) kramdown-parser-gfm (~> 1.0) - no_proxy_fix - octokit (~> 6.0) + octokit (>= 4.0) + pstore (~> 0.1) terminal-table (>= 1, < 4) - faraday (2.7.11) - base64 - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-http-cache (2.5.0) + faraday (2.12.2) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-http-cache (2.5.1) faraday (>= 0.8) - faraday-net_http (3.0.2) - git (1.18.0) + faraday-net_http (3.4.0) + net-http (>= 0.5.0) + git (1.19.1) addressable (~> 2.8) rchardet (~> 1.8) - kramdown (2.4.0) - rexml + json (2.9.1) + kramdown (2.5.1) + rexml (>= 3.3.9) kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) + logger (1.6.4) nap (1.1.0) - no_proxy_fix (0.1.2) - octokit (6.1.1) + net-http (0.6.0) + uri + octokit (9.2.0) faraday (>= 1, < 3) sawyer (~> 0.9) open4 (1.3.4) - public_suffix (5.0.3) + pstore (0.1.4) + public_suffix (6.0.1) rchardet (1.8.0) - rexml (3.2.6) - ruby2_keywords (0.0.5) + rexml (3.4.0) sawyer (0.9.2) addressable (>= 2.3.5) faraday (>= 0.17.3, < 3) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - unicode-display_width (2.5.0) + unicode-display_width (2.6.0) + uri (1.0.2) PLATFORMS x86_64-darwin-22 From 621f592bab667cad75e3545e51c5e4df4128aa49 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Wed, 25 Dec 2024 15:29:36 +0100 Subject: [PATCH 2/2] Bump the Swift version to 6.0 (#8) * Bump the Swift version to 6.0 * Update `ci.yml` * Update `CHANGELOG.md` * Update `README.md` --- .github/workflows/ci.yml | 102 +++++++++++++++------- .swiftlint.yml | 6 +- CHANGELOG.md | 9 ++ Package.swift | 2 +- Package@swift-5.10.swift | 23 +++++ Package@swift-5.7.swift | 2 - Package@swift-5.8.swift | 2 - Package@swift-5.9.swift | 23 +++++ README.md | 2 +- Sources/Log/Classes/Models/LogLevel.swift | 40 ++++++--- 10 files changed, 159 insertions(+), 52 deletions(-) create mode 100644 Package@swift-5.10.swift create mode 100644 Package@swift-5.9.swift diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28d58cd..d68cee0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,12 @@ jobs: fail-fast: false matrix: include: + - xcode: "Xcode_16.0" + runsOn: macOS-14 + name: "macOS 14, Xcode 16.0, Swift 6.0" + - xcode: "Xcode_15.4" + runsOn: macOS-14 + name: "macOS 14, Xcode 15.4, Swift 5.10" - xcode: "Xcode_15.0" runsOn: macos-13 name: "macOS 13, Xcode 15.0, Swift 5.9.0" @@ -44,16 +50,12 @@ jobs: - uses: actions/checkout@v3 - name: ${{ matrix.name }} run: xcodebuild test -scheme "Log" -destination "platform=macOS" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3.1.0 + - name: Upload test coverage reports to Codecov + uses: space-code/oss-common-actions/.github/actions/upload_test_coverage_report@main with: + scheme_name: Log + filename: ${{ matrix.name }} token: ${{ secrets.CODECOV_TOKEN }} - xcode: true - xcode_archive_path: test_output/${{ matrix.name }}.xcresult - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.name }} - path: test_output iOS: name: ${{ matrix.name }} @@ -65,6 +67,18 @@ jobs: fail-fast: false matrix: include: + - destination: "OS=18.1,name=iPhone 16 Pro" + name: "iOS 18.1" + xcode: "Xcode_16.1" + runsOn: macOS-14 + - destination: "OS=18.0,name=iPhone 16 Pro" + name: "iOS 18.0" + xcode: "Xcode_16.0" + runsOn: macOS-14 + - destination: "OS=17.5,name=iPhone 15 Pro" + name: "iOS 17.5" + xcode: "Xcode_15.4" + runsOn: macOS-14 - destination: "OS=17.0.1,name=iPhone 14 Pro" name: "iOS 17.0.1" xcode: "Xcode_15.0" @@ -77,10 +91,12 @@ jobs: - uses: actions/checkout@v3 - name: ${{ matrix.name }} run: xcodebuild test -scheme "Log" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 - - uses: actions/upload-artifact@v4 + - name: Upload test coverage reports to Codecov + uses: space-code/oss-common-actions/.github/actions/upload_test_coverage_report@main with: - name: ${{ matrix.name }} - path: test_output + scheme_name: Log + filename: ${{ matrix.name }} + token: ${{ secrets.CODECOV_TOKEN }} tvOS: name: ${{ matrix.name }} @@ -92,6 +108,18 @@ jobs: fail-fast: false matrix: include: + - destination: "OS=18.1,name=Apple TV" + name: "tvOS 18.1" + xcode: "Xcode_16.1" + runsOn: macOS-14 + - destination: "OS=18.0,name=Apple TV" + name: "tvOS 18.0" + xcode: "Xcode_16.0" + runsOn: macOS-14 + - destination: "OS=17.5,name=Apple TV" + name: "tvOS 17.5" + xcode: "Xcode_15.4" + runsOn: macOS-14 - destination: "OS=17.0,name=Apple TV" name: "tvOS 17.0" xcode: "Xcode_15.0" @@ -104,16 +132,12 @@ jobs: - uses: actions/checkout@v3 - name: ${{ matrix.name }} run: xcodebuild test -scheme "Log" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3.1.0 + - name: Upload test coverage reports to Codecov + uses: space-code/oss-common-actions/.github/actions/upload_test_coverage_report@main with: + scheme_name: Log + filename: ${{ matrix.name }} token: ${{ secrets.CODECOV_TOKEN }} - xcode: true - xcode_archive_path: test_output/${{ matrix.name }}.xcresult - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.name }} - path: test_output watchOS: name: ${{ matrix.name }} @@ -125,6 +149,18 @@ jobs: fail-fast: false matrix: include: + - destination: "OS=11.1,name=Apple Watch Series 10 (46mm)" + name: "watchOS 11.1" + xcode: "Xcode_16.1" + runsOn: macOS-14 + - destination: "OS=11.0,name=Apple Watch Series 10 (46mm)" + name: "watchOS 11.0" + xcode: "Xcode_16.0" + runsOn: macOS-14 + - destination: "OS=10.5,name=Apple Watch Series 9 (45mm)" + name: "watchOS 10.5" + xcode: "Xcode_15.4" + runsOn: macOS-14 - destination: "OS=10.0,name=Apple Watch Series 9 (45mm)" name: "watchOS 10.0" xcode: "Xcode_15.0" @@ -137,16 +173,12 @@ jobs: - uses: actions/checkout@v3 - name: ${{ matrix.name }} run: xcodebuild test -scheme "Log" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3.1.0 + - name: Upload test coverage reports to Codecov + uses: space-code/oss-common-actions/.github/actions/upload_test_coverage_report@main with: + scheme_name: Log + filename: ${{ matrix.name }} token: ${{ secrets.CODECOV_TOKEN }} - xcode: true - xcode_archive_path: test_output/${{ matrix.name }}.xcresult - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.name }} - path: test_output spm: name: ${{ matrix.name }} @@ -158,10 +190,16 @@ jobs: fail-fast: false matrix: include: - - name: "Xcode 15" + - name: "macOS 14, SPM 6.0.2 Test" + xcode: "Xcode_16.1" + runsOn: macOS-14 + - name: "macOS 14, SPM 6.0.0 Test" + xcode: "Xcode_16.0" + runsOn: macOS-14 + - name: "macOS 14, SPM 5.9.0 Test" xcode: "Xcode_15.0" - runsOn: macos-13 - - name: "Xcode 14" + runsOn: macos-14 + - name: "macOS 13, SPM 5.8.1 Test" xcode: "Xcode_14.3.1" runsOn: macos-13 steps: @@ -186,11 +224,11 @@ jobs: discover-typos: name: Discover Typos - runs-on: macOS-12 + runs-on: macOS-13 env: DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Discover typos run: | export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.11/bin" diff --git a/.swiftlint.yml b/.swiftlint.yml index 58036d3..ada4ca6 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,6 +1,10 @@ excluded: - Tests - Package.swift + - Package@swift-5.7.swift + - Package@swift-5.8.swift + - Package@swift-5.9.swift + - Package@swift-5.10.swift - .build # Rules @@ -130,4 +134,4 @@ nesting: type_name: max_length: warning: 40 - error: 50 \ No newline at end of file + error: 50 diff --git a/CHANGELOG.md b/CHANGELOG.md index aa07494..3aa2677 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,19 @@ All notable changes to this project will be documented in this file. #### 1.x Releases +- `1.2.x` Releases - [1.2.0](#120) - `1.1.x` Releases - [1.1.0](#110) - `1.0.x` Releases - [1.0.0](#100) +## [1.2.0](https://github.com/space-code/log/releases/tag/1.2.0) +Released on 2024-12-25. + +#### Added +- Bump the Swift version to 6.0. + - Added in Pull Request [#5](https://github.com/space-code/log/pull/6). + ## [1.1.0](https://github.com/space-code/log/releases/tag/1.1.0) + #### Added - Make the `logLevel` property changeable - Added in Pull Request [#5](https://github.com/space-code/log/pull/5). diff --git a/Package.swift b/Package.swift index 7db16b1..e9b38d1 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription diff --git a/Package@swift-5.10.swift b/Package@swift-5.10.swift new file mode 100644 index 0000000..5f83718 --- /dev/null +++ b/Package@swift-5.10.swift @@ -0,0 +1,23 @@ +// swift-tools-version: 5.10 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "Log", + platforms: [ + .macOS(.v10_15), + .iOS(.v13), + .watchOS(.v7), + .tvOS(.v13), + .visionOS(.v1), + ], + products: [ + .library(name: "Log", targets: ["Log"]), + ], + dependencies: [], + targets: [ + .target(name: "Log", dependencies: []), + .testTarget(name: "LogTests", dependencies: ["Log"]), + ] +) diff --git a/Package@swift-5.7.swift b/Package@swift-5.7.swift index cdef89b..da68fea 100644 --- a/Package@swift-5.7.swift +++ b/Package@swift-5.7.swift @@ -1,6 +1,5 @@ // swift-tools-version: 5.7 // The swift-tools-version declares the minimum version of Swift required to build this package. -// swiftlint:disable all import PackageDescription @@ -21,4 +20,3 @@ let package = Package( .testTarget(name: "LogTests", dependencies: ["Log"]), ] ) -// swiftlint:enable all diff --git a/Package@swift-5.8.swift b/Package@swift-5.8.swift index 6de492d..fdb3ce5 100644 --- a/Package@swift-5.8.swift +++ b/Package@swift-5.8.swift @@ -1,6 +1,5 @@ // swift-tools-version: 5.8 // The swift-tools-version declares the minimum version of Swift required to build this package. -// swiftlint:disable all import PackageDescription @@ -21,4 +20,3 @@ let package = Package( .testTarget(name: "LogTests", dependencies: ["Log"]), ] ) -// swiftlint:enable all diff --git a/Package@swift-5.9.swift b/Package@swift-5.9.swift new file mode 100644 index 0000000..7db16b1 --- /dev/null +++ b/Package@swift-5.9.swift @@ -0,0 +1,23 @@ +// swift-tools-version: 5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "Log", + platforms: [ + .macOS(.v10_15), + .iOS(.v13), + .watchOS(.v7), + .tvOS(.v13), + .visionOS(.v1), + ], + products: [ + .library(name: "Log", targets: ["Log"]), + ], + dependencies: [], + targets: [ + .target(name: "Log", dependencies: []), + .testTarget(name: "LogTests", dependencies: ["Log"]), + ] +) diff --git a/README.md b/README.md index d3d5638..87f2519 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Once you have your Swift package set up, adding `log` as a dependency is as easy ```swift dependencies: [ - .package(url: "https://github.com/space-code/log.git", .upToNextMajor(from: "1.0.0")) + .package(url: "https://github.com/space-code/log.git", .upToNextMajor(from: "1.2.0")) ] ``` diff --git a/Sources/Log/Classes/Models/LogLevel.swift b/Sources/Log/Classes/Models/LogLevel.swift index 5a68b78..6cda93e 100644 --- a/Sources/Log/Classes/Models/LogLevel.swift +++ b/Sources/Log/Classes/Models/LogLevel.swift @@ -22,19 +22,33 @@ public struct LogLevel: OptionSet { public typealias RawValue = UInt - /// Creates a new default `.off` instance with a bitmask of `1 << 0`. - public static let off = LogLevel(rawValue: offBitmask) - /// Creates a new default `.debug` instance with a bitmask of `1 << 1`. - public static let debug = LogLevel(rawValue: debugBitmask) - /// Creates a new default `.info` instance with a bitmask of `1 << 2`. - public static let info = LogLevel(rawValue: infoBitmask) - /// Creates a new default `.error` instance with a bitmask of `1 << 3`. - public static let error = LogLevel(rawValue: errorBitmask) - /// Creates a new default `.fault` instance with a bitmask of `1 << 4`. - public static let fault = LogLevel(rawValue: faultBitmask) - /// Creates a new default `.error` instance. - public static let all = LogLevel(rawValue: allBitmask) - + #if swift(>=6.0) + /// Creates a new default `.off` instance with a bitmask of `1 << 0`. + public nonisolated(unsafe) static let off = LogLevel(rawValue: offBitmask) + /// Creates a new default `.debug` instance with a bitmask of `1 << 1`. + public nonisolated(unsafe) static let debug = LogLevel(rawValue: debugBitmask) + /// Creates a new default `.info` instance with a bitmask of `1 << 2`. + public nonisolated(unsafe) static let info = LogLevel(rawValue: infoBitmask) + /// Creates a new default `.error` instance with a bitmask of `1 << 3`. + public nonisolated(unsafe) static let error = LogLevel(rawValue: errorBitmask) + /// Creates a new default `.fault` instance with a bitmask of `1 << 4`. + public nonisolated(unsafe) static let fault = LogLevel(rawValue: faultBitmask) + /// Creates a new default `.error` instance. + public nonisolated(unsafe) static let all = LogLevel(rawValue: allBitmask) + #else + /// Creates a new default `.off` instance with a bitmask of `1 << 0`. + public static let off = LogLevel(rawValue: offBitmask) + /// Creates a new default `.debug` instance with a bitmask of `1 << 1`. + public static let debug = LogLevel(rawValue: debugBitmask) + /// Creates a new default `.info` instance with a bitmask of `1 << 2`. + public static let info = LogLevel(rawValue: infoBitmask) + /// Creates a new default `.error` instance with a bitmask of `1 << 3`. + public static let error = LogLevel(rawValue: errorBitmask) + /// Creates a new default `.fault` instance with a bitmask of `1 << 4`. + public static let fault = LogLevel(rawValue: faultBitmask) + /// Creates a new default `.error` instance. + public static let all = LogLevel(rawValue: allBitmask) + #endif /// Returns the raw bitmask value of the LogLevel and satisfies the `RawRepresentable` protocol. public let rawValue: RawValue