From d8bb3333e5430add9da400a8cc45e38ef18ee6a2 Mon Sep 17 00:00:00 2001 From: leogdion Date: Thu, 4 Apr 2024 21:58:15 -0400 Subject: [PATCH 01/23] Adding more to the matrix --- .github/workflows/Options.yml | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Options.yml b/.github/workflows/Options.yml index 93f78b6..eecdad3 100644 --- a/.github/workflows/Options.yml +++ b/.github/workflows/Options.yml @@ -69,12 +69,41 @@ jobs: env: PACKAGE_NAME: Options SWIFT_VER: ${{ matrix.swift-version }} - runs-on: ${{ matrix.runs-on }} + runs-on: ${{ matrix.os }} if: "!contains(github.event.head_commit.message, 'ci skip')" strategy: matrix: - runs-on: ["macos-12"] - xcode: ["/Applications/Xcode_14.1.app","/Applications/Xcode_14.2.app"] + include: + - xcode: "/Applications/Xcode_14.1.app" + os: macos-12 + iOSVersion: "16.1" + watchOSVersion: "9.0" + watchName: "Apple Watch Series 5 - 40mm" + iPhoneName: "iPhone 12 mini" + - xcode: "/Applications/Xcode_14.2.app" + os: macos-12 + iOSVersion: "16.2" + watchOSVersion: "9.1" + watchName: "Apple Watch Ultra (49mm)" + iPhoneName: "iPhone 14" + - xcode: "/Applications/Xcode_15.0.1.app" + os: macos-13 + iOSVersion: "17.0.1" + watchOSVersion: "10.0" + watchName: "Apple Watch Series 9 (41mm)" + iPhoneName: "iPhone 15" + - xcode: "/Applications/Xcode_15.1.app" + os: macos-13 + iOSVersion: "17.2" + watchOSVersion: "10.2" + watchName: "Apple Watch Series 9 (45mm)" + iPhoneName: "iPhone 15 Pro" + - xcode: "/Applications/Xcode_15.2.app" + os: macos-14 + iOSVersion: "17.2" + watchOSVersion: "10.2" + watchName: "Apple Watch Ultra (49mm)" + iPhoneName: "iPhone 15 Pro Max" steps: - uses: actions/checkout@v4 - name: Cache swift package modules From 9bd0f910052d7b2f21202a924793b6b164c1ec9d Mon Sep 17 00:00:00 2001 From: leogdion Date: Thu, 4 Apr 2024 22:00:28 -0400 Subject: [PATCH 02/23] Update Options.yml --- .github/workflows/Options.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Options.yml b/.github/workflows/Options.yml index eecdad3..a91494d 100644 --- a/.github/workflows/Options.yml +++ b/.github/workflows/Options.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: runs-on: [ubuntu-20.04, ubuntu-22.04] - swift-version: ["5.9.2", "5.10"] + swift-version: ["5.7.1", "5.8.1", "5.9.2", "5.10"] steps: - uses: actions/checkout@v4 - name: Cache swift package modules From b8198b2ad266c85914c4059200a8bff83a5e0e33 Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Thu, 4 Apr 2024 22:12:35 -0400 Subject: [PATCH 03/23] adding more tests --- .github/workflows/Options.yml | 112 +++++++++++++++++----------------- 1 file changed, 57 insertions(+), 55 deletions(-) diff --git a/.github/workflows/Options.yml b/.github/workflows/Options.yml index a91494d..6aba859 100644 --- a/.github/workflows/Options.yml +++ b/.github/workflows/Options.yml @@ -1,10 +1,8 @@ name: macOS - on: push: branches-ignore: - '*WIP' - jobs: build-ubuntu: name: Build on Ubuntu @@ -16,34 +14,36 @@ jobs: strategy: matrix: runs-on: [ubuntu-20.04, ubuntu-22.04] - swift-version: ["5.7.1", "5.8.1", "5.9.2", "5.10"] + swift-version: ["5.7.1", "5.8.1", "5.9", "5.9.2", "5.10"] steps: - uses: actions/checkout@v4 + - name: Set Ubuntu Release DOT + run: echo "RELEASE_DOT=$(lsb_release -sr)" >> $GITHUB_ENV + - name: Set Ubuntu Release NUM + run: echo "RELEASE_NUM=${RELEASE_DOT//[-._]/}" >> $GITHUB_ENV + - name: Set Ubuntu Codename + run: echo "RELEASE_NAME=$(lsb_release -sc)" >> $GITHUB_ENV - name: Cache swift package modules id: cache-spm-linux uses: actions/cache@v4 env: - cache-name: SPM + cache-name: cache-spm with: path: .build - key: ${{ env.cache-name }}-${{ runner.os }}-${{ env.SWIFT_VER }}-${{ hashFiles('Package.resolved') }}-${{ env.RELEASE_DOT }} + key: ${{ runner.os }}-${{ env.RELEASE_DOT }}-${{ env.cache-name }}-${{ matrix.swift-version }}-${{ hashFiles('Package.resolved') }} restore-keys: | - ${{ env.cache-name }}-${{ runner.os }}-${{ env.SWIFT_VER }}-${{ hashFiles('Package.resolved') }} - ${{ env.cache-name }}-${{ runner.os }}-${{ env.SWIFT_VER }} - - name: Set Ubuntu Release DOT - run: echo "RELEASE_DOT=$(lsb_release -sr)" >> $GITHUB_ENV - - name: Set Ubuntu Release NUM - run: echo "RELEASE_NUM=${RELEASE_DOT//[-._]/}" >> $GITHUB_ENV - - name: Set Ubuntu Codename - run: echo "RELEASE_NAME=$(lsb_release -sc)" >> $GITHUB_ENV + ${{ runner.os }}-${{ env.RELEASE_DOT }}-${{ env.cache-name }}-${{ matrix.swift-version }}- + ${{ runner.os }}-${{ env.RELEASE_DOT }}-${{ env.cache-name }}- - name: Cache swift id: cache-swift-linux uses: actions/cache@v4 env: - cache-name: swift + cache-name: cache-swift with: path: swift-${{ env.SWIFT_VER }}-RELEASE-ubuntu${{ env.RELEASE_DOT }} - key: ${{ env.cache-name }}-${{ runner.os }}-${{ env.SWIFT_VER }}-${{ env.RELEASE_DOT }} + key: ${{ runner.os }}-${{ env.cache-name }}-${{ matrix.swift-version }}-${{ env.RELEASE_DOT }} + restore-keys: | + ${{ runner.os }}-${{ env.cache-name }}-${{ matrix.swift-version }}- - name: Download Swift if: steps.cache-swift-linux.outputs.cache-hit != 'true' run: curl -O https://download.swift.org/swift-${SWIFT_VER}-release/ubuntu${RELEASE_NUM}/swift-${SWIFT_VER}-RELEASE/swift-${SWIFT_VER}-RELEASE-ubuntu${RELEASE_DOT}.tar.gz @@ -52,23 +52,22 @@ jobs: run: tar xzf swift-${SWIFT_VER}-RELEASE-ubuntu${RELEASE_DOT}.tar.gz - name: Add Path run: echo "$GITHUB_WORKSPACE/swift-${SWIFT_VER}-RELEASE-ubuntu${RELEASE_DOT}/usr/bin" >> $GITHUB_PATH - - name: Build - run: swift build - name: Test - run: swift test --enable-code-coverage + run: swift test --enable-code-coverage - uses: sersoft-gmbh/swift-coverage-action@v4 + id: coverage-files with: fail-on-empty-output: true - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4 + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: spm,${{ env.RELEASE_NAME }},${{ env.SWIFT_VER }} + fail_ci_if_error: true + flags: swift-${{ matrix.swift-version }},ubuntu-${{ matrix.RELEASE_DOT }} + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} + files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }} build-macos: name: Build on macOS - env: - PACKAGE_NAME: Options - SWIFT_VER: ${{ matrix.swift-version }} runs-on: ${{ matrix.os }} if: "!contains(github.event.head_commit.message, 'ci skip')" strategy: @@ -113,13 +112,11 @@ jobs: cache-name: cache-spm with: path: .build - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Package.resolved') }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}-${{ hashFiles('Package.resolved') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}- - name: Cache mint - if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_15.2.app' }} + if: startsWith(matrix.xcode,'/Applications/Xcode_15.2') id: cache-mint uses: actions/cache@v4 env: @@ -136,7 +133,7 @@ jobs: - name: Setup Xcode run: sudo xcode-select -s ${{ matrix.xcode }}/Contents/Developer - name: Install mint - if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_15.2.app' }} + if: startsWith(matrix.xcode,'/Applications/Xcode_15.2') run: | brew update brew install mint @@ -156,30 +153,35 @@ jobs: run: rm -rf .build - name: Lint run: ./scripts/lint.sh - if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_15.2.app' }} - # - name: Run iOS target tests - # run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test - # - uses: sersoft-gmbh/swift-coverage-action@v4 - # - name: Upload coverage reports to Codecov - # uses: codecov/codecov-action@v4 - # env: - # token: ${{ secrets.CODECOV_TOKEN }} - # with: - # flags: iOS,iOS${{ matrix.iOSVersion }},macOS,${{ env.XCODE_NAME }} - # - name: Run watchOS target tests - # run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk watchsimulator -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test - # - uses: sersoft-gmbh/swift-coverage-action@v4 - # with: - # fail-on-empty-output: true - # - name: Upload coverage reports to Codecov - # uses: codecov/codecov-action@v4 - # env: - # token: ${{ secrets.CODECOV_TOKEN }} - # with: - # token: ${{ secrets.CODECOV_TOKEN }} - # flags: watchOS,watchOS${{ matrix.watchOSVersion }},macOS,${{ env.XCODE_NAME }} - # - name: Test Again - # run: swift test + if: startsWith(matrix.xcode,'/Applications/Xcode_15.2') + - name: Run iOS target tests + run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test + - uses: sersoft-gmbh/swift-coverage-action@v4 + id: coverage-files + with: + fail-on-empty-output: true + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true\ + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} + files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }} + flags: iOS,iOS${{ matrix.iOSVersion }},macOS,${{ env.XCODE_NAME }} + - name: Run watchOS target tests + run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk watchsimulator -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test + - uses: sersoft-gmbh/swift-coverage-action@v4 + id: coverage-files + with: + fail-on-empty-output: true + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true\ + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} + files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }} + flags: watchOS,watchOS${{ matrix.watchOSVersion }},macOS,${{ env.XCODE_NAME }} build-self: name: Build on Self-Hosting macOS runs-on: [self-hosted, macOS] From bbb3deb4899adac5295588fbfd321796888e9072 Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Thu, 4 Apr 2024 22:16:07 -0400 Subject: [PATCH 04/23] fixup! adding more tests --- .github/workflows/Options.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Options.yml b/.github/workflows/Options.yml index 6aba859..3cceaf6 100644 --- a/.github/workflows/Options.yml +++ b/.github/workflows/Options.yml @@ -142,11 +142,13 @@ jobs: - name: Run Swift Package tests run: swift test --enable-code-coverage - uses: sersoft-gmbh/swift-coverage-action@v4 + id: coverage-files-spm with: fail-on-empty-output: true - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4 with: + files: ${{ join(fromJSON(steps.coverage-files-spm.outputs.files), ',') }} token: ${{ secrets.CODECOV_TOKEN }} flags: macOS,${{ env.XCODE_NAME }},${{ matrix.runs-on }} - name: Clean up spm build directory @@ -157,30 +159,30 @@ jobs: - name: Run iOS target tests run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test - uses: sersoft-gmbh/swift-coverage-action@v4 - id: coverage-files + id: coverage-files-iOS with: fail-on-empty-output: true - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: - fail_ci_if_error: true\ + fail_ci_if_error: true verbose: true token: ${{ secrets.CODECOV_TOKEN }} - files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }} + files: ${{ join(fromJSON(steps.coverage-files-iOS.outputs.files), ',') }} flags: iOS,iOS${{ matrix.iOSVersion }},macOS,${{ env.XCODE_NAME }} - name: Run watchOS target tests run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk watchsimulator -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test - uses: sersoft-gmbh/swift-coverage-action@v4 - id: coverage-files + id: coverage-files-watchOS with: fail-on-empty-output: true - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: - fail_ci_if_error: true\ + fail_ci_if_error: true verbose: true token: ${{ secrets.CODECOV_TOKEN }} - files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }} + files: ${{ join(fromJSON(steps.coverage-files-watchOS.outputs.files), ',') }} flags: watchOS,watchOS${{ matrix.watchOSVersion }},macOS,${{ env.XCODE_NAME }} build-self: name: Build on Self-Hosting macOS From fa07b0807a0913a606b876d1faffbb66c057a60d Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Thu, 4 Apr 2024 22:28:23 -0400 Subject: [PATCH 05/23] fixing macro to 5.9.1 --- Package@swift-5.9.swift => Package@swift-5.9.1.swift | 0 Sources/Options/Macro.swift | 2 +- Sources/Options/MappedValueRepresentableError.swift | 2 +- Tests/OptionsTests/Mocks/MockCollectionEnum.swift | 2 +- Tests/OptionsTests/Mocks/MockDictionaryEnum.swift | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename Package@swift-5.9.swift => Package@swift-5.9.1.swift (100%) diff --git a/Package@swift-5.9.swift b/Package@swift-5.9.1.swift similarity index 100% rename from Package@swift-5.9.swift rename to Package@swift-5.9.1.swift diff --git a/Sources/Options/Macro.swift b/Sources/Options/Macro.swift index f1483c2..83e18d9 100644 --- a/Sources/Options/Macro.swift +++ b/Sources/Options/Macro.swift @@ -29,7 +29,7 @@ import Foundation -#if swift(>=5.9) +#if swift(>=5.9.1) @attached( extension, conformances: MappedValueRepresentable, MappedValueGenericRepresented, diff --git a/Sources/Options/MappedValueRepresentableError.swift b/Sources/Options/MappedValueRepresentableError.swift index 582e869..4745d26 100644 --- a/Sources/Options/MappedValueRepresentableError.swift +++ b/Sources/Options/MappedValueRepresentableError.swift @@ -30,7 +30,7 @@ import Foundation // swiftlint:disable file_types_order -#if swift(>=5.9) +#if swift(>=5.9.1) /// An Error thrown when the `MappedType` value or `RawType` value /// are invalid for an `Enum`. public enum MappedValueRepresentableError: Error { diff --git a/Tests/OptionsTests/Mocks/MockCollectionEnum.swift b/Tests/OptionsTests/Mocks/MockCollectionEnum.swift index 53803a5..6598d48 100644 --- a/Tests/OptionsTests/Mocks/MockCollectionEnum.swift +++ b/Tests/OptionsTests/Mocks/MockCollectionEnum.swift @@ -29,7 +29,7 @@ import Options -#if swift(>=5.9) +#if swift(>=5.9.1) // swiftlint:disable identifier_name @Options internal enum MockCollectionEnum: Int, Sendable { diff --git a/Tests/OptionsTests/Mocks/MockDictionaryEnum.swift b/Tests/OptionsTests/Mocks/MockDictionaryEnum.swift index 8bca484..4f0553e 100644 --- a/Tests/OptionsTests/Mocks/MockDictionaryEnum.swift +++ b/Tests/OptionsTests/Mocks/MockDictionaryEnum.swift @@ -29,7 +29,7 @@ import Options -#if swift(>=5.9) +#if swift(>=5.9.1) // swiftlint:disable identifier_name @Options internal enum MockDictionaryEnum: Int, Sendable { From 3f750938658fc05d0a907cca745745620e357709 Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Thu, 4 Apr 2024 22:30:19 -0400 Subject: [PATCH 06/23] fixing linting issue --- .../{MappedValueCollectionRepresented.swift => Array.swift} | 6 ++---- ...pedValueDictionaryRepresented.swift => Dictionary.swift} | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) rename Sources/Options/{MappedValueCollectionRepresented.swift => Array.swift} (92%) rename Sources/Options/{MappedValueDictionaryRepresented.swift => Dictionary.swift} (97%) diff --git a/Sources/Options/MappedValueCollectionRepresented.swift b/Sources/Options/Array.swift similarity index 92% rename from Sources/Options/MappedValueCollectionRepresented.swift rename to Sources/Options/Array.swift index e595d9c..e192aa1 100644 --- a/Sources/Options/MappedValueCollectionRepresented.swift +++ b/Sources/Options/Array.swift @@ -1,5 +1,5 @@ // -// MappedValueCollectionRepresented.swift +// Array.swift // SimulatorServices // // Created by Leo Dion. @@ -30,9 +30,7 @@ // swiftlint:disable:next line_length @available(*, deprecated, renamed: "MappedValueGenericRepresented", message: "Use MappedValueGenericRepresented instead.") public protocol MappedValueCollectionRepresented: MappedValueGenericRepresented - where MappedValueType: Sequence { - /// An array of the mapped values which lines up with each case. -} + where MappedValueType: Sequence {} extension Array: MappedValues where Element: Equatable { public func key(value: Element) throws -> Int { diff --git a/Sources/Options/MappedValueDictionaryRepresented.swift b/Sources/Options/Dictionary.swift similarity index 97% rename from Sources/Options/MappedValueDictionaryRepresented.swift rename to Sources/Options/Dictionary.swift index ad35e03..79e2b8e 100644 --- a/Sources/Options/MappedValueDictionaryRepresented.swift +++ b/Sources/Options/Dictionary.swift @@ -1,5 +1,5 @@ // -// MappedValueDictionaryRepresented.swift +// Dictionary.swift // SimulatorServices // // Created by Leo Dion. From 2545bb0378296eed8b342b2bacd0a69ca42229af Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Thu, 4 Apr 2024 22:36:55 -0400 Subject: [PATCH 07/23] fixing runs --- .github/workflows/Options.yml | 4 ++-- Package@swift-5.9.1.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Options.yml b/.github/workflows/Options.yml index 3cceaf6..9d3c0d0 100644 --- a/.github/workflows/Options.yml +++ b/.github/workflows/Options.yml @@ -112,9 +112,9 @@ jobs: cache-name: cache-spm with: path: .build - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}-${{ hashFiles('Package.resolved') }} + key: ${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}-${{ hashFiles('Package.resolved') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}- + ${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}- - name: Cache mint if: startsWith(matrix.xcode,'/Applications/Xcode_15.2') id: cache-mint diff --git a/Package@swift-5.9.1.swift b/Package@swift-5.9.1.swift index a80de37..456c4e7 100644 --- a/Package@swift-5.9.1.swift +++ b/Package@swift-5.9.1.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:5.9.1 // swiftlint:disable explicit_top_level_acl // swiftlint:disable prefixed_toplevel_constant From f5fb5c4598ef4c33cebe7acaad0ccba5b4d5d5c6 Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Thu, 4 Apr 2024 22:42:52 -0400 Subject: [PATCH 08/23] trying to fix old Xcode problem --- Package.swift | 2 +- Package@swift-5.9.1.swift | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Package.swift b/Package.swift index 603ef85..5646b68 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.7.1 +// swift-tools-version: 5.7.1 // swiftlint:disable explicit_top_level_acl // swiftlint:disable prefixed_toplevel_constant diff --git a/Package@swift-5.9.1.swift b/Package@swift-5.9.1.swift index 456c4e7..6790c99 100644 --- a/Package@swift-5.9.1.swift +++ b/Package@swift-5.9.1.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9.1 +// swift-tools-version: 5.9.1 // swiftlint:disable explicit_top_level_acl // swiftlint:disable prefixed_toplevel_constant @@ -15,8 +15,7 @@ let swiftSettings = [ SwiftSetting.enableUpcomingFeature("ImplicitOpenExistentials"), SwiftSetting.enableUpcomingFeature("StrictConcurrency"), SwiftSetting.enableUpcomingFeature("DisableOutwardActorInference"), - SwiftSetting.enableExperimentalFeature("StrictConcurrency"), - SwiftSetting.unsafeFlags(["-warn-concurrency", "-enable-actor-data-race-checks"]) + SwiftSetting.enableExperimentalFeature("StrictConcurrency") ] let package = Package( @@ -29,7 +28,7 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/apple/swift-syntax", from: "510.0.0") + .package(url: "https://github.com/apple/swift-syntax", from: "509.0.0") // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0") ], From 0c2e51cb0d75b2e59c86a81b113ae0957f0b2aa0 Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Thu, 4 Apr 2024 22:44:05 -0400 Subject: [PATCH 09/23] Adding new version for Swift 5.10 --- Package@swift-5.10.swift | 58 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Package@swift-5.10.swift diff --git a/Package@swift-5.10.swift b/Package@swift-5.10.swift new file mode 100644 index 0000000..88ed6e2 --- /dev/null +++ b/Package@swift-5.10.swift @@ -0,0 +1,58 @@ +// swift-tools-version: 5.10 + +// swiftlint:disable explicit_top_level_acl +// swiftlint:disable prefixed_toplevel_constant +// swiftlint:disable explicit_acl + +import CompilerPluginSupport +import PackageDescription + +let swiftSettings = [ + SwiftSetting.enableUpcomingFeature("BareSlashRegexLiterals"), + SwiftSetting.enableUpcomingFeature("ConciseMagicFile"), + SwiftSetting.enableUpcomingFeature("ExistentialAny"), + SwiftSetting.enableUpcomingFeature("ForwardTrailingClosures"), + SwiftSetting.enableUpcomingFeature("ImplicitOpenExistentials"), + SwiftSetting.enableUpcomingFeature("StrictConcurrency"), + SwiftSetting.enableUpcomingFeature("DisableOutwardActorInference"), + SwiftSetting.enableExperimentalFeature("StrictConcurrency") +] + +let package = Package( + name: "Options", + platforms: [.macOS(.v10_15)], + products: [ + .library( + name: "Options", + targets: ["Options"] + ) + ], + dependencies: [ + .package(url: "https://github.com/apple/swift-syntax", from: "510.0.0") + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0") + ], + targets: [ + .target( + name: "Options", + dependencies: ["OptionsMacros"], + swiftSettings: swiftSettings + ), + .macro( + name: "OptionsMacros", + dependencies: [ + .product(name: "SwiftSyntaxMacros", package: "swift-syntax"), + .product(name: "SwiftCompilerPlugin", package: "swift-syntax") + ], + swiftSettings: swiftSettings + ), + .testTarget( + name: "OptionsTests", + dependencies: ["Options"] + ) + ] +) + +// swiftlint:enable explicit_top_level_acl +// swiftlint:enable prefixed_toplevel_constant +// swiftlint:enable explicit_acl From bd10e69ad27086feb5f9284a03e91c623da7fc81 Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Thu, 4 Apr 2024 22:49:55 -0400 Subject: [PATCH 10/23] trying one more thing --- Package@swift-5.9.1.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package@swift-5.9.1.swift b/Package@swift-5.9.1.swift index 6790c99..5f977e7 100644 --- a/Package@swift-5.9.1.swift +++ b/Package@swift-5.9.1.swift @@ -20,7 +20,7 @@ let swiftSettings = [ let package = Package( name: "Options", - platforms: [.macOS(.v10_15)], + platforms: [.macOS(.v12)], products: [ .library( name: "Options", From 4621e3a4dc6dc6c6cf8ddd39a148af3e8e2f96ed Mon Sep 17 00:00:00 2001 From: leogdion Date: Fri, 5 Apr 2024 11:15:23 -0400 Subject: [PATCH 11/23] testing macros issues --- .github/workflows/Options.yml | 40 ++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/Options.yml b/.github/workflows/Options.yml index 9d3c0d0..e7f0da9 100644 --- a/.github/workflows/Options.yml +++ b/.github/workflows/Options.yml @@ -85,24 +85,30 @@ jobs: watchOSVersion: "9.1" watchName: "Apple Watch Ultra (49mm)" iPhoneName: "iPhone 14" - - xcode: "/Applications/Xcode_15.0.1.app" - os: macos-13 - iOSVersion: "17.0.1" - watchOSVersion: "10.0" - watchName: "Apple Watch Series 9 (41mm)" - iPhoneName: "iPhone 15" - - xcode: "/Applications/Xcode_15.1.app" - os: macos-13 - iOSVersion: "17.2" - watchOSVersion: "10.2" - watchName: "Apple Watch Series 9 (45mm)" - iPhoneName: "iPhone 15 Pro" - - xcode: "/Applications/Xcode_15.2.app" + # - xcode: "/Applications/Xcode_15.0.1.app" + # os: macos-13 + # iOSVersion: "17.0.1" + # watchOSVersion: "10.0" + # watchName: "Apple Watch Series 9 (41mm)" + # iPhoneName: "iPhone 15" + # - xcode: "/Applications/Xcode_15.1.app" + # os: macos-13 + # iOSVersion: "17.2" + # watchOSVersion: "10.2" + # watchName: "Apple Watch Series 9 (45mm)" + # iPhoneName: "iPhone 15 Plus" + # - xcode: "/Applications/Xcode_15.2.app" + # os: macos-14 + # iOSVersion: "17.2" + # watchOSVersion: "10.2" + # watchName: "Apple Watch Ultra (49mm)" + # iPhoneName: "iPhone 15 Pro" + - xcode: "/Applications/Xcode_15.3.app" os: macos-14 - iOSVersion: "17.2" - watchOSVersion: "10.2" - watchName: "Apple Watch Ultra (49mm)" - iPhoneName: "iPhone 15 Pro Max" + iOSVersion: "17.4" + watchOSVersion: "10.4" + watchName: "Apple Watch Ultra 2 (49mm)" + iPhoneName: "iPhone 15 Pro Max" steps: - uses: actions/checkout@v4 - name: Cache swift package modules From 3f20c82b4bc5c8cb272991f9eda76ff5e66b26c4 Mon Sep 17 00:00:00 2001 From: leogdion Date: Fri, 5 Apr 2024 11:18:58 -0400 Subject: [PATCH 12/23] Update Options.yml --- .github/workflows/Options.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Options.yml b/.github/workflows/Options.yml index e7f0da9..479fd18 100644 --- a/.github/workflows/Options.yml +++ b/.github/workflows/Options.yml @@ -163,7 +163,7 @@ jobs: run: ./scripts/lint.sh if: startsWith(matrix.xcode,'/Applications/Xcode_15.2') - name: Run iOS target tests - run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test + run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk "iphonesimulator" -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test - uses: sersoft-gmbh/swift-coverage-action@v4 id: coverage-files-iOS with: @@ -177,7 +177,7 @@ jobs: files: ${{ join(fromJSON(steps.coverage-files-iOS.outputs.files), ',') }} flags: iOS,iOS${{ matrix.iOSVersion }},macOS,${{ env.XCODE_NAME }} - name: Run watchOS target tests - run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk watchsimulator -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test + run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk "watchsimulator" -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test - uses: sersoft-gmbh/swift-coverage-action@v4 id: coverage-files-watchOS with: From be140ab76a61831a77c888b36eadfa4125eca8d9 Mon Sep 17 00:00:00 2001 From: leogdion Date: Fri, 5 Apr 2024 11:21:43 -0400 Subject: [PATCH 13/23] Update Options.yml --- .github/workflows/Options.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/Options.yml b/.github/workflows/Options.yml index 479fd18..9eacb8b 100644 --- a/.github/workflows/Options.yml +++ b/.github/workflows/Options.yml @@ -3,6 +3,8 @@ on: push: branches-ignore: - '*WIP' +env: + PACKAGE_NAME: Options jobs: build-ubuntu: name: Build on Ubuntu @@ -70,6 +72,8 @@ jobs: name: Build on macOS runs-on: ${{ matrix.os }} if: "!contains(github.event.head_commit.message, 'ci skip')" + env: + PACKAGE_NAME: Options strategy: matrix: include: From feb8c0376adcbbfa4cd07cebcc6ce2777421646e Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Fri, 5 Apr 2024 11:26:09 -0400 Subject: [PATCH 14/23] fixing os versions --- Package@swift-5.10.swift | 9 ++++++++- Package@swift-5.9.1.swift | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Package@swift-5.10.swift b/Package@swift-5.10.swift index 88ed6e2..da62733 100644 --- a/Package@swift-5.10.swift +++ b/Package@swift-5.10.swift @@ -20,7 +20,14 @@ let swiftSettings = [ let package = Package( name: "Options", - platforms: [.macOS(.v10_15)], + platforms: [ + .macOS(.v10_15), + .iOS(.v13), + .tvOS(.v13), + .watchOS(.v6), + .macCatalyst(.v13), + .visionOS(.v1) + ], products: [ .library( name: "Options", diff --git a/Package@swift-5.9.1.swift b/Package@swift-5.9.1.swift index 5f977e7..56cc315 100644 --- a/Package@swift-5.9.1.swift +++ b/Package@swift-5.9.1.swift @@ -20,7 +20,14 @@ let swiftSettings = [ let package = Package( name: "Options", - platforms: [.macOS(.v12)], + platforms: [ + .macOS(.v10_15), + .iOS(.v13), + .tvOS(.v13), + .watchOS(.v6), + .macCatalyst(.v13), + .visionOS(.v1) + ], products: [ .library( name: "Options", From 1e66112ba3af2d4d23a60a453e3c082c90427349 Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Fri, 5 Apr 2024 14:08:22 -0400 Subject: [PATCH 15/23] fixing macros --- Tests/LinuxMain.swift | 37 ------- Tests/OptionsTests/EnumSetTests.swift | 98 +++++++++---------- Tests/OptionsTests/MappedEnumTests.swift | 69 +++++++------ ...appedValueCollectionRepresentedTests.swift | 83 ++++++++-------- ...appedValueDictionaryRepresentedTests.swift | 83 ++++++++-------- .../MappedValueRepresentableTests.swift | 21 ++-- Tests/OptionsTests/XCTestManifests.swift | 98 ------------------- 7 files changed, 170 insertions(+), 319 deletions(-) delete mode 100644 Tests/LinuxMain.swift delete mode 100644 Tests/OptionsTests/XCTestManifests.swift diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift deleted file mode 100644 index 78af61c..0000000 --- a/Tests/LinuxMain.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// LinuxMain.swift -// SimulatorServices -// -// Created by Leo Dion. -// Copyright © 2024 BrightDigit. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -import XCTest - -import OptionsTests - -var tests = [XCTestCaseEntry]() -tests += OptionsTests.__allTests() - -XCTMain(tests) diff --git a/Tests/OptionsTests/EnumSetTests.swift b/Tests/OptionsTests/EnumSetTests.swift index 7b44cd3..c741779 100644 --- a/Tests/OptionsTests/EnumSetTests.swift +++ b/Tests/OptionsTests/EnumSetTests.swift @@ -27,64 +27,62 @@ // OTHER DEALINGS IN THE SOFTWARE. // -#if canImport(XCTest) - @testable import Options - import XCTest +@testable import Options +import XCTest - internal final class EnumSetTests: XCTestCase { - private static let text = "[\"a\",\"b\",\"c\"]" +internal final class EnumSetTests: XCTestCase { + private static let text = "[\"a\",\"b\",\"c\"]" - internal func testDecoder() { - // swiftlint:disable:next force_unwrapping - let data = Self.text.data(using: .utf8)! - let decoder = JSONDecoder() - let actual: EnumSet - do { - actual = try decoder.decode(EnumSet.self, from: data) - } catch { - XCTAssertNil(error) - return - } - XCTAssertEqual(actual.rawValue, 7) + internal func testDecoder() { + // swiftlint:disable:next force_unwrapping + let data = Self.text.data(using: .utf8)! + let decoder = JSONDecoder() + let actual: EnumSet + do { + actual = try decoder.decode(EnumSet.self, from: data) + } catch { + XCTAssertNil(error) + return } + XCTAssertEqual(actual.rawValue, 7) + } - internal func testEncoder() { - let enumSet = EnumSet(values: [.a, .b, .c]) - let encoder = JSONEncoder() - let data: Data - do { - data = try encoder.encode(enumSet) - } catch { - XCTAssertNil(error) - return - } - - let dataText = String(bytes: data, encoding: .utf8) + internal func testEncoder() { + let enumSet = EnumSet(values: [.a, .b, .c]) + let encoder = JSONEncoder() + let data: Data + do { + data = try encoder.encode(enumSet) + } catch { + XCTAssertNil(error) + return + } - guard let text = dataText else { - XCTAssertNotNil(dataText) - return - } + let dataText = String(bytes: data, encoding: .utf8) - XCTAssertEqual(text, Self.text) + guard let text = dataText else { + XCTAssertNotNil(dataText) + return } - internal func testInitValue() { - let set = EnumSet(rawValue: 7) - XCTAssertEqual(set.rawValue, 7) - } + XCTAssertEqual(text, Self.text) + } - internal func testInitValues() { - let values: [MockCollectionEnum] = [.a, .b, .c] - let set = EnumSet(values: values) - XCTAssertEqual(set.rawValue, 7) - } + internal func testInitValue() { + let set = EnumSet(rawValue: 7) + XCTAssertEqual(set.rawValue, 7) + } - internal func testArray() { - let expected: [MockCollectionEnum] = [.b, .d] - let enumSet = EnumSet(values: expected) - let actual = enumSet.array() - XCTAssertEqual(actual, expected) - } + internal func testInitValues() { + let values: [MockCollectionEnum] = [.a, .b, .c] + let set = EnumSet(values: values) + XCTAssertEqual(set.rawValue, 7) + } + + internal func testArray() { + let expected: [MockCollectionEnum] = [.b, .d] + let enumSet = EnumSet(values: expected) + let actual = enumSet.array() + XCTAssertEqual(actual, expected) } -#endif +} diff --git a/Tests/OptionsTests/MappedEnumTests.swift b/Tests/OptionsTests/MappedEnumTests.swift index ee0bdc8..1e19650 100644 --- a/Tests/OptionsTests/MappedEnumTests.swift +++ b/Tests/OptionsTests/MappedEnumTests.swift @@ -27,46 +27,43 @@ // OTHER DEALINGS IN THE SOFTWARE. // -#if canImport(XCTest) - @testable import Options - import XCTest +@testable import Options +import XCTest - internal final class MappedEnumTests: XCTestCase { - private static let text = "\"a\"" - internal func testDecoder() throws { - // swiftlint:disable:next force_unwrapping - let data = Self.text.data(using: .utf8)! - let decoder = JSONDecoder() - let actual: MappedEnum - do { - actual = try decoder.decode(MappedEnum.self, from: data) - } catch { - XCTAssertNil(error) - return - } - XCTAssertEqual(actual.value, .a) +internal final class MappedEnumTests: XCTestCase { + private static let text = "\"a\"" + internal func testDecoder() throws { + // swiftlint:disable:next force_unwrapping + let data = Self.text.data(using: .utf8)! + let decoder = JSONDecoder() + let actual: MappedEnum + do { + actual = try decoder.decode(MappedEnum.self, from: data) + } catch { + XCTAssertNil(error) + return } + XCTAssertEqual(actual.value, .a) + } - internal func testEncoder() throws { - let encoder = JSONEncoder() - let describedEnum: MappedEnum = .init(value: .a) - let data: Data - do { - data = try encoder.encode(describedEnum) - } catch { - XCTAssertNil(error) - return - } - - let dataText = String(bytes: data, encoding: .utf8) + internal func testEncoder() throws { + let encoder = JSONEncoder() + let describedEnum: MappedEnum = .init(value: .a) + let data: Data + do { + data = try encoder.encode(describedEnum) + } catch { + XCTAssertNil(error) + return + } - guard let text = dataText else { - XCTAssertNotNil(dataText) - return - } + let dataText = String(bytes: data, encoding: .utf8) - XCTAssertEqual(text, Self.text) + guard let text = dataText else { + XCTAssertNotNil(dataText) + return } - } -#endif + XCTAssertEqual(text, Self.text) + } +} diff --git a/Tests/OptionsTests/MappedValueCollectionRepresentedTests.swift b/Tests/OptionsTests/MappedValueCollectionRepresentedTests.swift index bdf1e1e..8719c74 100644 --- a/Tests/OptionsTests/MappedValueCollectionRepresentedTests.swift +++ b/Tests/OptionsTests/MappedValueCollectionRepresentedTests.swift @@ -27,54 +27,51 @@ // OTHER DEALINGS IN THE SOFTWARE. // -#if canImport(XCTest) - @testable import Options - import XCTest +@testable import Options +import XCTest - internal final class MappedValueCollectionRepresentedTests: XCTestCase { - internal func testRawValue() { - try XCTAssertEqual(MockCollectionEnum.rawValue(basedOn: "a"), 0) - try XCTAssertEqual(MockCollectionEnum.rawValue(basedOn: "b"), 1) - try XCTAssertEqual(MockCollectionEnum.rawValue(basedOn: "c"), 2) - try XCTAssertEqual(MockCollectionEnum.rawValue(basedOn: "d"), 3) - } - - internal func testString() { - try XCTAssertEqual(MockCollectionEnum.mappedValue(basedOn: 0), "a") - try XCTAssertEqual(MockCollectionEnum.mappedValue(basedOn: 1), "b") - try XCTAssertEqual(MockCollectionEnum.mappedValue(basedOn: 2), "c") - try XCTAssertEqual(MockCollectionEnum.mappedValue(basedOn: 3), "d") - } +internal final class MappedValueCollectionRepresentedTests: XCTestCase { + internal func testRawValue() { + try XCTAssertEqual(MockCollectionEnum.rawValue(basedOn: "a"), 0) + try XCTAssertEqual(MockCollectionEnum.rawValue(basedOn: "b"), 1) + try XCTAssertEqual(MockCollectionEnum.rawValue(basedOn: "c"), 2) + try XCTAssertEqual(MockCollectionEnum.rawValue(basedOn: "d"), 3) + } - internal func testRawValueFailure() { - let caughtError: MappedValueRepresentableError? - do { - _ = try MockCollectionEnum.rawValue(basedOn: "e") - caughtError = nil - } catch let error as MappedValueRepresentableError { - caughtError = error - } catch { - XCTAssertNil(error) - caughtError = nil - } + internal func testString() { + try XCTAssertEqual(MockCollectionEnum.mappedValue(basedOn: 0), "a") + try XCTAssertEqual(MockCollectionEnum.mappedValue(basedOn: 1), "b") + try XCTAssertEqual(MockCollectionEnum.mappedValue(basedOn: 2), "c") + try XCTAssertEqual(MockCollectionEnum.mappedValue(basedOn: 3), "d") + } - XCTAssertEqual(caughtError, .valueNotFound) + internal func testRawValueFailure() { + let caughtError: MappedValueRepresentableError? + do { + _ = try MockCollectionEnum.rawValue(basedOn: "e") + caughtError = nil + } catch let error as MappedValueRepresentableError { + caughtError = error + } catch { + XCTAssertNil(error) + caughtError = nil } - internal func testStringFailure() { - let caughtError: MappedValueRepresentableError? - do { - _ = try MockCollectionEnum.mappedValue(basedOn: .max) - caughtError = nil - } catch let error as MappedValueRepresentableError { - caughtError = error - } catch { - XCTAssertNil(error) - caughtError = nil - } + XCTAssertEqual(caughtError, .valueNotFound) + } - XCTAssertEqual(caughtError, .valueNotFound) + internal func testStringFailure() { + let caughtError: MappedValueRepresentableError? + do { + _ = try MockCollectionEnum.mappedValue(basedOn: .max) + caughtError = nil + } catch let error as MappedValueRepresentableError { + caughtError = error + } catch { + XCTAssertNil(error) + caughtError = nil } - } -#endif + XCTAssertEqual(caughtError, .valueNotFound) + } +} diff --git a/Tests/OptionsTests/MappedValueDictionaryRepresentedTests.swift b/Tests/OptionsTests/MappedValueDictionaryRepresentedTests.swift index d3ed318..8aca268 100644 --- a/Tests/OptionsTests/MappedValueDictionaryRepresentedTests.swift +++ b/Tests/OptionsTests/MappedValueDictionaryRepresentedTests.swift @@ -27,54 +27,51 @@ // OTHER DEALINGS IN THE SOFTWARE. // -#if canImport(XCTest) - @testable import Options - import XCTest +@testable import Options +import XCTest - internal final class MappedValueDictionaryRepresentedTests: XCTestCase { - internal func testRawValue() { - try XCTAssertEqual(MockDictionaryEnum.rawValue(basedOn: "a"), 2) - try XCTAssertEqual(MockDictionaryEnum.rawValue(basedOn: "b"), 5) - try XCTAssertEqual(MockDictionaryEnum.rawValue(basedOn: "c"), 6) - try XCTAssertEqual(MockDictionaryEnum.rawValue(basedOn: "d"), 12) - } - - internal func testString() { - try XCTAssertEqual(MockDictionaryEnum.mappedValue(basedOn: 2), "a") - try XCTAssertEqual(MockDictionaryEnum.mappedValue(basedOn: 5), "b") - try XCTAssertEqual(MockDictionaryEnum.mappedValue(basedOn: 6), "c") - try XCTAssertEqual(MockDictionaryEnum.mappedValue(basedOn: 12), "d") - } +internal final class MappedValueDictionaryRepresentedTests: XCTestCase { + internal func testRawValue() { + try XCTAssertEqual(MockDictionaryEnum.rawValue(basedOn: "a"), 2) + try XCTAssertEqual(MockDictionaryEnum.rawValue(basedOn: "b"), 5) + try XCTAssertEqual(MockDictionaryEnum.rawValue(basedOn: "c"), 6) + try XCTAssertEqual(MockDictionaryEnum.rawValue(basedOn: "d"), 12) + } - internal func testRawValueFailure() { - let caughtError: MappedValueRepresentableError? - do { - _ = try MockDictionaryEnum.rawValue(basedOn: "e") - caughtError = nil - } catch let error as MappedValueRepresentableError { - caughtError = error - } catch { - XCTAssertNil(error) - caughtError = nil - } + internal func testString() { + try XCTAssertEqual(MockDictionaryEnum.mappedValue(basedOn: 2), "a") + try XCTAssertEqual(MockDictionaryEnum.mappedValue(basedOn: 5), "b") + try XCTAssertEqual(MockDictionaryEnum.mappedValue(basedOn: 6), "c") + try XCTAssertEqual(MockDictionaryEnum.mappedValue(basedOn: 12), "d") + } - XCTAssertEqual(caughtError, .valueNotFound) + internal func testRawValueFailure() { + let caughtError: MappedValueRepresentableError? + do { + _ = try MockDictionaryEnum.rawValue(basedOn: "e") + caughtError = nil + } catch let error as MappedValueRepresentableError { + caughtError = error + } catch { + XCTAssertNil(error) + caughtError = nil } - internal func testStringFailure() { - let caughtError: MappedValueRepresentableError? - do { - _ = try MockDictionaryEnum.mappedValue(basedOn: 0) - caughtError = nil - } catch let error as MappedValueRepresentableError { - caughtError = error - } catch { - XCTAssertNil(error) - caughtError = nil - } + XCTAssertEqual(caughtError, .valueNotFound) + } - XCTAssertEqual(caughtError, .valueNotFound) + internal func testStringFailure() { + let caughtError: MappedValueRepresentableError? + do { + _ = try MockDictionaryEnum.mappedValue(basedOn: 0) + caughtError = nil + } catch let error as MappedValueRepresentableError { + caughtError = error + } catch { + XCTAssertNil(error) + caughtError = nil } - } -#endif + XCTAssertEqual(caughtError, .valueNotFound) + } +} diff --git a/Tests/OptionsTests/MappedValueRepresentableTests.swift b/Tests/OptionsTests/MappedValueRepresentableTests.swift index 86e839a..e400539 100644 --- a/Tests/OptionsTests/MappedValueRepresentableTests.swift +++ b/Tests/OptionsTests/MappedValueRepresentableTests.swift @@ -27,17 +27,14 @@ // OTHER DEALINGS IN THE SOFTWARE. // -#if canImport(XCTest) - @testable import Options - import XCTest +@testable import Options +import XCTest - internal final class MappedValueRepresentableTests: XCTestCase { - internal func testStringValue() { - try XCTAssertEqual(MockCollectionEnum.a.mappedValue(), "a") - try XCTAssertEqual(MockCollectionEnum.b.mappedValue(), "b") - try XCTAssertEqual(MockCollectionEnum.c.mappedValue(), "c") - try XCTAssertEqual(MockCollectionEnum.d.mappedValue(), "d") - } +internal final class MappedValueRepresentableTests: XCTestCase { + internal func testStringValue() { + try XCTAssertEqual(MockCollectionEnum.a.mappedValue(), "a") + try XCTAssertEqual(MockCollectionEnum.b.mappedValue(), "b") + try XCTAssertEqual(MockCollectionEnum.c.mappedValue(), "c") + try XCTAssertEqual(MockCollectionEnum.d.mappedValue(), "d") } - -#endif +} diff --git a/Tests/OptionsTests/XCTestManifests.swift b/Tests/OptionsTests/XCTestManifests.swift deleted file mode 100644 index a0835cc..0000000 --- a/Tests/OptionsTests/XCTestManifests.swift +++ /dev/null @@ -1,98 +0,0 @@ -// -// XCTestManifests.swift -// SimulatorServices -// -// Created by Leo Dion. -// Copyright © 2024 BrightDigit. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#if !canImport(ObjectiveC) - import XCTest - - extension EnumSetTests { - // DO NOT MODIFY: This is autogenerated, use: - // `swift test --generate-linuxmain` - // to regenerate. - static let __allTests__EnumSetTests = [ - ("testArray", testArray), - ("testDecoder", testDecoder), - ("testEncoder", testEncoder), - ("testInitValue", testInitValue), - ("testInitValues", testInitValues) - ] - } - - extension MappedEnumTests { - // DO NOT MODIFY: This is autogenerated, use: - // `swift test --generate-linuxmain` - // to regenerate. - static let __allTests__MappedEnumTests = [ - ("testDecoder", testDecoder), - ("testEncoder", testEncoder) - ] - } - - extension MappedValueCollectionRepresentedTests { - // DO NOT MODIFY: This is autogenerated, use: - // `swift test --generate-linuxmain` - // to regenerate. - static let __allTests__MappedValueCollectionRepresentedTests = [ - ("testRawValue", testRawValue), - ("testRawValueFailure", testRawValueFailure), - ("testString", testString), - ("testStringFailure", testStringFailure) - ] - } - - extension MappedValueDictionaryRepresentedTests { - // DO NOT MODIFY: This is autogenerated, use: - // `swift test --generate-linuxmain` - // to regenerate. - static let __allTests__MappedValueDictionaryRepresentedTests = [ - ("testRawValue", testRawValue), - ("testRawValueFailure", testRawValueFailure), - ("testString", testString), - ("testStringFailure", testStringFailure) - ] - } - - extension MappedValueRepresentableTests { - // DO NOT MODIFY: This is autogenerated, use: - // `swift test --generate-linuxmain` - // to regenerate. - static let __allTests__MappedValueRepresentableTests = [ - ("testStringValue", testStringValue) - ] - } - - public func __allTests() -> [XCTestCaseEntry] { - [ - testCase(EnumSetTests.__allTests__EnumSetTests), - testCase(MappedEnumTests.__allTests__MappedEnumTests), - testCase(MappedValueCollectionRepresentedTests.__allTests__MappedValueCollectionRepresentedTests), - testCase(MappedValueDictionaryRepresentedTests.__allTests__MappedValueDictionaryRepresentedTests), - testCase(MappedValueRepresentableTests.__allTests__MappedValueRepresentableTests) - ] - } -#endif From e02c6f7dea0a88f96fe6a4a29194b4ce3d47cdae Mon Sep 17 00:00:00 2001 From: leogdion Date: Mon, 8 Apr 2024 10:18:07 -0400 Subject: [PATCH 16/23] Update Options.yml --- .github/workflows/Options.yml | 98 +++++++++++++++++------------------ 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/.github/workflows/Options.yml b/.github/workflows/Options.yml index 9eacb8b..1f13ac5 100644 --- a/.github/workflows/Options.yml +++ b/.github/workflows/Options.yml @@ -89,24 +89,24 @@ jobs: watchOSVersion: "9.1" watchName: "Apple Watch Ultra (49mm)" iPhoneName: "iPhone 14" - # - xcode: "/Applications/Xcode_15.0.1.app" - # os: macos-13 - # iOSVersion: "17.0.1" - # watchOSVersion: "10.0" - # watchName: "Apple Watch Series 9 (41mm)" - # iPhoneName: "iPhone 15" - # - xcode: "/Applications/Xcode_15.1.app" - # os: macos-13 - # iOSVersion: "17.2" - # watchOSVersion: "10.2" - # watchName: "Apple Watch Series 9 (45mm)" - # iPhoneName: "iPhone 15 Plus" - # - xcode: "/Applications/Xcode_15.2.app" - # os: macos-14 - # iOSVersion: "17.2" - # watchOSVersion: "10.2" - # watchName: "Apple Watch Ultra (49mm)" - # iPhoneName: "iPhone 15 Pro" + - xcode: "/Applications/Xcode_15.0.1.app" + os: macos-13 + iOSVersion: "17.0.1" + watchOSVersion: "10.0" + watchName: "Apple Watch Series 9 (41mm)" + iPhoneName: "iPhone 15" + - xcode: "/Applications/Xcode_15.1.app" + os: macos-13 + iOSVersion: "17.2" + watchOSVersion: "10.2" + watchName: "Apple Watch Series 9 (45mm)" + iPhoneName: "iPhone 15 Plus" + - xcode: "/Applications/Xcode_15.2.app" + os: macos-14 + iOSVersion: "17.2" + watchOSVersion: "10.2" + watchName: "Apple Watch Ultra (49mm)" + iPhoneName: "iPhone 15 Pro" - xcode: "/Applications/Xcode_15.3.app" os: macos-14 iOSVersion: "17.4" @@ -126,7 +126,7 @@ jobs: restore-keys: | ${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}- - name: Cache mint - if: startsWith(matrix.xcode,'/Applications/Xcode_15.2') + if: startsWith(matrix.xcode,'/Applications/Xcode_15.3') id: cache-mint uses: actions/cache@v4 env: @@ -143,7 +143,7 @@ jobs: - name: Setup Xcode run: sudo xcode-select -s ${{ matrix.xcode }}/Contents/Developer - name: Install mint - if: startsWith(matrix.xcode,'/Applications/Xcode_15.2') + if: startsWith(matrix.xcode,'/Applications/Xcode_15.3') run: | brew update brew install mint @@ -165,35 +165,35 @@ jobs: run: rm -rf .build - name: Lint run: ./scripts/lint.sh - if: startsWith(matrix.xcode,'/Applications/Xcode_15.2') - - name: Run iOS target tests - run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk "iphonesimulator" -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test - - uses: sersoft-gmbh/swift-coverage-action@v4 - id: coverage-files-iOS - with: - fail-on-empty-output: true - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: true - verbose: true - token: ${{ secrets.CODECOV_TOKEN }} - files: ${{ join(fromJSON(steps.coverage-files-iOS.outputs.files), ',') }} - flags: iOS,iOS${{ matrix.iOSVersion }},macOS,${{ env.XCODE_NAME }} - - name: Run watchOS target tests - run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk "watchsimulator" -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test - - uses: sersoft-gmbh/swift-coverage-action@v4 - id: coverage-files-watchOS - with: - fail-on-empty-output: true - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: true - verbose: true - token: ${{ secrets.CODECOV_TOKEN }} - files: ${{ join(fromJSON(steps.coverage-files-watchOS.outputs.files), ',') }} - flags: watchOS,watchOS${{ matrix.watchOSVersion }},macOS,${{ env.XCODE_NAME }} + if: startsWith(matrix.xcode,'/Applications/Xcode_15.3') + # - name: Run iOS target tests + # run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk "iphonesimulator" -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test + # - uses: sersoft-gmbh/swift-coverage-action@v4 + # id: coverage-files-iOS + # with: + # fail-on-empty-output: true + # - name: Upload coverage to Codecov + # uses: codecov/codecov-action@v4 + # with: + # fail_ci_if_error: true + # verbose: true + # token: ${{ secrets.CODECOV_TOKEN }} + # files: ${{ join(fromJSON(steps.coverage-files-iOS.outputs.files), ',') }} + # flags: iOS,iOS${{ matrix.iOSVersion }},macOS,${{ env.XCODE_NAME }} + # - name: Run watchOS target tests + # run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk "watchsimulator" -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test + # - uses: sersoft-gmbh/swift-coverage-action@v4 + # id: coverage-files-watchOS + # with: + # fail-on-empty-output: true + # - name: Upload coverage to Codecov + # uses: codecov/codecov-action@v4 + # with: + # fail_ci_if_error: true + # verbose: true + # token: ${{ secrets.CODECOV_TOKEN }} + # files: ${{ join(fromJSON(steps.coverage-files-watchOS.outputs.files), ',') }} + # flags: watchOS,watchOS${{ matrix.watchOSVersion }},macOS,${{ env.XCODE_NAME }} build-self: name: Build on Self-Hosting macOS runs-on: [self-hosted, macOS] From c52f58ff8e2e52a5e89061e0dac6f8081f36ce2d Mon Sep 17 00:00:00 2001 From: leogdion Date: Mon, 8 Apr 2024 10:22:04 -0400 Subject: [PATCH 17/23] Update Options.yml --- .github/workflows/Options.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/Options.yml b/.github/workflows/Options.yml index 1f13ac5..c33f4c9 100644 --- a/.github/workflows/Options.yml +++ b/.github/workflows/Options.yml @@ -89,18 +89,18 @@ jobs: watchOSVersion: "9.1" watchName: "Apple Watch Ultra (49mm)" iPhoneName: "iPhone 14" - - xcode: "/Applications/Xcode_15.0.1.app" - os: macos-13 - iOSVersion: "17.0.1" - watchOSVersion: "10.0" - watchName: "Apple Watch Series 9 (41mm)" - iPhoneName: "iPhone 15" - - xcode: "/Applications/Xcode_15.1.app" - os: macos-13 - iOSVersion: "17.2" - watchOSVersion: "10.2" - watchName: "Apple Watch Series 9 (45mm)" - iPhoneName: "iPhone 15 Plus" + # - xcode: "/Applications/Xcode_15.0.1.app" + # os: macos-13 + # iOSVersion: "17.0.1" + # watchOSVersion: "10.0" + # watchName: "Apple Watch Series 9 (41mm)" + # iPhoneName: "iPhone 15" + # - xcode: "/Applications/Xcode_15.1.app" + # os: macos-13 + # iOSVersion: "17.2" + # watchOSVersion: "10.2" + # watchName: "Apple Watch Series 9 (45mm)" + # iPhoneName: "iPhone 15 Plus" - xcode: "/Applications/Xcode_15.2.app" os: macos-14 iOSVersion: "17.2" From 34713474a71c8db83b5eac7fae861f8bf6480ef8 Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Mon, 8 Apr 2024 10:24:43 -0400 Subject: [PATCH 18/23] fixing macros --- Package@swift-5.10.swift | 65 --------------------------------------- Package@swift-5.9.1.swift | 2 +- 2 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 Package@swift-5.10.swift diff --git a/Package@swift-5.10.swift b/Package@swift-5.10.swift deleted file mode 100644 index da62733..0000000 --- a/Package@swift-5.10.swift +++ /dev/null @@ -1,65 +0,0 @@ -// swift-tools-version: 5.10 - -// swiftlint:disable explicit_top_level_acl -// swiftlint:disable prefixed_toplevel_constant -// swiftlint:disable explicit_acl - -import CompilerPluginSupport -import PackageDescription - -let swiftSettings = [ - SwiftSetting.enableUpcomingFeature("BareSlashRegexLiterals"), - SwiftSetting.enableUpcomingFeature("ConciseMagicFile"), - SwiftSetting.enableUpcomingFeature("ExistentialAny"), - SwiftSetting.enableUpcomingFeature("ForwardTrailingClosures"), - SwiftSetting.enableUpcomingFeature("ImplicitOpenExistentials"), - SwiftSetting.enableUpcomingFeature("StrictConcurrency"), - SwiftSetting.enableUpcomingFeature("DisableOutwardActorInference"), - SwiftSetting.enableExperimentalFeature("StrictConcurrency") -] - -let package = Package( - name: "Options", - platforms: [ - .macOS(.v10_15), - .iOS(.v13), - .tvOS(.v13), - .watchOS(.v6), - .macCatalyst(.v13), - .visionOS(.v1) - ], - products: [ - .library( - name: "Options", - targets: ["Options"] - ) - ], - dependencies: [ - .package(url: "https://github.com/apple/swift-syntax", from: "510.0.0") - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0") - ], - targets: [ - .target( - name: "Options", - dependencies: ["OptionsMacros"], - swiftSettings: swiftSettings - ), - .macro( - name: "OptionsMacros", - dependencies: [ - .product(name: "SwiftSyntaxMacros", package: "swift-syntax"), - .product(name: "SwiftCompilerPlugin", package: "swift-syntax") - ], - swiftSettings: swiftSettings - ), - .testTarget( - name: "OptionsTests", - dependencies: ["Options"] - ) - ] -) - -// swiftlint:enable explicit_top_level_acl -// swiftlint:enable prefixed_toplevel_constant -// swiftlint:enable explicit_acl diff --git a/Package@swift-5.9.1.swift b/Package@swift-5.9.1.swift index 56cc315..2ad3be5 100644 --- a/Package@swift-5.9.1.swift +++ b/Package@swift-5.9.1.swift @@ -35,7 +35,7 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/apple/swift-syntax", from: "509.0.0") + .package(url: "https://github.com/apple/swift-syntax", from: "510.0.0") // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0") ], From 36cfebd139b1b9137a7867161fb4f3feb52f3c38 Mon Sep 17 00:00:00 2001 From: leogdion Date: Mon, 8 Apr 2024 10:26:03 -0400 Subject: [PATCH 19/23] Update Package@swift-5.9.1.swift --- Package@swift-5.9.1.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package@swift-5.9.1.swift b/Package@swift-5.9.1.swift index 2ad3be5..19f9de8 100644 --- a/Package@swift-5.9.1.swift +++ b/Package@swift-5.9.1.swift @@ -21,7 +21,7 @@ let swiftSettings = [ let package = Package( name: "Options", platforms: [ - .macOS(.v10_15), + .macOS(.v12), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), From 71b3427adb72c23ac06ac0ce9379dacab8808e96 Mon Sep 17 00:00:00 2001 From: leogdion Date: Mon, 8 Apr 2024 10:28:11 -0400 Subject: [PATCH 20/23] Update Options.yml --- .github/workflows/Options.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Options.yml b/.github/workflows/Options.yml index c33f4c9..0f47ba6 100644 --- a/.github/workflows/Options.yml +++ b/.github/workflows/Options.yml @@ -101,12 +101,12 @@ jobs: # watchOSVersion: "10.2" # watchName: "Apple Watch Series 9 (45mm)" # iPhoneName: "iPhone 15 Plus" - - xcode: "/Applications/Xcode_15.2.app" - os: macos-14 - iOSVersion: "17.2" - watchOSVersion: "10.2" - watchName: "Apple Watch Ultra (49mm)" - iPhoneName: "iPhone 15 Pro" + # - xcode: "/Applications/Xcode_15.2.app" + # os: macos-14 + # iOSVersion: "17.2" + # watchOSVersion: "10.2" + # watchName: "Apple Watch Ultra (49mm)" + # iPhoneName: "iPhone 15 Pro" - xcode: "/Applications/Xcode_15.3.app" os: macos-14 iOSVersion: "17.4" From 411ffcebc26939cbca57a5aa9233556808d5bee2 Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Mon, 8 Apr 2024 14:38:17 -0400 Subject: [PATCH 21/23] fixing other builds --- .github/workflows/Options.yml | 36 +++++++++---------- Package.resolved | 14 -------- ...ft-5.9.1.swift => Package@swift-5.10.swift | 2 +- 3 files changed, 19 insertions(+), 33 deletions(-) delete mode 100644 Package.resolved rename Package@swift-5.9.1.swift => Package@swift-5.10.swift (98%) diff --git a/.github/workflows/Options.yml b/.github/workflows/Options.yml index 0f47ba6..1f13ac5 100644 --- a/.github/workflows/Options.yml +++ b/.github/workflows/Options.yml @@ -89,24 +89,24 @@ jobs: watchOSVersion: "9.1" watchName: "Apple Watch Ultra (49mm)" iPhoneName: "iPhone 14" - # - xcode: "/Applications/Xcode_15.0.1.app" - # os: macos-13 - # iOSVersion: "17.0.1" - # watchOSVersion: "10.0" - # watchName: "Apple Watch Series 9 (41mm)" - # iPhoneName: "iPhone 15" - # - xcode: "/Applications/Xcode_15.1.app" - # os: macos-13 - # iOSVersion: "17.2" - # watchOSVersion: "10.2" - # watchName: "Apple Watch Series 9 (45mm)" - # iPhoneName: "iPhone 15 Plus" - # - xcode: "/Applications/Xcode_15.2.app" - # os: macos-14 - # iOSVersion: "17.2" - # watchOSVersion: "10.2" - # watchName: "Apple Watch Ultra (49mm)" - # iPhoneName: "iPhone 15 Pro" + - xcode: "/Applications/Xcode_15.0.1.app" + os: macos-13 + iOSVersion: "17.0.1" + watchOSVersion: "10.0" + watchName: "Apple Watch Series 9 (41mm)" + iPhoneName: "iPhone 15" + - xcode: "/Applications/Xcode_15.1.app" + os: macos-13 + iOSVersion: "17.2" + watchOSVersion: "10.2" + watchName: "Apple Watch Series 9 (45mm)" + iPhoneName: "iPhone 15 Plus" + - xcode: "/Applications/Xcode_15.2.app" + os: macos-14 + iOSVersion: "17.2" + watchOSVersion: "10.2" + watchName: "Apple Watch Ultra (49mm)" + iPhoneName: "iPhone 15 Pro" - xcode: "/Applications/Xcode_15.3.app" os: macos-14 iOSVersion: "17.4" diff --git a/Package.resolved b/Package.resolved deleted file mode 100644 index 53bea04..0000000 --- a/Package.resolved +++ /dev/null @@ -1,14 +0,0 @@ -{ - "pins" : [ - { - "identity" : "swift-syntax", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-syntax", - "state" : { - "revision" : "fa8f95c2d536d6620cc2f504ebe8a6167c9fc2dd", - "version" : "510.0.1" - } - } - ], - "version" : 2 -} diff --git a/Package@swift-5.9.1.swift b/Package@swift-5.10.swift similarity index 98% rename from Package@swift-5.9.1.swift rename to Package@swift-5.10.swift index 19f9de8..2ad3be5 100644 --- a/Package@swift-5.9.1.swift +++ b/Package@swift-5.10.swift @@ -21,7 +21,7 @@ let swiftSettings = [ let package = Package( name: "Options", platforms: [ - .macOS(.v12), + .macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), From 7d2590597fa68a5089755228e85c032470bd99d2 Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Mon, 8 Apr 2024 14:53:01 -0400 Subject: [PATCH 22/23] fixing versions --- Sources/Options/Macro.swift | 2 +- Sources/Options/MappedValueRepresentableError.swift | 4 ++-- Tests/OptionsTests/Mocks/MockCollectionEnum.swift | 2 +- Tests/OptionsTests/Mocks/MockDictionaryEnum.swift | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/Options/Macro.swift b/Sources/Options/Macro.swift index 83e18d9..e120423 100644 --- a/Sources/Options/Macro.swift +++ b/Sources/Options/Macro.swift @@ -29,7 +29,7 @@ import Foundation -#if swift(>=5.9.1) +#if swift(>=5.10) @attached( extension, conformances: MappedValueRepresentable, MappedValueGenericRepresented, diff --git a/Sources/Options/MappedValueRepresentableError.swift b/Sources/Options/MappedValueRepresentableError.swift index 4745d26..3d1389f 100644 --- a/Sources/Options/MappedValueRepresentableError.swift +++ b/Sources/Options/MappedValueRepresentableError.swift @@ -30,10 +30,10 @@ import Foundation // swiftlint:disable file_types_order -#if swift(>=5.9.1) +#if swift(>=5.10) /// An Error thrown when the `MappedType` value or `RawType` value /// are invalid for an `Enum`. - public enum MappedValueRepresentableError: Error { + public enum MappedValueRepresentableError: Error, Sendable { case valueNotFound } #else diff --git a/Tests/OptionsTests/Mocks/MockCollectionEnum.swift b/Tests/OptionsTests/Mocks/MockCollectionEnum.swift index 6598d48..c588f4f 100644 --- a/Tests/OptionsTests/Mocks/MockCollectionEnum.swift +++ b/Tests/OptionsTests/Mocks/MockCollectionEnum.swift @@ -29,7 +29,7 @@ import Options -#if swift(>=5.9.1) +#if swift(>=5.10) // swiftlint:disable identifier_name @Options internal enum MockCollectionEnum: Int, Sendable { diff --git a/Tests/OptionsTests/Mocks/MockDictionaryEnum.swift b/Tests/OptionsTests/Mocks/MockDictionaryEnum.swift index 4f0553e..77be088 100644 --- a/Tests/OptionsTests/Mocks/MockDictionaryEnum.swift +++ b/Tests/OptionsTests/Mocks/MockDictionaryEnum.swift @@ -29,7 +29,7 @@ import Options -#if swift(>=5.9.1) +#if swift(>=5.10) // swiftlint:disable identifier_name @Options internal enum MockDictionaryEnum: Int, Sendable { From d4b56a0ec5345b9f3fba8575fb070c59ecf58809 Mon Sep 17 00:00:00 2001 From: leogdion Date: Mon, 8 Apr 2024 14:57:38 -0400 Subject: [PATCH 23/23] Update Package@swift-5.10.swift --- Package@swift-5.10.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package@swift-5.10.swift b/Package@swift-5.10.swift index 2ad3be5..da62733 100644 --- a/Package@swift-5.10.swift +++ b/Package@swift-5.10.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9.1 +// swift-tools-version: 5.10 // swiftlint:disable explicit_top_level_acl // swiftlint:disable prefixed_toplevel_constant