Skip to content

Commit b15660d

Browse files
authored
Extend support to Swift 5.1 and tvOS (#14)
* Set base swift as 5.1 and enable tvOS and watchOS * Fix swift 5.1/5.2 error
1 parent 4472311 commit b15660d

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
strategy:
3434
matrix:
3535
tag:
36+
- swift:5.1
37+
- swift:5.2
3638
- swift:5.3
3739
# container:
3840
# image: ${{ matrix.tag }}

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// swift-tools-version:5.3
1+
// swift-tools-version:5.1
22

33
import PackageDescription
44

55
let package = Package(
66
name: "mqtt-nio",
7-
platforms: [.macOS(.v10_14), .iOS(.v12), .tvOS(.v12)],
7+
platforms: [.macOS(.v10_14), .iOS(.v12), .tvOS(.v12), .watchOS(.v6)],
88
products: [
99
.library(name: "MQTTNIO", targets: ["MQTTNIO"]),
1010
],
@@ -25,6 +25,6 @@ let package = Package(
2525
.product(name: "NIOTransportServices", package: "swift-nio-transport-services"),
2626
]),
2727
.target(name: "CCoreMQTT", dependencies: []),
28-
.testTarget(name: "MQTTNIOTests", dependencies: ["MQTTNIO"], resources: [.process("mosquitto.org.crt")]),
28+
.testTarget(name: "MQTTNIOTests", dependencies: ["MQTTNIO"]),
2929
]
3030
)

Sources/CCoreMQTT/include/core_mqtt_config_defaults.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2121
*/
2222

23+
#include <stdint.h>
24+
2325
/**
2426
* @file core_mqtt_config_defaults.h
2527
* @brief This represents the default values for the configuration macros

Sources/MQTTNIO/TSTLSConfiguration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ extension TSTLSConfiguration {
122122
if let trustRootCertificates = trustRoots {
123123
SecTrustSetAnchorCertificates(trust, trustRootCertificates as CFArray)
124124
}
125-
if #available(macOS 10.15, iOS 13.0, *) {
125+
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) {
126126
SecTrustEvaluateAsyncWithError(trust, Self.tlsDispatchQueue) { (trust, result, error) in
127127
if let error = error {
128128
print("Trust failed: \(error.localizedDescription)")

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ version: "3.3"
77

88
services:
99
test:
10-
image: swift:5.3
10+
image: swift:5.1
1111
working_dir: /mqtt-nio
1212
volumes:
1313
- .:/mqtt-nio

0 commit comments

Comments
 (0)