Skip to content

Commit

Permalink
Updates to support Swift Package Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
atljeremy committed Sep 14, 2024
1 parent ab1ff5d commit 030144e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Xcode
#
build/
.build/
*.pbxuser
!default.pbxuser
*.mode1v3
Expand Down
16 changes: 8 additions & 8 deletions HTTPService/HTTPService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public protocol HTTPService: AnyObject {
/// - Parameter request: The paged HTTP request to execute.
/// - Returns: A `Task` that returns a `HTTPResult` containing the result of the request or an error if the request fails.
@discardableResult
public func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPPagedRequest
func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPPagedRequest

/// Executes a given data request asynchronously and returns the result.
///
Expand All @@ -155,7 +155,7 @@ public protocol HTTPService: AnyObject {
/// - Parameter request: The data request to execute.
/// - Returns: A `Task` that returns a `HTTPResult` containing the result of the request or an error if the request fails.
@discardableResult
public func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPDataRequest
func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPDataRequest

/// Executes a given chainable HTTP request asynchronously and returns the result.
///
Expand All @@ -169,7 +169,7 @@ public protocol HTTPService: AnyObject {
/// - Parameter request: The chainable HTTP request to execute.
/// - Returns: A `Task` that returns a `HTTPResult` containing the result of the request or an error if the request fails.
@discardableResult
public func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPRequestChainable
func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPRequestChainable

/// Executes a given chainable HTTP download request asynchronously and returns the result.
///
Expand All @@ -183,7 +183,7 @@ public protocol HTTPService: AnyObject {
/// - Parameter request: The chainable HTTP download request to execute.
/// - Returns: A `Task` that returns a `HTTPResult` containing the result of the request or an error if the request fails.
@discardableResult
public func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPDownloadRequestChainable
func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPDownloadRequestChainable

/// Executes a given HTTP request that is also lifecycle aware asynchronously and returns the result.
///
Expand All @@ -197,7 +197,7 @@ public protocol HTTPService: AnyObject {
/// - Parameter request: The HTTP request to execute.
/// - Returns: A `Task` that returns a `HTTPResult` containing the result of the request or an error if the request fails.
@discardableResult
public func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPRequest & HTTPRequestLifecycleAware
func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPRequest & HTTPRequestLifecycleAware

/// Executes a given HTTP download request asynchronously and returns the result.
///
Expand All @@ -211,7 +211,7 @@ public protocol HTTPService: AnyObject {
/// - Parameter request: The HTTP download request to execute.
/// - Returns: A `Task` that returns a `HTTPResult` containing the result of the request or an error if the request fails.
@discardableResult
public func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPDownloadRequest
func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPDownloadRequest

/// Executes a given HTTP download request that is also lifecycle aware asynchronously and returns the result.
///
Expand All @@ -225,7 +225,7 @@ public protocol HTTPService: AnyObject {
/// - Parameter request: The HTTP download request to execute.
/// - Returns: A `Task` that returns a `HTTPResult` containing the result of the request or an error if the request fails.
@discardableResult
public func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPDownloadRequest & HTTPRequestLifecycleAware
func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPDownloadRequest & HTTPRequestLifecycleAware

/// Executes a given HTTP upload request asynchronously and returns the result.
///
Expand All @@ -239,7 +239,7 @@ public protocol HTTPService: AnyObject {
/// - Parameter request: The HTTP download request to execute.
/// - Returns: A `Task` that returns a `HTTPResult` containing the result of the request or an error if the request fails.
@discardableResult
public func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPUploadRequest
func executeWithCancelation<T>(request: T) -> Task<HTTPResult<T.ResultType>, Never> where T : HTTPUploadRequest
}

extension HTTPService {
Expand Down
11 changes: 7 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// swift-tools-version:5.5
// swift-tools-version:5.7
import PackageDescription

let package = Package(
name: "HTTPService",
platforms: [
.iOS(.v13)
.iOS(.v13),
.macOS(.v13)
],
products: [
.library(
Expand All @@ -16,12 +17,14 @@ let package = Package(
targets: [
.target(
name: "HTTPService",
path: "HTTPService"
path: "HTTPService",
exclude: ["Info.plist"]
),
.testTarget(
name: "HTTPServiceTests",
dependencies: ["HTTPService"],
path: "Tests"
path: "HTTPServiceTests",
exclude: ["Info.plist"]
)
]
)
Expand Down

0 comments on commit 030144e

Please sign in to comment.