diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 55466c83..8bc4d7d1 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -10,6 +10,7 @@ on: - 'Tests/**/*.swift' - 'Tests/**/*.ya?ml' - '**/BUILD' + - 'MODULE.bazel' - 'WORKSPACE' - '.bazelrc' - '.bazelversion' @@ -21,26 +22,31 @@ on: - 'Tests/**/*.swift' - 'Tests/**/*.ya?ml' - '**/BUILD' + - 'MODULE.bazel' - 'WORKSPACE' - '.bazelrc' - '.bazelversion' +concurrency: + group: bazel-${{ github.ref }} + cancel-in-progress: true + jobs: - MacOS: - runs-on: macos-13 + macOS: + runs-on: macos-14 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Apple tests run: bazelisk test //Tests/... Linux: strategy: matrix: - tag: ['5.4', '5.5', '5.6', '5.7', '5.8', '5.9', '5.10'] + tag: ['5.7', '5.8', '5.9', '5.10'] runs-on: ubuntu-latest container: image: swift:${{ matrix.tag }}-focal steps: - - uses: actions/checkout@v3 - - uses: bazelbuild/setup-bazelisk@v2 + - uses: actions/checkout@v4 + - uses: bazelbuild/setup-bazelisk@v3 - name: Yams tests run: bazel test --test_output=all //Tests:UnitTests diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 80c3dc82..1a25c742 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -3,7 +3,7 @@ name: CMake on: push: branches: [main] - paths: + paths: - '.github/workflows/cmake.yml' - '**/CMakeLists.txt' - '**/*.cmake' @@ -12,7 +12,7 @@ on: - 'Sources/**/*.swift' - 'Sources/**/module.modulemap' pull_request: - paths: + paths: - '.github/workflows/cmake.yml' - '**/CMakeLists.txt' - '**/*.cmake' @@ -21,33 +21,40 @@ on: - 'Sources/**/*.swift' - 'Sources/**/module.modulemap' +concurrency: + group: cmake-${{ github.ref }} + cancel-in-progress: true + jobs: CMake: + name: macOS with Xcode ${{ matrix.xcode_version }} strategy: matrix: - xcode_version: ['14.2', '14.3', '15.0'] - runs-on: macos-13 + xcode_version: ['15.0', '15.4'] + runs-on: macos-14 env: DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - run: sudo chown runner:admin /usr/local - run: brew install cmake ninja - run: swift -version - run: rm -rf build - run: cmake -B build -G Ninja -S . -DCMAKE_BUILD_TYPE=Release - run: cmake --build build - run: cmake --build build --target install - - run: file /usr/local/lib/swift/macosx/libYams.dylib | grep "Mach-O 64-bit dynamically linked shared library x86_64" + - run: file /usr/local/lib/swift/macosx/libYams.dylib | grep "Mach-O 64-bit dynamically linked shared library arm64" CMake_Linux: + name: Linux with Swift ${{ matrix.tag }} strategy: matrix: - tag: ['5.6', '5.7', '5.8', '5.9', '5.10'] + tag: ['5.7', '5.8', '5.9', '5.10'] runs-on: ubuntu-latest container: image: swift:${{ matrix.tag }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: apt-get update && apt-get install -y ninja-build curl - run: curl -L https://github.com/Kitware/CMake/releases/download/v3.23.1/cmake-3.23.1-linux-x86_64.tar.gz | tar xz --strip-components=1 -C /usr - run: swift -version diff --git a/.github/workflows/jazzy.yml b/.github/workflows/jazzy.yml index 1c04a156..b0d81817 100644 --- a/.github/workflows/jazzy.yml +++ b/.github/workflows/jazzy.yml @@ -3,7 +3,7 @@ name: Jazzy on: push: branches: [main] - paths: + paths: - '.github/workflows/jazzy.yml' - '.jazzy.yaml' - '**/*.md' @@ -12,7 +12,7 @@ on: - 'Package*' - 'Sources/**/*.swift' pull_request: - paths: + paths: - '.github/workflows/jazzy.yml' - '.jazzy.yaml' - '**/*.md' @@ -21,13 +21,17 @@ on: - 'Package*' - 'Sources/**/*.swift' +concurrency: + group: jazzy-${{ github.ref }} + cancel-in-progress: true + jobs: Jazzy: - runs-on: macos-13 + runs-on: macos-14 env: - DEVELOPER_DIR: /Applications/Xcode_15.0.app + DEVELOPER_DIR: /Applications/Xcode_15.4.app steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install SourceKitten run: brew install sourcekitten - run: swift build @@ -35,7 +39,7 @@ jobs: run: sourcekitten doc --spm --module-name Yams > yams.json - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7.5 + ruby-version: 3.3.3 bundler-cache: true - name: Run jazzy run: bundle exec jazzy --clean --sourcekitten-sourcefile yams.json @@ -47,7 +51,7 @@ jobs: exit 1 fi - name: Upload Artifact - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: API Docs path: docs diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c82013d2..777a8f87 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,7 +3,7 @@ name: Nightly on: push: branches: [main] - paths: + paths: - '.github/workflows/nightly.yml' - 'Package*' - 'Sources/**/*.[ch]' @@ -12,7 +12,7 @@ on: - 'Tests/**/*.swift' - 'Tests/**/*.ya?ml' pull_request: - paths: + paths: - '.github/workflows/nightly.yml' - 'Package*' - 'Sources/**/*.[ch]' @@ -23,13 +23,17 @@ on: schedule: - cron: '0 4 * * *' +concurrency: + group: nightly-${{ github.ref }} + cancel-in-progress: true + jobs: Nightly: runs-on: ubuntu-latest container: image: swiftlang/swift:nightly steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: swift --version - run: YAMS_DEFAULT_ENCODING=UTF16 swift test --parallel - run: YAMS_DEFAULT_ENCODING=UTF8 swift test --parallel diff --git a/.github/workflows/pod_lib_lint.yml b/.github/workflows/pod_lib_lint.yml index 9171a281..205d8c43 100644 --- a/.github/workflows/pod_lib_lint.yml +++ b/.github/workflows/pod_lib_lint.yml @@ -3,27 +3,31 @@ name: pod lib lint on: push: branches: [main] - paths: + paths: - '.github/workflows/pod_lib_lint.yml' - '*.podspec' - 'Gemfile*' - 'Sources/**/*.[ch]' - 'Sources/**/*.swift' pull_request: - paths: + paths: - '.github/workflows/pod_lib_lint.yml' - '*.podspec' - 'Gemfile*' - 'Sources/**/*.[ch]' - 'Sources/**/*.swift' +concurrency: + group: pod-lib-lint-${{ github.ref }} + cancel-in-progress: true + jobs: pod_lib_lint: name: pod lib lint - runs-on: macos-13 + runs-on: macos-14 env: - DEVELOPER_DIR: /Applications/Xcode_14.3.app + DEVELOPER_DIR: /Applications/Xcode_15.4.app steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: bundle install --path vendor/bundle - run: bundle exec pod lib lint --verbose diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml index 1ba3f71f..d6e48877 100644 --- a/.github/workflows/swiftlint.yml +++ b/.github/workflows/swiftlint.yml @@ -7,12 +7,16 @@ on: - '.swiftlint.yml' - '**/*.swift' +concurrency: + group: swiftlint-${{ github.ref }} + cancel-in-progress: true + jobs: SwiftLint: runs-on: ubuntu-latest container: image: ghcr.io/realm/swiftlint:0.54.0 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: SwiftLint run: swiftlint lint --strict diff --git a/.github/workflows/swiftlint_analyze.yml b/.github/workflows/swiftlint_analyze.yml index 887e008d..0a24766e 100644 --- a/.github/workflows/swiftlint_analyze.yml +++ b/.github/workflows/swiftlint_analyze.yml @@ -3,7 +3,7 @@ name: SwiftLint Analyze on: push: branches: [main] - paths: + paths: - '.github/workflows/swiftlint_analyze.yml' - 'Yams.xcodeproj/**' - 'Sources/**/*.[ch]' @@ -19,13 +19,17 @@ on: - 'Tests/**/*.swift' - '!Tests/LinuxMain.swift' +concurrency: + group: swiftlint-analyze-${{ github.ref }} + cancel-in-progress: true + jobs: Analyze: - runs-on: macos-13 + runs-on: macos-14 env: - DEVELOPER_DIR: /Applications/Xcode_15.0.app + DEVELOPER_DIR: /Applications/Xcode_15.4.app steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Generate xcodebuild.log run: xcodebuild -sdk macosx -scheme Yams -project Yams.xcodeproj clean build-for-testing > xcodebuild.log shell: bash diff --git a/.github/workflows/swiftpm.yml b/.github/workflows/swiftpm.yml index 9f1aa073..0ac1d23c 100644 --- a/.github/workflows/swiftpm.yml +++ b/.github/workflows/swiftpm.yml @@ -23,47 +23,40 @@ on: - 'Tests/**/*.swift' - 'Tests/**/*.ya?ml' -jobs: - Xcode: - strategy: - matrix: - xcode_version: ['12.5.1', '13.0', '13.1', '13.2.1'] - runs-on: macos-11 - env: - DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app - steps: - - uses: actions/checkout@v3 - - run: swift -version - - run: YAMS_DEFAULT_ENCODING=UTF16 swift test --parallel - - run: YAMS_DEFAULT_ENCODING=UTF8 swift test --parallel +concurrency: + group: swiftpm-${{ github.ref }} + cancel-in-progress: true - Xcode_Monterey: +jobs: + Xcode_Ventura: + name: macOS 13 with Xcode ${{ matrix.xcode_version }} strategy: matrix: - xcode_version: ['13.3.1', '13.4', '14.0.1', '14.1', '14.2'] - runs-on: macos-12 + xcode_version: ['14.3', '15.0'] + runs-on: macos-13 env: DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: swift -version - run: YAMS_DEFAULT_ENCODING=UTF16 swift test --parallel - run: YAMS_DEFAULT_ENCODING=UTF8 swift test --parallel - Xcode_Ventura: + Xcode_Sonoma: + name: macOS 14 with Xcode ${{ matrix.xcode_version }} strategy: matrix: - xcode_version: ['14.3', '15.0'] - runs-on: macos-13 + xcode_version: ['15.4'] + runs-on: macos-14 env: DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: swift -version - run: YAMS_DEFAULT_ENCODING=UTF16 swift test --parallel - run: YAMS_DEFAULT_ENCODING=UTF8 swift test --parallel - name: Code Coverage - if: matrix.xcode_version == '15.0' + if: matrix.xcode_version == '15.4' run: | swift test --enable-code-coverage xcrun llvm-cov export -format="lcov" .build/debug/YamsPackageTests.xctest/Contents/MacOS/YamsPackageTests -instr-profile .build/debug/codecov/default.profdata > coverage.lcov @@ -73,36 +66,30 @@ jobs: env: { 'CODECOV_TOKEN': '${{ secrets.CODECOV_TOKEN }}' } Linux: + name: Linux with Swift ${{ matrix.tag }} strategy: matrix: - tag: ['5.4', '5.5', '5.6', '5.7', '5.8', '5.9', '5.10'] + tag: ['5.7', '5.8', '5.9', '5.10'] runs-on: ubuntu-latest container: image: swift:${{ matrix.tag }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: YAMS_DEFAULT_ENCODING=UTF16 swift test --parallel - run: YAMS_DEFAULT_ENCODING=UTF8 swift test --parallel Windows: + name: Windows with Swift ${{ matrix.swift_version }} runs-on: windows-latest - strategy: matrix: - include: - - branch: swift-5.6.3-release - tag: 5.6.3-RELEASE - - branch: swift-5.7.2-release - tag: 5.7.2-RELEASE - - branch: development - tag: DEVELOPMENT-SNAPSHOT-2021-11-20-a - + swift_version: ['5.7.3', '5.8.1', '5.9.1', '5.10.1'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: compnerd/gha-setup-swift@main with: - branch: ${{ matrix.branch }} - tag: ${{ matrix.tag }} + branch: swift-${{ matrix.swift_version }}-release + tag: ${{ matrix.swift_version }}-RELEASE # Commands to run once connected via SSH: # # >d: diff --git a/.github/workflows/xcodebuild.yml b/.github/workflows/xcodebuild.yml index 6d16628d..dae2365e 100644 --- a/.github/workflows/xcodebuild.yml +++ b/.github/workflows/xcodebuild.yml @@ -3,7 +3,7 @@ name: xcodebuild on: push: branches: [main] - paths: + paths: - '.github/workflows/xcodebuild.yml' - 'Yams.xcodeproj/**' - 'Sources/**/*.[ch]' @@ -21,109 +21,77 @@ on: - 'Tests/**/*.ya?ml' - '!Tests/LinuxMain.swift' +concurrency: + group: xcodebuild-${{ github.ref }} + cancel-in-progress: true + jobs: - xcodebuild: + xcodebuild_Ventura: + name: macOS 13 with Xcode ${{ matrix.xcode_version }} strategy: matrix: - xcode: - - version: '12.5.1' - - version: '13.0' - - version: '13.1' - - version: '13.2.1' + xcode_version: ['14.3', '15.0'] xcode_flags: ['-scheme Yams -project Yams.xcodeproj'] - runs-on: macos-11 + runs-on: macos-13 env: - DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode.version }}.app + DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: xcodebuild -version - name: macOS with UTF16 if: always() - run: YAMS_DEFAULT_ENCODING=UTF16 xcodebuild ${{ matrix.xcode_flags }} test | xcpretty + run: set -o pipefail && YAMS_DEFAULT_ENCODING=UTF16 xcodebuild ${{ matrix.xcode_flags }} test | xcbeautify --renderer github-actions shell: bash - name: macOS with UTF8 if: always() - run: YAMS_DEFAULT_ENCODING=UTF8 xcodebuild ${{ matrix.xcode_flags }} test | xcpretty + run: set -o pipefail && YAMS_DEFAULT_ENCODING=UTF8 xcodebuild ${{ matrix.xcode_flags }} test | xcbeautify --renderer github-actions shell: bash - name: iPhone Simulator if: always() - run: xcodebuild ${{ matrix.xcode_flags }} test -sdk iphonesimulator -destination "name=iPhone 8" | xcpretty + run: set -o pipefail && xcodebuild ${{ matrix.xcode_flags }} test -sdk iphonesimulator -destination "name=iPhone 8" | xcbeautify --renderer github-actions shell: bash - name: Apple TV Simulator if: always() - run: xcodebuild ${{ matrix.xcode_flags }} test -sdk appletvsimulator -destination "name=Apple TV 4K" | xcpretty + run: set -o pipefail && xcodebuild ${{ matrix.xcode_flags }} test -sdk appletvsimulator -destination "name=Apple TV 4K (2nd generation)" | xcbeautify --renderer github-actions shell: bash - name: watchOS Simulator if: always() - run: xcodebuild ${{ matrix.xcode_flags }} build -sdk watchsimulator | xcpretty + run: set -o pipefail && xcodebuild ${{ matrix.xcode_flags }} build -sdk watchsimulator | xcbeautify --renderer github-actions shell: bash - xcodebuild_Monterey: + xcodebuild_Sonoma: + name: macOS 14 with Xcode ${{ matrix.xcode_version }} strategy: matrix: - xcode: - - version: '13.3.1' - - version: '13.4' - - version: '14.0.1' - - version: '14.2' + xcode_version: ['15.4'] xcode_flags: ['-scheme Yams -project Yams.xcodeproj'] - runs-on: macos-12 + runs-on: macos-14 env: - DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode.version }}.app + DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: xcodebuild -version - name: macOS with UTF16 if: always() - run: YAMS_DEFAULT_ENCODING=UTF16 xcodebuild ${{ matrix.xcode_flags }} test | xcpretty + run: set -o pipefail && YAMS_DEFAULT_ENCODING=UTF16 xcodebuild ${{ matrix.xcode_flags }} test | xcbeautify --renderer github-actions shell: bash - name: macOS with UTF8 if: always() - run: YAMS_DEFAULT_ENCODING=UTF8 xcodebuild ${{ matrix.xcode_flags }} test | xcpretty + run: set -o pipefail && YAMS_DEFAULT_ENCODING=UTF8 xcodebuild ${{ matrix.xcode_flags }} test | xcbeautify --renderer github-actions shell: bash - name: iPhone Simulator if: always() - run: xcodebuild ${{ matrix.xcode_flags }} test -sdk iphonesimulator -destination "name=iPhone 8" | xcpretty + run: set -o pipefail && xcodebuild ${{ matrix.xcode_flags }} test -sdk iphonesimulator -destination "name=iPhone 8" | xcbeautify --renderer github-actions shell: bash - name: Apple TV Simulator if: always() - run: xcodebuild ${{ matrix.xcode_flags }} test -sdk appletvsimulator -destination "name=Apple TV 4K (2nd generation)" | xcpretty + run: set -o pipefail && xcodebuild ${{ matrix.xcode_flags }} test -sdk appletvsimulator -destination "name=Apple TV 4K (2nd generation)" | xcbeautify --renderer github-actions shell: bash - name: watchOS Simulator if: always() - run: xcodebuild ${{ matrix.xcode_flags }} build -sdk watchsimulator | xcpretty - shell: bash - - xcodebuild_Ventura: - strategy: - matrix: - xcode: - - version: '14.3' - - version: '15.0' - xcode_flags: ['-scheme Yams -project Yams.xcodeproj'] - runs-on: macos-13 - env: - DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode.version }}.app - steps: - - uses: actions/checkout@v3 - - run: xcodebuild -version - - name: macOS with UTF16 - if: always() - run: YAMS_DEFAULT_ENCODING=UTF16 xcodebuild ${{ matrix.xcode_flags }} test | xcpretty + run: set -o pipefail && xcodebuild ${{ matrix.xcode_flags }} build -sdk watchsimulator | xcbeautify --renderer github-actions shell: bash - - name: macOS with UTF8 - if: always() - run: YAMS_DEFAULT_ENCODING=UTF8 xcodebuild ${{ matrix.xcode_flags }} test | xcpretty - shell: bash - - name: iPhone Simulator - if: always() - run: xcodebuild ${{ matrix.xcode_flags }} test -sdk iphonesimulator -destination "name=iPhone 8" | xcpretty - shell: bash - - name: Apple TV Simulator - if: always() - run: xcodebuild ${{ matrix.xcode_flags }} test -sdk appletvsimulator -destination "name=Apple TV 4K (2nd generation)" | xcpretty - shell: bash - - name: watchOS Simulator + - name: visionOS Simulator if: always() - run: xcodebuild ${{ matrix.xcode_flags }} build -sdk watchsimulator | xcpretty + run: set -o pipefail && xcodebuild ${{ matrix.xcode_flags }} build -sdk xrsimulator | xcbeautify --renderer github-actions shell: bash diff --git a/CHANGELOG.md b/CHANGELOG.md index 40f54fbb..92346113 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ##### Breaking -* None. +* Swift 5.7 or later is now required to build Yams. + [JP Simard](https://github.com/jpsim) ##### Enhancements @@ -14,6 +15,28 @@ [Tejas Sharma](https://github.com/tejassharma96) [#415](https://github.com/jpsim/Yams/issues/415) +## 5.1.3 + +##### Breaking + +* None. + +##### Enhancements + +* Add support for visionOS. + [ruralharry](http://github.com/ruralharry) + +* Add support for Android. + [finagolfin](http://github.com/finagolfin) + +* Add support for Bazel's `rules_swift` 2.x versions. + [Luis Padron](https://github.com/luispadron) + +##### Bug Fixes + +* Fix CI workflows. + [Tony Arnold](https://github.com/tonyarnold) + ## 5.1.2 ##### Breaking diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8b8df6ba..aebba6b3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,5 +19,5 @@ We follow the same syntax as [CocoaPods' `CHANGELOG.md`](https://github.com/Coco CI jobs for the latest official Swift and Xcode releases should be kept up to date based on the available Xcode versions that can be found -in the [actions/virtual-environments](https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md#xcode) +in the [actions/virtual-environments](https://github.com/actions/runner-images?tab=readme-ov-file#available-images) repo. diff --git a/Gemfile.lock b/Gemfile.lock index a3a3620e..07471447 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,30 +1,38 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.5) + CFPropertyList (3.0.7) + base64 + nkf rexml - activesupport (6.1.7.6) + activesupport (7.1.3.4) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) - zeitwerk (~> 2.3) - addressable (2.8.1) - public_suffix (>= 2.0.2, < 6.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) atomos (0.1.3) + base64 (0.2.0) + bigdecimal (3.1.8) claide (1.1.0) - cocoapods (1.11.3) + cocoapods (1.15.2) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.11.3) + cocoapods-core (= 1.15.2) cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.4.0, < 2.0) + cocoapods-downloader (>= 2.1, < 3.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) @@ -32,10 +40,10 @@ GEM gh_inspector (~> 1.0) molinillo (~> 0.8.0) nap (~> 1.0) - ruby-macho (>= 1.0, < 3.0) - xcodeproj (>= 1.21.0, < 2.0) - cocoapods-core (1.11.3) - activesupport (>= 5.0, < 7) + ruby-macho (>= 2.3.0, < 3.0) + xcodeproj (>= 1.23.0, < 2.0) + cocoapods-core (1.15.2) + activesupport (>= 5.0, < 8) addressable (~> 2.8) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) @@ -45,7 +53,7 @@ GEM public_suffix (~> 4.0) typhoeus (~> 1.0) cocoapods-deintegrate (1.0.5) - cocoapods-downloader (1.6.3) + cocoapods-downloader (2.1) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.1) @@ -54,58 +62,65 @@ GEM netrc (~> 0.11) cocoapods-try (1.2.0) colored2 (3.1.2) - concurrent-ruby (1.2.2) + concurrent-ruby (1.3.3) + connection_pool (2.4.1) + drb (2.2.1) escape (0.0.4) ethon (0.16.0) ffi (>= 1.15.0) - ffi (1.15.5) + ffi (1.17.0) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) - i18n (1.14.1) + i18n (1.14.5) concurrent-ruby (~> 1.0) - jazzy (0.14.2) + jazzy (0.15.1) cocoapods (~> 1.5) mustache (~> 1.1) open4 (~> 1.3) redcarpet (~> 3.4) - rexml (~> 3.2) - rouge (>= 2.0.6, < 4.0) + rexml (>= 3.2.7, < 4.0) + rouge (>= 2.0.6, < 5.0) sassc (~> 2.1) sqlite3 (~> 1.3) xcinvoke (~> 0.3.0) - json (2.6.3) + json (2.7.2) liferaft (0.0.6) - minitest (5.19.0) + mini_portile2 (2.8.7) + minitest (5.24.1) molinillo (0.8.0) mustache (1.1.1) + mutex_m (0.2.0) nanaimo (0.3.0) nap (1.1.0) netrc (0.11.0) + nkf (0.2.0) open4 (1.3.4) public_suffix (4.0.7) - redcarpet (3.5.1) - rexml (3.2.5) - rouge (3.28.0) + redcarpet (3.6.0) + rexml (3.2.9) + strscan + rouge (4.3.0) ruby-macho (2.5.1) sassc (2.4.0) ffi (~> 1.9) - sqlite3 (1.4.2) - typhoeus (1.4.0) + sqlite3 (1.7.3) + mini_portile2 (~> 2.8.0) + strscan (3.1.0) + typhoeus (1.4.1) ethon (>= 0.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) xcinvoke (0.3.0) liferaft (~> 0.0.6) - xcodeproj (1.22.0) + xcodeproj (1.24.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) nanaimo (~> 0.3.0) rexml (~> 3.2.4) - zeitwerk (2.6.11) PLATFORMS ruby @@ -115,4 +130,4 @@ DEPENDENCIES jazzy BUNDLED WITH - 2.3.8 + 2.5.11 diff --git a/MODULE.bazel b/MODULE.bazel index dc317a49..cf7ab293 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,11 +1,11 @@ module( name = "yams", - version = "5.1.2", + version = "5.1.3", compatibility_level = 1, ) bazel_dep(name = "apple_support", version = "1.15.1") -bazel_dep(name = "rules_swift", version = "1.18.0", repo_name = "build_bazel_rules_swift") +bazel_dep(name = "rules_swift", version = "1.18.0", repo_name = "build_bazel_rules_swift", max_compatibility_level = 2) bazel_dep(name = "platforms", version = "0.0.9", dev_dependency = True) bazel_dep(name = "rules_apple", version = "3.5.1", dev_dependency = True) diff --git a/Package.swift b/Package.swift index 5b302c18..3daf286f 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.4 +// swift-tools-version:5.7 import PackageDescription let package = Package( diff --git a/README.md b/README.md index 4152588d..484c53bb 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ A sweet and swifty [YAML](http://yaml.org/) parser built on ## Installation -Building Yams requires Xcode 12.5+ or a Swift 5.4+ toolchain with the +Building Yams requires Xcode 14.0+ or a Swift 5.7+ toolchain with the Swift Package Manager or CMake and Ninja. ### CMake @@ -38,7 +38,7 @@ cmake --build /path/to/build ### Swift Package Manager -Add `.package(url: "https://github.com/jpsim/Yams.git", from: "5.1.2")` to your +Add `.package(url: "https://github.com/jpsim/Yams.git", from: "5.1.3")` to your `Package.swift` file's `dependencies`. ### CocoaPods diff --git a/Sources/Yams/Encoder.swift b/Sources/Yams/Encoder.swift index a17711ee..fd17bac3 100644 --- a/Sources/Yams/Encoder.swift +++ b/Sources/Yams/Encoder.swift @@ -226,30 +226,18 @@ extension _Encoder: SingleValueEncodingContainer { func encode(_ value: T) throws where T: YAMLEncodable { assertCanEncodeNewValue() node = value.box() -#if swift(>=5.7) if let stringValue = value as? (any StringProtocol), stringValue.contains("\n") { node.scalar?.style = newlineScalarStyle } -#else - if let stringValue = value as? String, stringValue.contains("\n") { - node.scalar?.style = newlineScalarStyle - } -#endif } func encode(_ value: T) throws where T: Encodable { assertCanEncodeNewValue() if let encodable = value as? YAMLEncodable { node = encodable.box() -#if swift(>=5.7) if let stringValue = value as? (any StringProtocol), stringValue.contains("\n") { node.scalar?.style = newlineScalarStyle } -#else - if let stringValue = value as? String, stringValue.contains("\n") { - node.scalar?.style = newlineScalarStyle - } -#endif } else { try value.encode(to: self) } diff --git a/Sources/Yams/Representer.swift b/Sources/Yams/Representer.swift index a749c523..70310ff8 100644 --- a/Sources/Yams/Representer.swift +++ b/Sources/Yams/Representer.swift @@ -8,12 +8,16 @@ import Foundation -#if os(iOS) || os(macOS) || os(watchOS) || os(tvOS) +#if os(iOS) || os(macOS) || os(watchOS) || os(tvOS) || os(visionOS) import Darwin private let cpow: (_: Double, _: Double) -> Double = Darwin.pow #elseif os(Windows) import ucrt private let cpow: (_: Double, _: Double) -> Double = ucrt.pow +#elseif canImport(Bionic) +import CoreFoundation +import Bionic +private let cpow: (_: Double, _: Double) -> Double = Bionic.pow #else import CoreFoundation import Glibc diff --git a/Tests/YamsTests/ConstructorTests.swift b/Tests/YamsTests/ConstructorTests.swift index 53b76d3b..b9124b99 100644 --- a/Tests/YamsTests/ConstructorTests.swift +++ b/Tests/YamsTests/ConstructorTests.swift @@ -526,25 +526,6 @@ class ConstructorTests: XCTestCase { // swiftlint:disable:this type_body_length extension ConstructorTests { static var allTests: [(String, (ConstructorTests) -> () throws -> Void)] { -#if os(Windows) && swift(<5.6) - return [ - ("testBinary", testBinary), - ("testBool", testBool), - // ("testFloat", testFloat), - // ("testInt", testInt), - ("testMap", testMap), - // ("testMerge", testMerge), - ("testNull", testNull), - // ("testOmap", testOmap), - ("testPairs", testPairs), - ("testQuotationMark", testQuotationMark), - ("testSet", testSet), - ("testSeq", testSeq), - ("testTimestamp", testTimestamp), - ("testTimestampWithNanosecond", testTimestampWithNanosecond) - // ("testValue", testValue) - ] -#else return [ ("testBinary", testBinary), ("testBool", testBool), @@ -562,6 +543,5 @@ extension ConstructorTests { ("testTimestampWithNanosecond", testTimestampWithNanosecond), ("testValue", testValue) ] -#endif } } // swiftlint:disable:this file_length diff --git a/Tests/YamsTests/EncoderTests.swift b/Tests/YamsTests/EncoderTests.swift index bbda9273..e5a06dd2 100644 --- a/Tests/YamsTests/EncoderTests.swift +++ b/Tests/YamsTests/EncoderTests.swift @@ -250,7 +250,6 @@ class EncoderTests: XCTestCase { // swiftlint:disable:this type_body_length // https://github.com/jpsim/Yams/pull/95 struct Sample: Decodable { // Used for its decodable behavior, even though it's not referenced directly. - // swiftlint:disable:next unused_declaration let values: [String] } @@ -1150,38 +1149,6 @@ private struct Unkeyed: Codable, Equatable { extension EncoderTests { static var allTests: [(String, (EncoderTests) -> () throws -> Void)] { -#if os(Windows) && swift(<5.6) - return [ - ("testEncodingTopLevelEmptyStruct", testEncodingTopLevelEmptyStruct), - ("testEncodingTopLevelEmptyClass", testEncodingTopLevelEmptyClass), - ("testEncodingTopLevelSingleValueEnum", testEncodingTopLevelSingleValueEnum), - ("testEncodingTopLevelSingleValueStruct", testEncodingTopLevelSingleValueStruct), - // ("testEncodingTopLevelSingleValueClass", testEncodingTopLevelSingleValueClass), - // ("testEncodingTopLevelStructuredStruct", testEncodingTopLevelStructuredStruct), - ("testEncodingTopLevelStructuredClass", testEncodingTopLevelStructuredClass), - // ("testEncodingTopLevelStructuredSingleStruct", testEncodingTopLevelStructuredSingleStruct), - ("testEncodingTopLevelStructuredSingleClass", testEncodingTopLevelStructuredSingleClass), - // ("testEncodingTopLevelDeepStructuredType", testEncodingTopLevelDeepStructuredType), - // ("testEncodingClassWhichSharesEncoderWithSuper", testEncodingClassWhichSharesEncoderWithSuper), - ("testEncodingTopLevelNullableType", testEncodingTopLevelNullableType), - ("testEncodingDate", testEncodingDate), - ("testEncodingDateMillisecondsSince1970", testEncodingDateMillisecondsSince1970), - ("testEncodingBase64Data", testEncodingBase64Data), - // ("testNestedContainerCodingPaths", testNestedContainerCodingPaths), - // ("testSuperEncoderCodingPaths", testSuperEncoderCodingPaths), - ("testInterceptDecimal", testInterceptDecimal), - ("testInterceptURL", testInterceptURL), - // ("testValuesInSingleValueContainer", testValuesInSingleValueContainer), - // ("testValuesInKeyedContainer", testValuesInKeyedContainer), - // ("testValuesInUnkeyedContainer", testValuesInUnkeyedContainer), - ("testDictionary", testDictionary), - ("testNodeTypeMismatch", testNodeTypeMismatch), - // ("testDecodingConcreteTypeParameter", testDecodingConcreteTypeParameter), - ("testDecodingAnchors", testDecodingAnchors), - ("test_null_yml", test_null_yml), - ("testEncodingDateWithNanosecondGreaterThan999499977", testEncodingDateWithNanosecondGreaterThan999499977) - ] -#else return [ ("testEncodingTopLevelEmptyStruct", testEncodingTopLevelEmptyStruct), ("testEncodingTopLevelEmptyClass", testEncodingTopLevelEmptyClass), @@ -1213,6 +1180,5 @@ extension EncoderTests { ("testEncodingDateWithNanosecondGreaterThan999499977", testEncodingDateWithNanosecondGreaterThan999499977), ("testDecoderMark", testDecoderMark) ] -#endif } } // swiftlint:disable:this file_length diff --git a/Tests/YamsTests/NodeTests.swift b/Tests/YamsTests/NodeTests.swift index 933de986..7908b6fe 100644 --- a/Tests/YamsTests/NodeTests.swift +++ b/Tests/YamsTests/NodeTests.swift @@ -206,23 +206,6 @@ class NodeTests: XCTestCase { extension NodeTests { static var allTests: [(String, (NodeTests) -> () throws -> Void)] { -#if os(Windows) && swift(<5.6) - return [ - ("testExpressibleByArrayLiteral", testExpressibleByArrayLiteral), - ("testExpressibleByDictionaryLiteral", testExpressibleByDictionaryLiteral), - ("testExpressibleByFloatLiteral", testExpressibleByFloatLiteral), - ("testExpressibleByIntegerLiteral", testExpressibleByIntegerLiteral), - ("testExpressibleByStringLiteral", testExpressibleByStringLiteral), - // ("testTypedAccessorProperties", testTypedAccessorProperties), - // ("testArray", testArray), - ("testSubscriptMapping", testSubscriptMapping), - // ("testSubscriptSequence", testSubscriptSequence), - ("testSubscriptWithNonDefaultResolver", testSubscriptWithNonDefaultResolver), - ("testMappingBehavesLikeADictionary", testMappingBehavesLikeADictionary), - ("testSequenceBehavesLikeAnArray", testSequenceBehavesLikeAnArray), - ("testScalar", testScalar) - ] -#else return [ ("testExpressibleByArrayLiteral", testExpressibleByArrayLiteral), ("testExpressibleByDictionaryLiteral", testExpressibleByDictionaryLiteral), @@ -238,6 +221,5 @@ extension NodeTests { ("testSequenceBehavesLikeAnArray", testSequenceBehavesLikeAnArray), ("testScalar", testScalar) ] -#endif } } diff --git a/Tests/YamsTests/SpecTests.swift b/Tests/YamsTests/SpecTests.swift index 7e9145fb..91a4b6ff 100644 --- a/Tests/YamsTests/SpecTests.swift +++ b/Tests/YamsTests/SpecTests.swift @@ -916,39 +916,6 @@ class SpecTests: XCTestCase { // swiftlint:disable:this type_body_length extension SpecTests { static var allTests: [(String, (SpecTests) -> () throws -> Void)] { -#if os(Windows) && swift(<5.6) - return [ - ("testEmptyString", testEmptyString), - ("testMultibyteCharacters", testMultibyteCharacters), - // ("testSpecExample2_1_SequenceOfScalars", testSpecExample2_1_SequenceOfScalars), - // ("testSpecExample2_2_MappingScalarsToScalars", testSpecExample2_2_MappingScalarsToScalars), - ("testSpecExample2_3_MappingScalarsToSequences", testSpecExample2_3_MappingScalarsToSequences), - // ("testSpecExample2_4_SequenceOfMappings", testSpecExample2_4_SequenceOfMappings), - // ("testSpecExample2_5_SequenceOfSequences", testSpecExample2_5_SequenceOfSequences), - // ("testSpecExample2_6_MappingOfMappings", testSpecExample2_6_MappingOfMappings), - ("testSpecExample2_7_TwoDocumentsInAStream", testSpecExample2_7_TwoDocumentsInAStream), - // ("testSpecExample2_8_PlayByPlayFeedFromAGame", testSpecExample2_8_PlayByPlayFeedFromAGame), - ("testSpecExample2_9_SingleDocumentWithTwoComments", testSpecExample2_9_SingleDocumentWithTwoComments), - ("testSpecExample2_10_NodeForSammySosaAppearsTwiceInThisDocument", - testSpecExample2_10_NodeForSammySosaAppearsTwiceInThisDocument), - ("testSpecExample2_11_MappingBetweenSequences", testSpecExample2_11_MappingBetweenSequences), - // ("testSpecExample2_12_CompactNestedMapping", testSpecExample2_12_CompactNestedMapping), - ("testSpecExample2_13_Inliterals_NewlinesArePreserved", - testSpecExample2_13_Inliterals_NewlinesArePreserved), - ("testSpecExample2_14_InTheFoldedScalars_NewlinesBecomeSpaces", - testSpecExample2_14_InTheFoldedScalars_NewlinesBecomeSpaces), - ("testSpecExample2_15_InTheFoldedScalars_NewlinesBecomeSpaces", - testSpecExample2_15_InTheFoldedScalars_NewlinesBecomeSpaces), - ("testSpecExample2_16_IndentationDeterminesScope", testSpecExample2_16_IndentationDeterminesScope), - ("testSpecExample2_17_QuotedScalars", testSpecExample2_17_QuotedScalars), - ("testSpecExample2_18_MultiLineFlowScalars", testSpecExample2_18_MultiLineFlowScalars), - // ("testSpecExample2_19_Integers", testSpecExample2_19_Integers), - ("testSpecExample2_20_FloatingPoint", testSpecExample2_20_FloatingPoint), - ("testSpecExample2_23_VariousExplicitTags", testSpecExample2_23_VariousExplicitTags) - // ("testSpecExample2_27_Invoice", testSpecExample2_27_Invoice), - // ("testSpecExample2_28_LogFile", testSpecExample2_28_LogFile) - ] -#else return [ ("testEmptyString", testEmptyString), ("testMultibyteCharacters", testMultibyteCharacters), @@ -980,6 +947,5 @@ extension SpecTests { ("testSpecExample2_27_Invoice", testSpecExample2_27_Invoice), ("testSpecExample2_28_LogFile", testSpecExample2_28_LogFile) ] -#endif } } // swiftlint:disable:this file_length diff --git a/Yams.podspec b/Yams.podspec index c80d76c6..89ec778a 100644 --- a/Yams.podspec +++ b/Yams.podspec @@ -1,16 +1,17 @@ Pod::Spec.new do |s| - s.name = 'Yams' - s.version = '5.1.2' - s.summary = 'A sweet and swifty YAML parser.' - s.homepage = 'https://github.com/jpsim/Yams' - s.source = { :git => s.homepage + '.git', :tag => s.version } - s.license = { :type => 'MIT', :file => 'LICENSE' } - s.authors = { 'JP Simard' => 'jp@jpsim.com', + s.name = 'Yams' + s.version = '5.1.3' + s.summary = 'A sweet and swifty YAML parser.' + s.homepage = 'https://github.com/jpsim/Yams' + s.source = { :git => s.homepage + '.git', :tag => s.version } + s.license = { :type => 'MIT', :file => 'LICENSE' } + s.authors = { 'JP Simard' => 'jp@jpsim.com', 'Norio Nomura' => 'norio.nomura@gmail.com' } - s.source_files = 'Sources/**/*.{h,c,swift}' - s.swift_versions = ['5.4', '5.5', '5.6', '5.7', '5.8', '5.9', '5.10'] - s.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' } - s.ios.deployment_target = '11.0' - s.osx.deployment_target = '10.13' - s.tvos.deployment_target = '11.0' + s.source_files = 'Sources/**/*.{h,c,swift}' + s.swift_versions = ['5.7', '5.8', '5.9', '5.10'] + s.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' } + s.ios.deployment_target = '11.0' + s.osx.deployment_target = '10.13' + s.tvos.deployment_target = '11.0' + s.visionos.deployment_target = '1.0' end diff --git a/Yams.xcodeproj/Yams_Info.plist b/Yams.xcodeproj/Yams_Info.plist index 5abf4733..23ae08cb 100644 --- a/Yams.xcodeproj/Yams_Info.plist +++ b/Yams.xcodeproj/Yams_Info.plist @@ -14,7 +14,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 5.1.2 + 5.1.3 CFBundleSignature ???? CFBundleVersion diff --git a/Yams.xcodeproj/project.pbxproj b/Yams.xcodeproj/project.pbxproj index 0c05c0f2..a69ec6e4 100644 --- a/Yams.xcodeproj/project.pbxproj +++ b/Yams.xcodeproj/project.pbxproj @@ -334,7 +334,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\nif which swiftlint > /dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; + shellScript = "if $CI eq true; then\n # Don't run SwiftLint on CI — it's already running in a workflow\n exit 0\nfi\n\nexport PATH=\"$PATH:/opt/homebrew/bin\"\nif which swiftlint > /dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/cmake/modules/SwiftSupport.cmake b/cmake/modules/SwiftSupport.cmake index 4732e97f..85bb4920 100644 --- a/cmake/modules/SwiftSupport.cmake +++ b/cmake/modules/SwiftSupport.cmake @@ -35,6 +35,8 @@ function(swift_get_host_arch result_var_name) set("${result_var_name}" "i686" PARENT_SCOPE) elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686") set("${result_var_name}" "i686" PARENT_SCOPE) + elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "riscv64") + set("${result_var_name}" "riscv64" PARENT_SCOPE) else() message(FATAL_ERROR "Unrecognized architecture on host system: ${CMAKE_SYSTEM_PROCESSOR}") endif()