Skip to content

Commit 02b3441

Browse files
authored
Merge pull request #26 from StarryInternet/sendable
Make all types Sendable
2 parents 33440e4 + 383c9c8 commit 02b3441

31 files changed

Lines changed: 303 additions & 256 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
set -o pipefail && xcodebuild \
4242
-scheme CombineCoreBluetooth \
4343
-workspace ./CombineCoreBluetooth.xcworkspace/ \
44-
-destination "platform=iOS Simulator,OS=16.2,name=iPhone 14" \
44+
-destination "platform=iOS Simulator,OS=latest,name=iPhone 14" \
4545
-sdk iphonesimulator \
4646
-enableCodeCoverage YES \
4747
-disableAutomaticPackageResolution \

CombineCoreBluetooth.xcodeproj/project.pbxproj

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
00371A0227EE588C00C2F766 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 00371A0127EE588C00C2F766 /* Preview Assets.xcassets */; };
1616
00371A2327F02B1900C2F766 /* CentralView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00371A2227F02B1900C2F766 /* CentralView.swift */; };
1717
00482BE828308A4D0053B7C1 /* PeripheralTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00482BE728308A4D0053B7C1 /* PeripheralTests.swift */; };
18+
006CA40A2ACB7D2300DDA85D /* ConcurrencyExtras in Frameworks */ = {isa = PBXBuildFile; productRef = 006CA4092ACB7D2300DDA85D /* ConcurrencyExtras */; };
1819
00CF0B78288DD73700FD88E1 /* PeripheralError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00CF0B77288DD73700FD88E1 /* PeripheralError.swift */; };
1920
00D8C7432A69A6E20069EC00 /* PeripheralManagerError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00D8C7422A69A6E20069EC00 /* PeripheralManagerError.swift */; };
2021
EB443FB927C6BDE10005CCEA /* Exports.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB443F9C27C6BDE00005CCEA /* Exports.swift */; };
@@ -66,7 +67,6 @@
6667
00CF0B77288DD73700FD88E1 /* PeripheralError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PeripheralError.swift; sourceTree = "<group>"; };
6768
00D8C7422A69A6E20069EC00 /* PeripheralManagerError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PeripheralManagerError.swift; sourceTree = "<group>"; };
6869
EB443F8E27C6BCA70005CCEA /* CombineCoreBluetooth.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CombineCoreBluetooth.framework; sourceTree = BUILT_PRODUCTS_DIR; };
69-
EB443F9927C6BDE00005CCEA /* CombineCoreBluetooth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CombineCoreBluetooth.h; sourceTree = "<group>"; };
7070
EB443F9C27C6BDE00005CCEA /* Exports.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Exports.swift; sourceTree = "<group>"; };
7171
EB443F9E27C6BDE00005CCEA /* Publisher+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Publisher+Extensions.swift"; sourceTree = "<group>"; };
7272
EB443F9F27C6BDE00005CCEA /* Unimplemented.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Unimplemented.swift; sourceTree = "<group>"; };
@@ -116,6 +116,7 @@
116116
buildActionMask = 2147483647;
117117
files = (
118118
EB443FDD27C6C1940005CCEA /* CombineCoreBluetooth.framework in Frameworks */,
119+
006CA40A2ACB7D2300DDA85D /* ConcurrencyExtras in Frameworks */,
119120
);
120121
runOnlyForDeploymentPostprocessing = 0;
121122
};
@@ -169,7 +170,6 @@
169170
EB443F9827C6BDE00005CCEA /* Sources */ = {
170171
isa = PBXGroup;
171172
children = (
172-
EB443F9927C6BDE00005CCEA /* CombineCoreBluetooth.h */,
173173
EB443F9A27C6BDE00005CCEA /* CombineCoreBluetooth */,
174174
);
175175
path = Sources;
@@ -346,6 +346,9 @@
346346
EB443FDF27C6C1940005CCEA /* PBXTargetDependency */,
347347
);
348348
name = "CombineCoreBluetooth Tests";
349+
packageProductDependencies = (
350+
006CA4092ACB7D2300DDA85D /* ConcurrencyExtras */,
351+
);
349352
productName = "CombineCoreBluetooth-iOSTests";
350353
productReference = EB443FD927C6C1940005CCEA /* CombineCoreBluetooth Tests.xctest */;
351354
productType = "com.apple.product-type.bundle.unit-test";
@@ -380,6 +383,9 @@
380383
Base,
381384
);
382385
mainGroup = EB443F8427C6BCA70005CCEA;
386+
packageReferences = (
387+
006CA4082ACB7D2300DDA85D /* XCRemoteSwiftPackageReference "swift-concurrency-extras" */,
388+
);
383389
productRefGroup = EB443F8F27C6BCA70005CCEA /* Products */;
384390
projectDirPath = "";
385391
projectRoot = "";
@@ -617,6 +623,7 @@
617623
SUPPORTS_MACCATALYST = YES;
618624
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
619625
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
626+
SWIFT_STRICT_CONCURRENCY = complete;
620627
TVOS_DEPLOYMENT_TARGET = 13.0;
621628
VERSIONING_SYSTEM = "apple-generic";
622629
VERSION_INFO_PREFIX = "";
@@ -682,6 +689,7 @@
682689
SUPPORTS_MACCATALYST = YES;
683690
SWIFT_COMPILATION_MODE = wholemodule;
684691
SWIFT_OPTIMIZATION_LEVEL = "-O";
692+
SWIFT_STRICT_CONCURRENCY = complete;
685693
TVOS_DEPLOYMENT_TARGET = 13.0;
686694
VALIDATE_PRODUCT = YES;
687695
VERSIONING_SYSTEM = "apple-generic";
@@ -827,11 +835,28 @@
827835
};
828836
/* End XCConfigurationList section */
829837

838+
/* Begin XCRemoteSwiftPackageReference section */
839+
006CA4082ACB7D2300DDA85D /* XCRemoteSwiftPackageReference "swift-concurrency-extras" */ = {
840+
isa = XCRemoteSwiftPackageReference;
841+
repositoryURL = "https://github.com/pointfreeco/swift-concurrency-extras.git";
842+
requirement = {
843+
kind = versionRange;
844+
maximumVersion = 2.0.0;
845+
minimumVersion = 0.1.0;
846+
};
847+
};
848+
/* End XCRemoteSwiftPackageReference section */
849+
830850
/* Begin XCSwiftPackageProductDependency section */
831851
0014FFB127F0359600D2A122 /* CombineCoreBluetooth */ = {
832852
isa = XCSwiftPackageProductDependency;
833853
productName = CombineCoreBluetooth;
834854
};
855+
006CA4092ACB7D2300DDA85D /* ConcurrencyExtras */ = {
856+
isa = XCSwiftPackageProductDependency;
857+
package = 006CA4082ACB7D2300DDA85D /* XCRemoteSwiftPackageReference "swift-concurrency-extras" */;
858+
productName = ConcurrencyExtras;
859+
};
835860
/* End XCSwiftPackageProductDependency section */
836861
};
837862
rootObject = EB443F8527C6BCA70005CCEA /* Project object */;

CombineCoreBluetooth.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 20 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.resolved

Lines changed: 20 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
// swift-tools-version:5.3
1+
// swift-tools-version:5.6
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

6-
#if swift(>=5.6)
7-
let dependencies: [Package.Dependency] = [
8-
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
9-
]
10-
#else
11-
let dependencies: [Package.Dependency] = []
12-
#endif
13-
146
let package = Package(
157
name: "CombineCoreBluetooth",
168
platforms: [
@@ -25,15 +17,24 @@ let package = Package(
2517
targets: ["CombineCoreBluetooth"]
2618
),
2719
],
28-
dependencies: dependencies,
20+
dependencies: [
21+
.package(url: "https://github.com/pointfreeco/swift-concurrency-extras", "0.1.0"..<"2.0.0"),
22+
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
23+
],
2924
targets: [
3025
.target(
3126
name: "CombineCoreBluetooth",
32-
dependencies: []
27+
dependencies: [
28+
],
29+
swiftSettings: [
30+
]
3331
),
3432
.testTarget(
3533
name: "CombineCoreBluetoothTests",
36-
dependencies: ["CombineCoreBluetooth"]
34+
dependencies: [
35+
"CombineCoreBluetooth",
36+
.product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"),
37+
]
3738
),
3839
]
3940
)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ CombineCoreBluetooth is a library that bridges Apple's `CoreBluetooth` framework
1010
## Requirements:
1111

1212
- iOS 13, tvOS 13, macOS 10.15, or watchOS 6
13-
- Xcode 12 or higher
14-
- Swift 5.3 or higher
13+
- Xcode 13.3 or higher
14+
- Swift 5.6 or higher
1515

1616
## Installation
1717

Sources/CombineCoreBluetooth.h

Lines changed: 0 additions & 9 deletions
This file was deleted.

Sources/CombineCoreBluetooth/Central/Interface+Central.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import Foundation
2+
@preconcurrency import CoreBluetooth
23

3-
public struct Central {
4+
public struct Central: Sendable {
45
let rawValue: CBCentral?
56

67
public let identifier: UUID
78

8-
let _maximumUpdateValueLength: () -> Int
9+
let _maximumUpdateValueLength: @Sendable () -> Int
910

1011
public var maximumUpdateValueLength: Int {
1112
_maximumUpdateValueLength()

Sources/CombineCoreBluetooth/Central/Live+Central.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Foundation
2+
@preconcurrency import CoreBluetooth
23

34
extension Central {
45
init(cbcentral: CBCentral) {

Sources/CombineCoreBluetooth/Central/Mock+Central.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Foundation
33
extension Central {
44
public static func unimplemented(
55
identifier: UUID,
6-
maximumUpdateValueLength: @escaping () -> Int = _Internal._unimplemented("maximumUpdateValueLength")
6+
maximumUpdateValueLength: @escaping @Sendable () -> Int = _Internal._unimplemented("maximumUpdateValueLength")
77
) -> Self {
88
return .init(
99
rawValue: nil,

0 commit comments

Comments
 (0)