From 252cf4a077bf57501fb8decd5813b3ca60094099 Mon Sep 17 00:00:00 2001 From: Florian Friedrich Date: Mon, 11 Mar 2024 18:29:29 +0100 Subject: [PATCH] Add Swift 5.10 support --- .github/workflows/docs.yml | 2 +- .github/workflows/swift-test.yml | 7 +++-- Package.swift | 7 +++-- Package@swift-5.9.swift | 38 +++++++++++++++++++++++ Sources/AuthScope/Scope+ScopeString.swift | 2 +- 5 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 Package@swift-5.9.swift diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0b5e5e7..606b746 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,7 +20,7 @@ jobs: uses: sersoft-gmbh/oss-common-actions/.github/workflows/swift-generate-and-publish-docs.yml@main with: os: ubuntu - swift-version: '5.9' + swift-version: '5.10' organisation: ${{ github.repository_owner }} repository: ${{ github.event.repository.name }} pages-branch: gh-pages diff --git a/.github/workflows/swift-test.yml b/.github/workflows/swift-test.yml index 90754c2..8c12b26 100644 --- a/.github/workflows/swift-test.yml +++ b/.github/workflows/swift-test.yml @@ -12,7 +12,7 @@ permissions: jobs: variables: outputs: - max-supported-swift-version: '5.9' + max-supported-swift-version: '5.10' xcode-scheme: auth-scope xcode-platform-version: latest fail-if-codecov-fails: true @@ -25,7 +25,7 @@ jobs: strategy: matrix: os: [ macOS, ubuntu ] - swift-version-offset: [ 0 ] + swift-version-offset: [ 0, 1 ] uses: sersoft-gmbh/oss-common-actions/.github/workflows/swift-test-spm.yml@main with: os: ${{ matrix.os }} @@ -45,7 +45,8 @@ jobs: - iPadOS - tvOS - watchOS - swift-version-offset: [ 0 ] + - visionOS + swift-version-offset: [ 0, 1 ] uses: sersoft-gmbh/oss-common-actions/.github/workflows/swift-test-xcode.yml@main with: xcode-scheme: ${{ needs.variables.outputs.xcode-scheme }} diff --git a/Package.swift b/Package.swift index 7305af4..822b25d 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:5.10 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -8,9 +8,12 @@ let swiftSettings: Array = [ .enableUpcomingFeature("ExistentialAny"), .enableUpcomingFeature("BareSlashRegexLiterals"), .enableUpcomingFeature("DisableOutwardActorInference"), + .enableUpcomingFeature("IsolatedDefaultValues"), + .enableUpcomingFeature("DeprecateApplicationMain"), + .enableExperimentalFeature("StrictConcurrency"), + .enableExperimentalFeature("GlobalConcurrency"), // .enableExperimentalFeature("AccessLevelOnImport"), // .enableExperimentalFeature("VariadicGenerics"), -// .unsafeFlags(["-warn-concurrency"], .when(configuration: .debug)), ] let package = Package( diff --git a/Package@swift-5.9.swift b/Package@swift-5.9.swift new file mode 100644 index 0000000..eb59944 --- /dev/null +++ b/Package@swift-5.9.swift @@ -0,0 +1,38 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let swiftSettings: Array = [ + .enableUpcomingFeature("ConciseMagicFile"), + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("BareSlashRegexLiterals"), + .enableUpcomingFeature("DisableOutwardActorInference"), + .enableExperimentalFeature("StrictConcurrency"), +// .enableExperimentalFeature("AccessLevelOnImport"), +// .enableExperimentalFeature("VariadicGenerics"), +] + +let package = Package( + name: "auth-scope", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "AuthScope", + targets: ["AuthScope"]), + ], + dependencies: [ + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "AuthScope", + swiftSettings: swiftSettings), + .testTarget( + name: "AuthScopeTests", + dependencies: ["AuthScope"], + swiftSettings: swiftSettings), + ] +) diff --git a/Sources/AuthScope/Scope+ScopeString.swift b/Sources/AuthScope/Scope+ScopeString.swift index 638cd9d..e07ce92 100644 --- a/Sources/AuthScope/Scope+ScopeString.swift +++ b/Sources/AuthScope/Scope+ScopeString.swift @@ -10,7 +10,7 @@ extension Scope { /// Creates a new scope from a given scope string. Throws an error if the string contains invalid access ranges. /// - /// - Parameter scopeString: The scope string (e.g. created by `scopeString` of an existing scope) to parse. + /// - Parameter scopeString: The scope string (e.g. created by ``Scope/scopeString`` of an existing scope) to parse. /// - Throws: An error if at least one of the access ranges in the scope string is invalid. /// - SeeAlso: ``AccessRangeProtocol/init(validating:)`` public init(scopeString: some StringProtocol) throws {