From 5caa54337afa0e408d6c714d97aacb8462494a2d Mon Sep 17 00:00:00 2001 From: zunda <47569369+zunda-pixel@users.noreply.github.com> Date: Mon, 15 Jul 2024 04:39:39 +0900 Subject: [PATCH 1/7] support swift 6 concurrency URLSession method --- .../HTTPTypesFoundation/URLSession+HTTPTypes.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift b/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift index 16e4e3e..6e7e391 100644 --- a/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift +++ b/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift @@ -44,7 +44,7 @@ private enum HTTPTypeConversionError: Error { #endif -#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) +#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) || compiler(>=6) @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) extension URLSession { @@ -113,7 +113,14 @@ extension URLSession { } return (location, response) } +} +#endif + +#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) + +@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) +extension URLSession { /// Returns a byte stream that conforms to AsyncSequence protocol. /// /// - Parameter request: The `HTTPRequest` for which to load data. @@ -131,6 +138,10 @@ extension URLSession { } } +#endif + +#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) || compiler(>=6) + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) extension URLSession { /// Convenience method to load data using an `HTTPRequest`; creates and resumes a `URLSessionDataTask` internally. From 052257dbd2a20e26e1e8a10703955770b6946afb Mon Sep 17 00:00:00 2001 From: zunda <47569369+zunda-pixel@users.noreply.github.com> Date: Mon, 15 Jul 2024 07:18:00 +0900 Subject: [PATCH 2/7] add DerivedData to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5fe19ab..f909ec5 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ Package.resolved # DocC generated files .docc-build +DerivedData From 4b41fd0a3a42dbc662b63ee5ee277c475d626e01 Mon Sep 17 00:00:00 2001 From: zunda <47569369+zunda-pixel@users.noreply.github.com> Date: Tue, 16 Jul 2024 11:30:17 +0900 Subject: [PATCH 3/7] remove #if for bytes function --- Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift b/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift index 6e7e391..a0c4b3f 100644 --- a/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift +++ b/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift @@ -113,14 +113,7 @@ extension URLSession { } return (location, response) } -} -#endif - -#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) - -@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) -extension URLSession { /// Returns a byte stream that conforms to AsyncSequence protocol. /// /// - Parameter request: The `HTTPRequest` for which to load data. From 123410433bc35c1b7af2ef542b4d53da5f5cbff7 Mon Sep 17 00:00:00 2001 From: zunda <47569369+zunda-pixel@users.noreply.github.com> Date: Tue, 16 Jul 2024 11:32:51 +0900 Subject: [PATCH 4/7] add #if os for bytes function --- Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift b/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift index a0c4b3f..c8fb1dc 100644 --- a/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift +++ b/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift @@ -114,6 +114,7 @@ extension URLSession { return (location, response) } + #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) /// Returns a byte stream that conforms to AsyncSequence protocol. /// /// - Parameter request: The `HTTPRequest` for which to load data. @@ -129,6 +130,7 @@ extension URLSession { } return (data, response) } + #endif } #endif From 03eab5b69c0fc6d65c945caecc5a69f9f028e88f Mon Sep 17 00:00:00 2001 From: zunda <47569369+zunda-pixel@users.noreply.github.com> Date: Tue, 16 Jul 2024 11:44:23 +0900 Subject: [PATCH 5/7] remove #if for old platform --- Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift b/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift index c8fb1dc..1cdb689 100644 --- a/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift +++ b/Sources/HTTPTypesFoundation/URLSession+HTTPTypes.swift @@ -133,10 +133,6 @@ extension URLSession { #endif } -#endif - -#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) || compiler(>=6) - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) extension URLSession { /// Convenience method to load data using an `HTTPRequest`; creates and resumes a `URLSessionDataTask` internally. From d72a779e9c0e34c75fb21c3e47836daaa360061c Mon Sep 17 00:00:00 2001 From: zunda <47569369+zunda-pixel@users.noreply.github.com> Date: Wed, 17 Jul 2024 09:01:53 +0900 Subject: [PATCH 6/7] move line --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f909ec5..ed6aa3b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,10 +6,10 @@ .xcode /*.xcodeproj .xcode +DerivedData .swiftpm/ Package.resolved # DocC generated files -.docc-build -DerivedData +.docc-build \ No newline at end of file From ae224e4bd26b8073c36bb71388ac118d1ae77c76 Mon Sep 17 00:00:00 2001 From: zunda <47569369+zunda-pixel@users.noreply.github.com> Date: Wed, 17 Jul 2024 09:04:00 +0900 Subject: [PATCH 7/7] add newline --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ed6aa3b..a2cb186 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,4 @@ DerivedData Package.resolved # DocC generated files -.docc-build \ No newline at end of file +.docc-build