diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9518f2..724f896 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,19 +27,16 @@ jobs: - tvOS - watchOS swift: - - 5.5 - - 5.6 - 5.7 - 5.8 + - 5.9 include: - - swift: 5.5 - os: macos-12 - - swift: 5.6 - os: macos-12 - swift: 5.7 os: macos-13 - swift: 5.8 os: macos-13 + - swift: 5.9 + os: macos-13 - action: test - platform: tvOS action: build diff --git a/Package.resolved b/Package.resolved index cfd9c3b..dc48aa8 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,52 +1,50 @@ { - "object": { - "pins": [ - { - "package": "swift-argument-parser", - "repositoryURL": "https://github.com/apple/swift-argument-parser", - "state": { - "branch": null, - "revision": "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a", - "version": "1.2.2" - } - }, - { - "package": "Benchmark", - "repositoryURL": "https://github.com/google/swift-benchmark", - "state": { - "branch": null, - "revision": "8163295f6fe82356b0bcf8e1ab991645de17d096", - "version": "0.1.2" - } - }, - { - "package": "swift-builders", - "repositoryURL": "https://github.com/davdroman/swift-builders", - "state": { - "branch": null, - "revision": "a8fd97e32b7bb65f3fc1bd7d72725155fb2b4d77", - "version": "0.4.0" - } - }, - { - "package": "swift-custom-dump", - "repositoryURL": "https://github.com/pointfreeco/swift-custom-dump", - "state": { - "branch": null, - "revision": "de8ba65649e7ee317b9daf27dd5eebf34bd4be57", - "version": "0.9.1" - } - }, - { - "package": "xctest-dynamic-overlay", - "repositoryURL": "https://github.com/pointfreeco/xctest-dynamic-overlay", - "state": { - "branch": null, - "revision": "ab8c9f45843694dd16be4297e6d44c0634fd9913", - "version": "0.8.4" - } + "pins" : [ + { + "identity" : "swift-argument-parser", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-argument-parser", + "state" : { + "revision" : "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a", + "version" : "1.2.2" } - ] - }, - "version": 1 + }, + { + "identity" : "swift-benchmark", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/swift-benchmark", + "state" : { + "revision" : "8163295f6fe82356b0bcf8e1ab991645de17d096", + "version" : "0.1.2" + } + }, + { + "identity" : "swift-builders", + "kind" : "remoteSourceControl", + "location" : "https://github.com/davdroman/swift-builders", + "state" : { + "revision" : "a283b1ab4f028f13ca2843df340087d3dada5f26", + "version" : "0.5.0" + } + }, + { + "identity" : "swift-custom-dump", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-custom-dump", + "state" : { + "revision" : "edd66cace818e1b1c6f1b3349bb1d8e00d6f8b01", + "version" : "1.0.0" + } + }, + { + "identity" : "xctest-dynamic-overlay", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", + "state" : { + "revision" : "23cbf2294e350076ea4dbd7d5d047c1e76b03631", + "version" : "1.0.2" + } + } + ], + "version" : 2 } diff --git a/Package.swift b/Package.swift index b7f8bb1..632e017 100644 --- a/Package.swift +++ b/Package.swift @@ -1,5 +1,4 @@ -// swift-tools-version:5.5 -// The swift-tools-version declares the minimum version of Swift required to build this package. +// swift-tools-version:5.7 import PackageDescription @@ -7,8 +6,8 @@ let package = Package( name: "TextBuilder", platforms: [ .iOS(.v13), - .macOS(.v10_15), .tvOS(.v13), + .macOS(.v10_15), .watchOS(.v6), ], products: [ @@ -34,6 +33,6 @@ let package = Package( package.dependencies = [ .package(url: "https://github.com/google/swift-benchmark", from: "0.1.2"), - .package(url: "https://github.com/davdroman/swift-builders", from: "0.2.0"), - .package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "0.5.0"), + .package(url: "https://github.com/davdroman/swift-builders", from: "0.5.0"), + .package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.0.0"), ] diff --git a/Sources/TextBuilder/TextBuilder.swift b/Sources/TextBuilder/TextBuilder.swift index d1b29c1..1405f00 100644 --- a/Sources/TextBuilder/TextBuilder.swift +++ b/Sources/TextBuilder/TextBuilder.swift @@ -19,7 +19,6 @@ import SwiftUI /// Text("amet, consectetur") /// } /// -#if compiler(>=5.7) @resultBuilder public struct TextBuilderWith { @inlinable @@ -80,51 +79,3 @@ public struct TextBuilderWith { component ?? .empty } } -#else -@resultBuilder -public struct TextBuilderWith { - @inlinable - public static func buildArray(_ texts: [[Text]]) -> [Text] { - texts.flatMap { $0 } - } - - @inlinable - public static func buildBlock(_ texts: [Text]...) -> [Text] { - texts.flatMap { $0 } - } - - @inlinable - public static func buildEither(first texts: [Text]) -> [Text] { - texts - } - - @inlinable - public static func buildEither(second texts: [Text]) -> [Text] { - texts - } - - @inlinable - public static func buildExpression(_ string: S) -> [Text] { - [Text(string)] - } - - @inlinable - public static func buildExpression(_ text: Text) -> [Text] { - [text] - } - - @inlinable - public static func buildLimitedAvailability(_ texts: [Text]) -> [Text] { - texts - } - - @inlinable - public static func buildOptional(_ texts: [Text]?) -> [Text] { - texts ?? [] - } - - public static func buildFinalResult(_ texts: [Text]) -> Text { - texts.joined(separator: Separator.separator.map(Text.init)) ?? .empty - } -} -#endif diff --git a/TextBuilder.xcworkspace/xcshareddata/swiftpm/Package.resolved b/TextBuilder.xcworkspace/xcshareddata/swiftpm/Package.resolved index cfd9c3b..dc48aa8 100644 --- a/TextBuilder.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/TextBuilder.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,52 +1,50 @@ { - "object": { - "pins": [ - { - "package": "swift-argument-parser", - "repositoryURL": "https://github.com/apple/swift-argument-parser", - "state": { - "branch": null, - "revision": "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a", - "version": "1.2.2" - } - }, - { - "package": "Benchmark", - "repositoryURL": "https://github.com/google/swift-benchmark", - "state": { - "branch": null, - "revision": "8163295f6fe82356b0bcf8e1ab991645de17d096", - "version": "0.1.2" - } - }, - { - "package": "swift-builders", - "repositoryURL": "https://github.com/davdroman/swift-builders", - "state": { - "branch": null, - "revision": "a8fd97e32b7bb65f3fc1bd7d72725155fb2b4d77", - "version": "0.4.0" - } - }, - { - "package": "swift-custom-dump", - "repositoryURL": "https://github.com/pointfreeco/swift-custom-dump", - "state": { - "branch": null, - "revision": "de8ba65649e7ee317b9daf27dd5eebf34bd4be57", - "version": "0.9.1" - } - }, - { - "package": "xctest-dynamic-overlay", - "repositoryURL": "https://github.com/pointfreeco/xctest-dynamic-overlay", - "state": { - "branch": null, - "revision": "ab8c9f45843694dd16be4297e6d44c0634fd9913", - "version": "0.8.4" - } + "pins" : [ + { + "identity" : "swift-argument-parser", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-argument-parser", + "state" : { + "revision" : "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a", + "version" : "1.2.2" } - ] - }, - "version": 1 + }, + { + "identity" : "swift-benchmark", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/swift-benchmark", + "state" : { + "revision" : "8163295f6fe82356b0bcf8e1ab991645de17d096", + "version" : "0.1.2" + } + }, + { + "identity" : "swift-builders", + "kind" : "remoteSourceControl", + "location" : "https://github.com/davdroman/swift-builders", + "state" : { + "revision" : "a283b1ab4f028f13ca2843df340087d3dada5f26", + "version" : "0.5.0" + } + }, + { + "identity" : "swift-custom-dump", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-custom-dump", + "state" : { + "revision" : "edd66cace818e1b1c6f1b3349bb1d8e00d6f8b01", + "version" : "1.0.0" + } + }, + { + "identity" : "xctest-dynamic-overlay", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", + "state" : { + "revision" : "23cbf2294e350076ea4dbd7d5d047c1e76b03631", + "version" : "1.0.2" + } + } + ], + "version" : 2 }