Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Feature/strict concurrency split (Flagsmith#51)
Browse files Browse the repository at this point in the history
* "StrictConcurrency=complete" and preparation for upcoming Swift 6 (Flagsmith#48)

* - Bumped `swift-tools` to swift 5.9.
 - Enabled `StrictConcurrency=complete` mode in order to be prepared for upcoming Swift 6. Implemented `Sendable` support for Flagsmith client and friends.
 - Enabled `ExistentialAny` feature in order to be prepared for upcoming Swift 6. Code adjustments
 - adjusted tests for `StrictConcurrency=complete` mode .

* adjusted macOS runner

* cleanup

* Merge branch 'feature/strinct-concurrency-gareth-updattes' into 3a4oT/strict-concurency

* Revert version back to 3.5.0

* Add qos: parameter to our DispatchQueues to avoid console errors starting the SDK

* Also add qos to the test app

* Update to the latest macOS and the latest macOS (12) currently for the runners to check everything is fine

* Let's build on 13 and 14 as 12 is too old

* Reformat the files I couldn't merge and fix up some force-unwraps in the tests

* One last lint error

---------

Co-authored-by: Petro Rovenskyy <[email protected]>
  • Loading branch information
gazreese and 3a4oT authored May 2, 2024
1 parent 16bbfb0 commit a15afa0
Show file tree
Hide file tree
Showing 20 changed files with 270 additions and 159 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,37 @@ on:
branches: [main]

jobs:
macos-build:
runs-on: macos-latest
macos-build-14:
# macOS-latest images are not the most recent
# The macos-latest workflow label currently uses the macOS 12 runner image, which doesn't include the build-tools we need
# The vast majority of macOS developers would be using the latest version of macOS
# Current list here: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners
runs-on: macOS-14

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Build (macOS)
run: swift build -v
- name: Run tests
run: swift test -v

ubuntu-build:
macos-build-13:
# Let's also check that the code builds on macOS 13
# At 23rd April 2023 the 'latest' macOS version is macOS 12
runs-on: macOS-13

steps:
- uses: actions/checkout@v4
- name: Build (macOS)
run: swift build -v
- name: Run tests
run: swift test -v

ubuntu-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Build (Ubuntu)
run: swift build -v
- name: Run tests
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
2 changes: 1 addition & 1 deletion Example/FlagsmithClient/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func isSuccess<T, F>(_ result: Result<T, F>) -> Bool {
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
let concurrentQueue = DispatchQueue(label: "concurrentQueue", attributes: .concurrent)
let concurrentQueue = DispatchQueue(label: "concurrentQueue", qos: .default, attributes: .concurrent)

func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Expand Down
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- FlagsmithClient (3.4.0)
- FlagsmithClient (3.6.0)

DEPENDENCIES:
- FlagsmithClient (from `../`)
Expand All @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
FlagsmithClient: 0f8ed4a38dec385d73cc21a64b791b39bcc8c32b
FlagsmithClient: 3a96576f5a251c807e6aa0a3b0db55b3e1dfd0a3

PODFILE CHECKSUM: 9fc876dee0cf031cae843156b0740a94b4994d8c

COCOAPODS: 1.13.0
COCOAPODS: 1.15.2
8 changes: 4 additions & 4 deletions Example/Pods/Local Podspecs/FlagsmithClient.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

134 changes: 67 additions & 67 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion FlagsmithClient.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '12.0'

s.source_files = 'FlagsmithClient/Classes/**/*'
s.swift_versions = '4.0'
s.swift_versions = '5.6'
end
2 changes: 1 addition & 1 deletion FlagsmithClient/Classes/Feature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public struct Feature: Codable, Sendable {
public let type: String?
public let description: String?

public func encode(to encoder: Encoder) throws {
public func encode(to encoder: any Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(name, forKey: .name)
try container.encodeIfPresent(type, forKey: .type)
Expand Down
2 changes: 1 addition & 1 deletion FlagsmithClient/Classes/Flag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public struct Flag: Codable, Sendable {
self.enabled = enabled
}

public func encode(to encoder: Encoder) throws {
public func encode(to encoder: any Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(feature, forKey: .feature)
try container.encode(value, forKey: .value)
Expand Down
Loading

0 comments on commit a15afa0

Please sign in to comment.