From 1954bdfdf290a2aba7667291d0f4b28a57e0f550 Mon Sep 17 00:00:00 2001 From: Christian Tietze Date: Sat, 18 Nov 2023 14:59:31 +0100 Subject: [PATCH] Fix build for non-macOS platforms (#29) * fix Task not available before iOS 13 * fix Task not available before watchOS 6 * bump watchOS target to match SwiftTreeSitter --- Package.swift | 2 +- Sources/Neon/RangeStateValidator.swift | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Package.swift b/Package.swift index b53e835..950a547 100644 --- a/Package.swift +++ b/Package.swift @@ -4,7 +4,7 @@ import PackageDescription let package = Package( name: "Neon", - platforms: [.macOS(.v10_13), .iOS(.v11), .tvOS(.v11), .watchOS(.v4)], + platforms: [.macOS(.v10_13), .iOS(.v11), .tvOS(.v11), .watchOS(.v5)], products: [ .library(name: "Neon", targets: ["Neon"]), ], diff --git a/Sources/Neon/RangeStateValidator.swift b/Sources/Neon/RangeStateValidator.swift index ae9b997..d082562 100644 --- a/Sources/Neon/RangeStateValidator.swift +++ b/Sources/Neon/RangeStateValidator.swift @@ -1,7 +1,7 @@ import Foundation import Rearrange -@available(macOS 10.15, *) +@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) public final class RangeStateValidator { public enum ValidationResult: Sendable, Hashable { case success(NSRange) @@ -94,7 +94,7 @@ public final class RangeStateValidator { } } -@available(macOS 10.15, *) +@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) extension RangeStateValidator { private var length: Int { configuration.lengthProvider() @@ -123,7 +123,7 @@ extension RangeStateValidator { } } -@available(macOS 10.15, *) +@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) extension RangeStateValidator { /// Computes the next contiguous invalid range private func nextNeededRange() -> NSRange? {