From ee18e7560a44e7f602d2da5a8de21ba3e4e9223a Mon Sep 17 00:00:00 2001 From: Andreas Ganske Date: Sat, 27 Jan 2024 18:42:38 +0100 Subject: [PATCH 1/4] Use async/await instead of PromiseKit --- ConvAPI.podspec | 19 --- Package.resolved | 25 --- Package.swift | 13 +- README.md | 32 +--- Sources/ConvAPI/API.swift | 71 ++++---- Sources/ConvAPI/AsynchronousRequester.swift | 9 +- Sources/ConvAPI/ConvAPI.swift | 19 +-- Sources/ConvAPITests/ConvAPITests.swift | 179 ++++++-------------- 8 files changed, 110 insertions(+), 257 deletions(-) delete mode 100644 ConvAPI.podspec delete mode 100644 Package.resolved diff --git a/ConvAPI.podspec b/ConvAPI.podspec deleted file mode 100644 index 75a66e1..0000000 --- a/ConvAPI.podspec +++ /dev/null @@ -1,19 +0,0 @@ -Pod::Spec.new do |s| - - s.name = "ConvAPI" - s.version = "1.0.1" - s.summary = "Easy HTTP requests against REST-style APIs with codable JSON bodies" - s.description = <<-DESC - ConvAPI allows easy HTTP requests in Swift against REST-style APIs with JSON formatting by supporting codable bodies and promised responses. - DESC - - s.homepage = "https://github.com/ChaosCoder/ConvAPI" - s.license = { :type => 'MIT', :file => 'LICENSE.md'} - s.author = { "Andreas Ganske" => "info@chaosspace.de" } - s.ios.deployment_target = "10.0" - s.source = { :git => "https://github.com/ChaosCoder/ConvAPI.git", :tag => s.version } - s.source_files = "Sources/ConvAPI", "Sources/ConvAPI/**/*.swift" - s.swift_version = "5.0" - s.dependency "PromiseKit", "~> 6.8" - -end diff --git a/Package.resolved b/Package.resolved deleted file mode 100644 index 5126ea9..0000000 --- a/Package.resolved +++ /dev/null @@ -1,25 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "PMKFoundation", - "repositoryURL": "https://github.com/PromiseKit/Foundation.git", - "state": { - "branch": null, - "revision": "1a276e598dac59489ed904887e0740fa75e571e0", - "version": "3.3.4" - } - }, - { - "package": "PromiseKit", - "repositoryURL": "https://github.com/mxcl/PromiseKit.git", - "state": { - "branch": null, - "revision": "aea48ea1855f5d82e2dffa6027afce3aab8f3dd7", - "version": "6.13.3" - } - } - ] - }, - "version": 1 -} diff --git a/Package.swift b/Package.swift index d05d712..e20a44b 100644 --- a/Package.swift +++ b/Package.swift @@ -1,23 +1,16 @@ -// swift-tools-version: 5.7 +// swift-tools-version: 5.9 import PackageDescription let package = Package( name: "ConvAPI", platforms: [ - .iOS(.v11), + .iOS(.v15), ], products: [ .library(name: "ConvAPI", targets: ["ConvAPI"]), ], - dependencies: [ - .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.8.0"), - .package(url: "https://github.com/PromiseKit/Foundation.git", from: "3.0.0"), - ], targets: [ - .target(name: "ConvAPI", dependencies: [ - .product(name: "PromiseKit", package: "PromiseKit"), - .product(name: "PMKFoundation", package: "Foundation"), - ]), + .target(name: "ConvAPI"), .testTarget(name: "ConvAPITests", dependencies: ["ConvAPI"]), ] ) diff --git a/README.md b/README.md index f20224e..e767f8b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # ConvAPI -[![](http://img.shields.io/badge/Swift-5.0-blue.svg)]() [![](http://img.shields.io/badge/iOS-10.0%2B-blue.svg)]() [![](https://img.shields.io/github/license/ChaosCoder/ConvAPI.svg)](LICENSE.md) [![Build Status](https://app.bitrise.io/app/9bd0d2e769e903f9/status.svg?token=9IwhtVc_5lq3l5PnCY9LLQ&branch=master)](https://app.bitrise.io/app/9bd0d2e769e903f9) +[![](http://img.shields.io/badge/Swift-5.0-blue.svg)]() [![](http://img.shields.io/badge/iOS-15.0%2B-blue.svg)]() [![](https://img.shields.io/github/license/ChaosCoder/ConvAPI.svg)](LICENSE.md) [![Build Status](https://app.bitrise.io/app/9bd0d2e769e903f9/status.svg?token=9IwhtVc_5lq3l5PnCY9LLQ&branch=master)](https://app.bitrise.io/app/9bd0d2e769e903f9) ConvAPI allows easy [HTTP](https://tools.ietf.org/html/rfc7231) requests in [Swift](https://swift.org) against [REST](https://en.wikipedia.org/wiki/Representational_state_transfer)-style [APIs](https://en.wikipedia.org/wiki/Application_programming_interface) with [JSON](https://www.json.org/) formatting by supporting [codable](https://developer.apple.com/documentation/swift/codable) bodies and [promised](https://github.com/mxcl/PromiseKit) responses. @@ -17,11 +17,11 @@ func request(method: APIMethod, params: [String: Any]?, body: T?, error: E.Type, - decorator: ((inout URLRequest) -> Void)?) -> Promise + decorator: ((inout URLRequest) -> Void)?) async throws -> U ``` where `T: Encodable, U: Decodable, E: (Error & Decodable)` at its core. -This method allows you to request a resource from an API specifying the +This method allows you to asynchronously request a resource from an API specifying the - method (*e.g. `GET`*), - baseURL, - resource URI (*e.g. `/users/42`*), @@ -45,11 +45,8 @@ struct User: Codable { let api = ConvAPI() let baseURL = URL(string: "https://jsonplaceholder.typicode.com")! -firstly { () -> Promise in - api.request(method: .GET, baseURL: baseURL, resource: "/users/1", error: ConvAPIError.self) -}.done { user in - print(user) // User(id: 1, name: "Leanne Graham") -} +let user: User = try await api.request(method: .GET, baseURL: baseURL, resource: "/users/1", error: ConvAPIError.self) +print(user) // User(id: 1, name: "Leanne Graham") ``` ### Specifying an error @@ -62,11 +59,10 @@ struct MyAPIError: Error, Codable { let message: String } -firstly { () -> Promise in - api.request(method: .GET, baseURL: baseURL, resource: "/users/1", error: MyAPIError.self) -}.done { user in +do { + let user: User = try await api.request(method: .GET, baseURL: baseURL, resource: "/users/1", error: MyAPIError.self) // [...] -}.catch { error in +} catch { switch error { case let error as MyAPIError: print(error.code) default: break // Request error, network down, etc. @@ -74,20 +70,8 @@ firstly { () -> Promise in } ``` -## Install - -### Cocoapods - -```ruby -pod 'ConvAPI' -``` - ### Swift Package Manager ```swift .package(url: "https://github.com/ChaosCoder/ConvAPI.git", from: "1.0.0") ``` - -## Acknowledgments - -This uses [mxcl/PromiseKit](https://github.com/mxcl/PromiseKit) as a dependency. \ No newline at end of file diff --git a/Sources/ConvAPI/API.swift b/Sources/ConvAPI/API.swift index 13f56e8..5030fab 100644 --- a/Sources/ConvAPI/API.swift +++ b/Sources/ConvAPI/API.swift @@ -7,7 +7,6 @@ // import Foundation -import PromiseKit public protocol API { @@ -21,7 +20,7 @@ public protocol API { params: [String: Any]?, body: T?, error: E.Type, - decorator: ((inout URLRequest) -> Void)?) -> Promise where T: Encodable, U: Decodable, E: (Error & Decodable) + decorator: ((inout URLRequest) -> Void)?) async throws -> U where T: Encodable, U: Decodable, E: (Error & Decodable) } public extension API { @@ -32,16 +31,16 @@ public extension API { headers: [String: String]? = nil, params: [String: Any]? = nil, error: E.Type, - decorator: ((inout URLRequest) -> Void)? = nil) -> Promise where U: Decodable, E: Decodable & Error { + decorator: ((inout URLRequest) -> Void)? = nil) async throws -> U where U: Decodable, E: Decodable & Error { - return request(method: method, - baseURL: baseURL, - resource: resource, - headers: headers, - params: params, - body: nil as Bool?, - error: error, - decorator: decorator) + return try await request(method: method, + baseURL: baseURL, + resource: resource, + headers: headers, + params: params, + body: nil as Bool?, + error: error, + decorator: decorator) } func request(method: APIMethod, @@ -51,23 +50,24 @@ public extension API { params: [String: Any]? = nil, body: T?, error: E.Type, - decorator: ((inout URLRequest) -> Void)? = nil) -> Promise where T: Encodable, E: Decodable & Error { - let promise: Promise = request(method: method, - baseURL: baseURL, - resource: resource, - headers: headers, - params: params, - body: body, - error: error, - decorator: decorator) - return promise.asVoid().recover({ error in + decorator: ((inout URLRequest) -> Void)? = nil) async throws -> Void where T: Encodable, E: Decodable & Error { + do { + let _: EmptyResponse = try await request(method: method, + baseURL: baseURL, + resource: resource, + headers: headers, + params: params, + body: body, + error: error, + decorator: decorator) + } catch { if let requestError = error as? RequestError, - case .emptyResponse = requestError { + case .emptyResponse = requestError { return () } else { throw error } - }) + } } func request(method: APIMethod, @@ -76,22 +76,23 @@ public extension API { headers: [String: String]? = nil, params: [String: Any]? = nil, error: E.Type, - decorator: ((inout URLRequest) -> Void)? = nil) -> Promise where E: Decodable & Error { - let promise: Promise = request(method: method, - baseURL: baseURL, - resource: resource, - headers: headers, - params: params, - body: nil as Bool?, - error: error, - decorator: decorator) - return promise.asVoid().recover({ error in + decorator: ((inout URLRequest) -> Void)? = nil) async throws -> Void where E: Decodable & Error { + do { + let _: EmptyResponse = try await request(method: method, + baseURL: baseURL, + resource: resource, + headers: headers, + params: params, + body: nil as Bool?, + error: error, + decorator: decorator) + } catch { if let requestError = error as? RequestError, - case .emptyResponse = requestError { + case .emptyResponse = requestError { return () } else { throw error } - }) + } } } diff --git a/Sources/ConvAPI/AsynchronousRequester.swift b/Sources/ConvAPI/AsynchronousRequester.swift index 34dcb68..ccde2d7 100644 --- a/Sources/ConvAPI/AsynchronousRequester.swift +++ b/Sources/ConvAPI/AsynchronousRequester.swift @@ -7,13 +7,12 @@ // import Foundation -import PromiseKit -#if canImport(PMKFoundation) -import PMKFoundation -#endif public protocol AsynchronousRequester { - func dataTask(_: PMKNamespacer, with convertible: URLRequestConvertible) -> Promise<(data: Data, response: URLResponse)> + func data( + for request: URLRequest, + delegate: (URLSessionTaskDelegate)? + ) async throws -> (Data, URLResponse) } extension URLSession: AsynchronousRequester {} diff --git a/Sources/ConvAPI/ConvAPI.swift b/Sources/ConvAPI/ConvAPI.swift index f49af28..2069c8f 100644 --- a/Sources/ConvAPI/ConvAPI.swift +++ b/Sources/ConvAPI/ConvAPI.swift @@ -7,7 +7,6 @@ // import Foundation -import PromiseKit struct ConvAPIError: Error, Codable { let type: String @@ -68,15 +67,11 @@ public class ConvAPI: API { params: [String: Any]? = nil, body: T? = nil, error: E.Type, - decorator: ((inout URLRequest) -> Void)? = nil) -> Promise where T: Encodable, U: Decodable, E: (Error & Decodable) { - return firstly { () -> Promise<(data: Data, response: URLResponse)> in - let data = try body.map { try encoder.encode($0) } - let task = try request(method: method, baseURL: baseURL, resource: resource, headers: headers, params: params, body: data, decorator: decorator) - - return requester.dataTask(.promise, with: task) - }.map { data, response -> U in - return try self.parseResponse(data: data, response: response, error: error) - } + decorator: ((inout URLRequest) -> Void)? = nil) async throws -> U where T: Encodable, U: Decodable, E: (Error & Decodable) { + let bodyData = try body.map { try encoder.encode($0) } + let task = try request(method: method, baseURL: baseURL, resource: resource, headers: headers, params: params, body: bodyData, decorator: decorator) + let (data, response) = try await requester.data(for: task, delegate: nil) + return try parseResponse(data: data, response: response, error: error) } private func request(method: APIMethod = .GET, @@ -129,7 +124,7 @@ public class ConvAPI: API { guard !data.isEmpty else { throw RequestError.emptyErrorResponse(httpStatusCode: httpResponse.statusCode) } - let appError = try self.decoder.decode(E.self, from: data) + let appError = try decoder.decode(E.self, from: data) throw appError } @@ -137,6 +132,6 @@ public class ConvAPI: API { throw RequestError.emptyResponse } - return try self.decoder.decode(U.self, from: data) + return try decoder.decode(U.self, from: data) } } diff --git a/Sources/ConvAPITests/ConvAPITests.swift b/Sources/ConvAPITests/ConvAPITests.swift index 94a0a57..cb5f118 100644 --- a/Sources/ConvAPITests/ConvAPITests.swift +++ b/Sources/ConvAPITests/ConvAPITests.swift @@ -7,19 +7,14 @@ // import XCTest -import PromiseKit -#if canImport(PMKFoundation) -import PMKFoundation -#endif @testable import ConvAPI struct MockRequester: AsynchronousRequester { let callback: (URLRequest) -> Void - func dataTask(_ namespace: PMKNamespacer, with convertible: URLRequestConvertible) -> Promise<(data: Data, response: URLResponse)> { - let request = convertible.pmkRequest + func data(for request: URLRequest, delegate: (URLSessionTaskDelegate)?) async throws -> (Data, URLResponse) { callback(request) - return URLSession.shared.dataTask(namespace, with: convertible) + return try await URLSession.shared.data(for: request) } func dataTask(with request: URLRequest, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask { @@ -37,7 +32,7 @@ struct APIError: Codable, Error { class ConvAPITests: XCTestCase { - static let url = URL(string: "https://jsonapitestserver.herokuapp.com")! + static let url = URL(string: "http://localhost:1337")! lazy var api: ConvAPI = { return ConvAPI(requester: URLSession(configuration: URLSessionConfiguration.default, delegate: nil, delegateQueue: OperationQueue())) @@ -61,27 +56,20 @@ class ConvAPITests: XCTestCase { assert(error == nil) } - func testPostWithEmptyResponse() { - let expect = self.expectation(description: "Completion") - api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", error: APIError.self).done { _ in - expect.fulfill() - }.cauterize() - wait(for: [expect], timeout: 5) + func testPostWithEmptyResponse() async throws { + try await api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", error: APIError.self) } - func testInternalServerError() { - let expect = self.expectation(description: "Completion") - api.request(method: .GET, baseURL: ConvAPITests.url, resource: "/get", headers: ["X-HTTP-STATUS": "500"], error: APIError.self).done { (_: Post) in + func testInternalServerError() async { + do { + let _: Post = try await api.request(method: .GET, baseURL: ConvAPITests.url, resource: "/get", headers: ["X-HTTP-STATUS": "500"], error: APIError.self) XCTFail() - }.catch { error in - expect.fulfill() + } catch { + } - - wait(for: [expect], timeout: 5) } - - func testUsage() { - + + func testUsage() async throws { struct User: Codable { let id: Int let name: String @@ -92,21 +80,10 @@ class ConvAPITests: XCTestCase { let message: String } - let expect = self.expectation(description: "Completion") - let api = ConvAPI() let baseURL = URL(string: "https://jsonplaceholder.typicode.com")! - firstly { () -> Promise in - api.request(method: .GET, baseURL: baseURL, resource: "/users/1", error: MyAPIError.self) - }.done { user in - print(user) - }.catch { error in - XCTFail(error.localizedDescription) - }.finally { - expect.fulfill() - } - - wait(for: [expect], timeout: 20) + let user: User = try await api.request(method: .GET, baseURL: baseURL, resource: "/users/1", error: MyAPIError.self) + print(user) } func testErrorDescription() { @@ -114,115 +91,63 @@ class ConvAPITests: XCTestCase { XCTAssertEqual(error.localizedDescription, "Invalid request") } - func testBadRequestError() { + func testBadRequestError() async { let expectedError = APIError(code: 1, message: "Test") - let expect = self.expectation(description: "Completion") - api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", headers: ["X-HTTP-STATUS": "400"], body: expectedError, error: APIError.self).catch { (error) in + do { + try await api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", headers: ["X-HTTP-STATUS": "400"], body: expectedError, error: APIError.self) + } catch { switch error { case let error as APIError: XCTAssertEqual(error.code, expectedError.code) XCTAssertEqual(error.message, expectedError.message) - expect.fulfill() default: XCTFail() } } - - wait(for: [expect], timeout: 5) } - func testNonBlockingBehavior() { - let post = Post(name: "example") - - let expect = self.expectation(description: "Completion") - api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", body: post, error: APIError.self).then { (_: Post) in - self.api.request(method:.POST, baseURL: ConvAPITests.url, resource: "/post", body: post, error: APIError.self).done { (_: Post) in - expect.fulfill() - } - }.cauterize() - - wait(for: [expect], timeout: 10) - } - - func testChaining() { - let post = Post(name: "example") - let expect = self.expectation(description: "Completion") - - api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", body: post, error: APIError.self).then { (responsePost: Post) in - self.api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", body: responsePost, error: APIError.self) - }.done { (responsePost: Post) in - XCTAssertEqual(responsePost, post) - expect.fulfill() - }.cauterize() - - wait(for: [expect], timeout: 10) - } - - func testWaitingForMultipleRequests() { + func testNonBlockingBehavior() async throws { let postOne = Post(name: "one") let postTwo = Post(name: "two") + + async let post1: Post = api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", body: postOne, error: APIError.self) + async let post2: Post = api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", body: postTwo, error: APIError.self) - let expect = self.expectation(description: "Completion") - - let requestOne: Promise = api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", body: postOne, error: APIError.self) - let requestTwo: Promise = api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", body: postTwo, error: APIError.self) - - when(fulfilled: requestOne, requestTwo).done { responseOne, responseTwo in - XCTAssertEqual(responseOne, postOne) - XCTAssertEqual(responseTwo, postTwo) - expect.fulfill() - }.cauterize() + let posts = try await [post1, post2] - wait(for: [expect], timeout: 10) + XCTAssertEqual(posts, [postOne, postTwo]) } - func testPost() { + func testPost() async throws { let post = Post(name: "example") - - let expect = self.expectation(description: "Completion") - api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", body: post, error: APIError.self).done { (object: Post) in - XCTAssertEqual(object, post) - expect.fulfill() - }.cauterize() - - wait(for: [expect], timeout: 5) + let retrieved: Post = try await api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", body: post, error: APIError.self) + XCTAssertEqual(retrieved, post) } - func testGet() { + func testGet() async throws { let post = Post(name: "test") - let expect = self.expectation(description: "Completion") - - api.request(method: .GET, baseURL: ConvAPITests.url, resource: "/get?name=test", error: APIError.self).done { (responsePost: Post) in - XCTAssertEqual(responsePost, post) - expect.fulfill() - }.cauterize() - - wait(for: [expect], timeout: 5) + let responsePost: Post = try await api.request(method: .GET, baseURL: ConvAPITests.url, resource: "/get?name=test", error: APIError.self) + XCTAssertEqual(responsePost, post) } - func testBadRequest() { - let expect = self.expectation(description: "Completion") - api.request(method: .GET, baseURL: ConvAPITests.url, resource: "/get", headers: ["X-HTTP-STATUS": "400"], error: APIError.self).done { (post: Post) in + func testBadRequest() async throws { + do { + let _: Post = try await api.request(method: .GET, baseURL: ConvAPITests.url, resource: "/get", headers: ["X-HTTP-STATUS": "400"], error: APIError.self) XCTFail() - }.catch { _ in - expect.fulfill() + } catch { + } - wait(for: [expect], timeout: 5) } - func testComplexRedirection() { - let headers = ["X-LOCATION": "https://jsonapitestserver.herokuapp.com/get?name=test"] + func testComplexRedirection() async throws { + let headers = ["X-LOCATION": "http://localhost:1337/get?name=test"] let post = Post(name: "test") - let expect = self.expectation(description: "Completion") - api.request(method: .GET, baseURL: ConvAPITests.url, resource: "/redirect", headers: headers, error: APIError.self).done { (responsePost: Post) in - XCTAssertEqual(responsePost, post) - expect.fulfill() - }.cauterize() - wait(for: [expect], timeout: 5) + let responsePost: Post = try await api.request(method: .GET, baseURL: ConvAPITests.url, resource: "/redirect", headers: headers, error: APIError.self) + XCTAssertEqual(responsePost, post) } - func testContentTypeHeader() { + func testContentTypeHeader() async throws { let expect = self.expectation(description: "Completion") let mockRequester = MockRequester { request in XCTAssertEqual(request.value(forHTTPHeaderField: "Content-Type"), "application/json") @@ -230,11 +155,11 @@ class ConvAPITests: XCTestCase { } let api = ConvAPI(requester: mockRequester) - api.request(method: .GET, baseURL: ConvAPITests.url, error: APIError.self).cauterize() - wait(for: [expect], timeout: 5) + try await api.request(method: .GET, baseURL: ConvAPITests.url, error: APIError.self) + await fulfillment(of: [expect]) } - func test8601DateEncoding() { + func test8601DateEncoding() async throws { struct RawPostWithDate: Codable { let name: String @@ -251,11 +176,11 @@ class ConvAPITests: XCTestCase { let post = PostWithDate(name: "Test", date: Date(timeIntervalSince1970: 1547813428)) let api = ConvAPI(requester: mockRequester) - api.request(method: .POST, baseURL: ConvAPITests.url, body: post, error: APIError.self).cauterize() - wait(for: [expect], timeout: 5) + try await api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", body: post, error: APIError.self) + await fulfillment(of: [expect]) } - func testAlternativeDateEncoding() { + func testAlternativeDateEncoding() async throws { struct RawPostWithDate: Codable { let name: String @@ -274,16 +199,16 @@ class ConvAPITests: XCTestCase { let post = PostWithDate(name: "Test", date: Date(timeIntervalSince1970: secondsSince1970)) let api = ConvAPI(requester: mockRequester) api.encoder.dateEncodingStrategy = .secondsSince1970 - api.request(method: .POST, baseURL: ConvAPITests.url, body: post, error: APIError.self).cauterize() - wait(for: [expect], timeout: 5) + try await api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", body: post, error: APIError.self) + await fulfillment(of: [expect]) } - func testCallDecorator() { + func testCallDecorator() async throws { let expect = self.expectation(description: "Decorator called") - api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", error: APIError.self, decorator: { request in + try await api.request(method: .POST, baseURL: ConvAPITests.url, resource: "/post", error: APIError.self, decorator: { request in expect.fulfill() - }).cauterize() - wait(for: [expect], timeout: 5) + }) + await fulfillment(of: [expect]) } } From 03cb866dab9e7a5ac7d0408bb6b4d4ac2f8ed5ee Mon Sep 17 00:00:00 2001 From: Andreas Ganske Date: Sun, 28 Jan 2024 12:48:04 +0100 Subject: [PATCH 2/4] Fix tests by specifying cyclic url --- Sources/ConvAPITests/ConvAPITests.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/ConvAPITests/ConvAPITests.swift b/Sources/ConvAPITests/ConvAPITests.swift index cb5f118..0ea6432 100644 --- a/Sources/ConvAPITests/ConvAPITests.swift +++ b/Sources/ConvAPITests/ConvAPITests.swift @@ -32,7 +32,7 @@ struct APIError: Codable, Error { class ConvAPITests: XCTestCase { - static let url = URL(string: "http://localhost:1337")! + static let url = URL(string: "https://uninterested-hosiery-bass.cyclic.app")! lazy var api: ConvAPI = { return ConvAPI(requester: URLSession(configuration: URLSessionConfiguration.default, delegate: nil, delegateQueue: OperationQueue())) @@ -141,7 +141,7 @@ class ConvAPITests: XCTestCase { } func testComplexRedirection() async throws { - let headers = ["X-LOCATION": "http://localhost:1337/get?name=test"] + let headers = ["X-LOCATION": "\(ConvAPITests.url)/get?name=test"] let post = Post(name: "test") let responsePost: Post = try await api.request(method: .GET, baseURL: ConvAPITests.url, resource: "/redirect", headers: headers, error: APIError.self) XCTAssertEqual(responsePost, post) From 5c94d9d3864af1093c977419830d0246a6524849 Mon Sep 17 00:00:00 2001 From: Andreas Ganske Date: Sun, 28 Jan 2024 12:51:54 +0100 Subject: [PATCH 3/4] Remove cocoapods --- Podfile | 16 ---------------- Podfile.lock | 24 ------------------------ 2 files changed, 40 deletions(-) delete mode 100644 Podfile delete mode 100644 Podfile.lock diff --git a/Podfile b/Podfile deleted file mode 100644 index 9b59f53..0000000 --- a/Podfile +++ /dev/null @@ -1,16 +0,0 @@ -# Uncomment the next line to define a global platform for your project -platform :ios, '10.0' -use_frameworks! - -target 'ConvAPI' do - - pod 'PromiseKit', '~> 6.8' - -end - -target 'ConvAPITests' do - inherit! :search_paths - - pod 'PromiseKit', '~> 6.8' - -end diff --git a/Podfile.lock b/Podfile.lock deleted file mode 100644 index dbf9657..0000000 --- a/Podfile.lock +++ /dev/null @@ -1,24 +0,0 @@ -PODS: - - PromiseKit (6.13.1): - - PromiseKit/CorePromise (= 6.13.1) - - PromiseKit/Foundation (= 6.13.1) - - PromiseKit/UIKit (= 6.13.1) - - PromiseKit/CorePromise (6.13.1) - - PromiseKit/Foundation (6.13.1): - - PromiseKit/CorePromise - - PromiseKit/UIKit (6.13.1): - - PromiseKit/CorePromise - -DEPENDENCIES: - - PromiseKit (~> 6.8) - -SPEC REPOS: - trunk: - - PromiseKit - -SPEC CHECKSUMS: - PromiseKit: 28fda91c973cc377875d8c0ea4f973013c05b6db - -PODFILE CHECKSUM: 5ba81e26221acdabecc4a1d4b5272f23345fe374 - -COCOAPODS: 1.9.1 From 595e086a05aa59d8ddcbf792570a0a37c743d87f Mon Sep 17 00:00:00 2001 From: Andreas Ganske Date: Sun, 28 Jan 2024 13:04:54 +0100 Subject: [PATCH 4/4] Remove xcodeproj and workspace and add bitrise.yml --- ConvAPI.xcodeproj/project.pbxproj | 606 ------------------ .../contents.xcworkspacedata | 7 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../xcshareddata/xcschemes/ConvAPI.xcscheme | 77 --- ConvAPI.xcworkspace/contents.xcworkspacedata | 10 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - bitrise.yml | 39 ++ 7 files changed, 39 insertions(+), 716 deletions(-) delete mode 100644 ConvAPI.xcodeproj/project.pbxproj delete mode 100644 ConvAPI.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 ConvAPI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 ConvAPI.xcodeproj/xcshareddata/xcschemes/ConvAPI.xcscheme delete mode 100644 ConvAPI.xcworkspace/contents.xcworkspacedata delete mode 100644 ConvAPI.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 bitrise.yml diff --git a/ConvAPI.xcodeproj/project.pbxproj b/ConvAPI.xcodeproj/project.pbxproj deleted file mode 100644 index 2b535de..0000000 --- a/ConvAPI.xcodeproj/project.pbxproj +++ /dev/null @@ -1,606 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXBuildFile section */ - 45129824874B8724C4FE0A1D /* Pods_ConvAPITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C90C7FB9BA4EFE4E2839C3D /* Pods_ConvAPITests.framework */; }; - 6EC1E1935B9D9DB0FD20DDC0 /* Pods_ConvAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C5739C3D48EC599C2B2A58F /* Pods_ConvAPI.framework */; }; - 7D320DD32088FADC007C7DDE /* API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D320DD22088FADC007C7DDE /* API.swift */; }; - 7D6C9514244B35FD003C3A8F /* Empty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D6C9513244B35FD003C3A8F /* Empty.swift */; }; - 7D6C9515244B3601003C3A8F /* Empty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D6C9513244B35FD003C3A8F /* Empty.swift */; }; - 7D6C9517244B37AC003C3A8F /* URLSession+Synchronous.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D6C9516244B37AC003C3A8F /* URLSession+Synchronous.swift */; }; - 7DBB740B2199C45A002C5B82 /* APIMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DBB74082199C45A002C5B82 /* APIMethod.swift */; }; - 7DBB740C2199C45A002C5B82 /* APIMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DBB74082199C45A002C5B82 /* APIMethod.swift */; }; - 7DBB740D2199C45A002C5B82 /* AsynchronousRequester.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DBB74092199C45A002C5B82 /* AsynchronousRequester.swift */; }; - 7DDDFB2020839BD700F3426C /* ConvAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7DDDFB1620839BD700F3426C /* ConvAPI.framework */; }; - 7DDDFB2520839BD700F3426C /* ConvAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DDDFB2420839BD700F3426C /* ConvAPITests.swift */; }; - 7DDDFB2720839BD700F3426C /* ConvAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DDDFB1920839BD700F3426C /* ConvAPI.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7DDDFB3120839BF500F3426C /* ConvAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DDDFB3020839BF500F3426C /* ConvAPI.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 7DDDFB2120839BD700F3426C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 7DDDFB0D20839BD700F3426C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 7DDDFB1520839BD700F3426C; - remoteInfo = ConvAPI; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 48C3247508EEF78D716D6A49 /* Pods-ConvAPITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ConvAPITests.release.xcconfig"; path = "Target Support Files/Pods-ConvAPITests/Pods-ConvAPITests.release.xcconfig"; sourceTree = ""; }; - 7D320DD22088FADC007C7DDE /* API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = ""; }; - 7D3DCD5A221EAB68005E5875 /* ConvAPI.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ConvAPI.podspec; sourceTree = ""; }; - 7D6C9513244B35FD003C3A8F /* Empty.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Empty.swift; sourceTree = ""; }; - 7D6C9516244B37AC003C3A8F /* URLSession+Synchronous.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URLSession+Synchronous.swift"; sourceTree = ""; }; - 7DBB74082199C45A002C5B82 /* APIMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = APIMethod.swift; sourceTree = ""; }; - 7DBB74092199C45A002C5B82 /* AsynchronousRequester.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AsynchronousRequester.swift; sourceTree = ""; }; - 7DDDFB1620839BD700F3426C /* ConvAPI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ConvAPI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 7DDDFB1920839BD700F3426C /* ConvAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ConvAPI.h; sourceTree = ""; }; - 7DDDFB1A20839BD700F3426C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 7DDDFB1F20839BD700F3426C /* ConvAPITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ConvAPITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 7DDDFB2420839BD700F3426C /* ConvAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConvAPITests.swift; sourceTree = ""; }; - 7DDDFB2620839BD700F3426C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 7DDDFB3020839BF500F3426C /* ConvAPI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConvAPI.swift; sourceTree = ""; }; - 86BDB003A2EB673ADFC675AB /* Pods-ConvAPI.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ConvAPI.debug.xcconfig"; path = "Target Support Files/Pods-ConvAPI/Pods-ConvAPI.debug.xcconfig"; sourceTree = ""; }; - 9C5739C3D48EC599C2B2A58F /* Pods_ConvAPI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ConvAPI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 9C90C7FB9BA4EFE4E2839C3D /* Pods_ConvAPITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ConvAPITests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - B30E115FBA009AC726A947E1 /* Pods-ConvAPI.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ConvAPI.release.xcconfig"; path = "Target Support Files/Pods-ConvAPI/Pods-ConvAPI.release.xcconfig"; sourceTree = ""; }; - CEACE7D43A169EEA7ABE9566 /* Pods-ConvAPITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ConvAPITests.debug.xcconfig"; path = "Target Support Files/Pods-ConvAPITests/Pods-ConvAPITests.debug.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 7DDDFB1220839BD700F3426C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 6EC1E1935B9D9DB0FD20DDC0 /* Pods_ConvAPI.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7DDDFB1C20839BD700F3426C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 7DDDFB2020839BD700F3426C /* ConvAPI.framework in Frameworks */, - 45129824874B8724C4FE0A1D /* Pods_ConvAPITests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 4EA3AB4304A50CCCF61ECF80 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 9C5739C3D48EC599C2B2A58F /* Pods_ConvAPI.framework */, - 9C90C7FB9BA4EFE4E2839C3D /* Pods_ConvAPITests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 7DDDFB0C20839BD700F3426C = { - isa = PBXGroup; - children = ( - E5A3311C25A8A47D002B0526 /* Sources */, - 7D3DCD5A221EAB68005E5875 /* ConvAPI.podspec */, - 7DDDFB1720839BD700F3426C /* Products */, - B14DD6682C81BE521D665ACE /* Pods */, - 4EA3AB4304A50CCCF61ECF80 /* Frameworks */, - ); - sourceTree = ""; - }; - 7DDDFB1720839BD700F3426C /* Products */ = { - isa = PBXGroup; - children = ( - 7DDDFB1620839BD700F3426C /* ConvAPI.framework */, - 7DDDFB1F20839BD700F3426C /* ConvAPITests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 7DDDFB1820839BD700F3426C /* ConvAPI */ = { - isa = PBXGroup; - children = ( - 7D6C9513244B35FD003C3A8F /* Empty.swift */, - 7DBB74082199C45A002C5B82 /* APIMethod.swift */, - 7DBB74092199C45A002C5B82 /* AsynchronousRequester.swift */, - 7DDDFB1920839BD700F3426C /* ConvAPI.h */, - 7DDDFB3020839BF500F3426C /* ConvAPI.swift */, - 7D320DD22088FADC007C7DDE /* API.swift */, - 7DDDFB1A20839BD700F3426C /* Info.plist */, - ); - path = ConvAPI; - sourceTree = ""; - }; - 7DDDFB2320839BD700F3426C /* ConvAPITests */ = { - isa = PBXGroup; - children = ( - 7DDDFB2420839BD700F3426C /* ConvAPITests.swift */, - 7D6C9516244B37AC003C3A8F /* URLSession+Synchronous.swift */, - 7DDDFB2620839BD700F3426C /* Info.plist */, - ); - path = ConvAPITests; - sourceTree = ""; - }; - B14DD6682C81BE521D665ACE /* Pods */ = { - isa = PBXGroup; - children = ( - 86BDB003A2EB673ADFC675AB /* Pods-ConvAPI.debug.xcconfig */, - B30E115FBA009AC726A947E1 /* Pods-ConvAPI.release.xcconfig */, - CEACE7D43A169EEA7ABE9566 /* Pods-ConvAPITests.debug.xcconfig */, - 48C3247508EEF78D716D6A49 /* Pods-ConvAPITests.release.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; - E5A3311C25A8A47D002B0526 /* Sources */ = { - isa = PBXGroup; - children = ( - 7DDDFB1820839BD700F3426C /* ConvAPI */, - 7DDDFB2320839BD700F3426C /* ConvAPITests */, - ); - path = Sources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 7DDDFB1320839BD700F3426C /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 7DDDFB2720839BD700F3426C /* ConvAPI.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 7DDDFB1520839BD700F3426C /* ConvAPI */ = { - isa = PBXNativeTarget; - buildConfigurationList = 7DDDFB2A20839BD700F3426C /* Build configuration list for PBXNativeTarget "ConvAPI" */; - buildPhases = ( - 53DB2E07BEAE920EBB78FFB0 /* [CP] Check Pods Manifest.lock */, - 7DDDFB1120839BD700F3426C /* Sources */, - 7DDDFB1220839BD700F3426C /* Frameworks */, - 7DDDFB1320839BD700F3426C /* Headers */, - 7DDDFB1420839BD700F3426C /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ConvAPI; - productName = ConvAPI; - productReference = 7DDDFB1620839BD700F3426C /* ConvAPI.framework */; - productType = "com.apple.product-type.framework"; - }; - 7DDDFB1E20839BD700F3426C /* ConvAPITests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 7DDDFB2D20839BD700F3426C /* Build configuration list for PBXNativeTarget "ConvAPITests" */; - buildPhases = ( - 06BCF8BFF6D0B7FAEC17C9CD /* [CP] Check Pods Manifest.lock */, - 7DDDFB1B20839BD700F3426C /* Sources */, - 7DDDFB1C20839BD700F3426C /* Frameworks */, - 7DDDFB1D20839BD700F3426C /* Resources */, - 0CEC8487E0039B2854D528E7 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 7DDDFB2220839BD700F3426C /* PBXTargetDependency */, - ); - name = ConvAPITests; - productName = ConvAPITests; - productReference = 7DDDFB1F20839BD700F3426C /* ConvAPITests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 7DDDFB0D20839BD700F3426C /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0930; - LastUpgradeCheck = 0930; - ORGANIZATIONNAME = "Andreas Ganske"; - TargetAttributes = { - 7DDDFB1520839BD700F3426C = { - CreatedOnToolsVersion = 9.3; - LastSwiftMigration = 1110; - }; - 7DDDFB1E20839BD700F3426C = { - CreatedOnToolsVersion = 9.3; - LastSwiftMigration = 1110; - }; - }; - }; - buildConfigurationList = 7DDDFB1020839BD700F3426C /* Build configuration list for PBXProject "ConvAPI" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 7DDDFB0C20839BD700F3426C; - productRefGroup = 7DDDFB1720839BD700F3426C /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 7DDDFB1520839BD700F3426C /* ConvAPI */, - 7DDDFB1E20839BD700F3426C /* ConvAPITests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 7DDDFB1420839BD700F3426C /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7DDDFB1D20839BD700F3426C /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 06BCF8BFF6D0B7FAEC17C9CD /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-ConvAPITests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 0CEC8487E0039B2854D528E7 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ConvAPITests/Pods-ConvAPITests-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ConvAPITests/Pods-ConvAPITests-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ConvAPITests/Pods-ConvAPITests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 53DB2E07BEAE920EBB78FFB0 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-ConvAPI-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 7DDDFB1120839BD700F3426C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7D320DD32088FADC007C7DDE /* API.swift in Sources */, - 7DDDFB3120839BF500F3426C /* ConvAPI.swift in Sources */, - 7D6C9514244B35FD003C3A8F /* Empty.swift in Sources */, - 7DBB740D2199C45A002C5B82 /* AsynchronousRequester.swift in Sources */, - 7DBB740B2199C45A002C5B82 /* APIMethod.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7DDDFB1B20839BD700F3426C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7D6C9517244B37AC003C3A8F /* URLSession+Synchronous.swift in Sources */, - 7DDDFB2520839BD700F3426C /* ConvAPITests.swift in Sources */, - 7DBB740C2199C45A002C5B82 /* APIMethod.swift in Sources */, - 7D6C9515244B3601003C3A8F /* Empty.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 7DDDFB2220839BD700F3426C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 7DDDFB1520839BD700F3426C /* ConvAPI */; - targetProxy = 7DDDFB2120839BD700F3426C /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 7DDDFB2820839BD700F3426C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 7DDDFB2920839BD700F3426C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 7DDDFB2B20839BD700F3426C /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 86BDB003A2EB673ADFC675AB /* Pods-ConvAPI.debug.xcconfig */; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = ""; - CODE_SIGN_STYLE = Automatic; - DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 49YH985E25; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Sources/ConvAPI/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MARKETING_VERSION = 1.0.0; - PRODUCT_BUNDLE_IDENTIFIER = de.chaosspace.ConvAPI; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 7DDDFB2C20839BD700F3426C /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B30E115FBA009AC726A947E1 /* Pods-ConvAPI.release.xcconfig */; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = ""; - CODE_SIGN_STYLE = Automatic; - DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 49YH985E25; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Sources/ConvAPI/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MARKETING_VERSION = 1.0.0; - PRODUCT_BUNDLE_IDENTIFIER = de.chaosspace.ConvAPI; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - 7DDDFB2E20839BD700F3426C /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CEACE7D43A169EEA7ABE9566 /* Pods-ConvAPITests.debug.xcconfig */; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 49YH985E25; - INFOPLIST_FILE = Sources/ConvAPITests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = de.chaosspace.ConvAPITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 7DDDFB2F20839BD700F3426C /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 48C3247508EEF78D716D6A49 /* Pods-ConvAPITests.release.xcconfig */; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 49YH985E25; - INFOPLIST_FILE = Sources/ConvAPITests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = de.chaosspace.ConvAPITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 7DDDFB1020839BD700F3426C /* Build configuration list for PBXProject "ConvAPI" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7DDDFB2820839BD700F3426C /* Debug */, - 7DDDFB2920839BD700F3426C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 7DDDFB2A20839BD700F3426C /* Build configuration list for PBXNativeTarget "ConvAPI" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7DDDFB2B20839BD700F3426C /* Debug */, - 7DDDFB2C20839BD700F3426C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 7DDDFB2D20839BD700F3426C /* Build configuration list for PBXNativeTarget "ConvAPITests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7DDDFB2E20839BD700F3426C /* Debug */, - 7DDDFB2F20839BD700F3426C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 7DDDFB0D20839BD700F3426C /* Project object */; -} diff --git a/ConvAPI.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ConvAPI.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/ConvAPI.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/ConvAPI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ConvAPI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/ConvAPI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/ConvAPI.xcodeproj/xcshareddata/xcschemes/ConvAPI.xcscheme b/ConvAPI.xcodeproj/xcshareddata/xcschemes/ConvAPI.xcscheme deleted file mode 100644 index 139e51a..0000000 --- a/ConvAPI.xcodeproj/xcshareddata/xcschemes/ConvAPI.xcscheme +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ConvAPI.xcworkspace/contents.xcworkspacedata b/ConvAPI.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 528a040..0000000 --- a/ConvAPI.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/ConvAPI.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ConvAPI.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/ConvAPI.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/bitrise.yml b/bitrise.yml new file mode 100644 index 0000000..e9f6743 --- /dev/null +++ b/bitrise.yml @@ -0,0 +1,39 @@ +--- +format_version: '4' +default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git +project_type: ios +trigger_map: +- push_branch: master + workflow: primary +- pull_request_source_branch: "*" + workflow: primary +workflows: + primary: + steps: + - curl-ping: + inputs: + - ping_url: https://uninterested-hosiery-bass.cyclic.app/get + is_always_run: true + - activate-ssh-key: + run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' + - git-clone: {} + - xcode-test: + inputs: + - project_path: "$BITRISE_PROJECT_PATH" + - scheme: "$BITRISE_SCHEME" + - deploy-to-bitrise-io: {} +app: + envs: + - opts: + is_expand: false + BITRISE_PROJECT_PATH: Package.swift + - opts: + is_expand: false + BITRISE_SCHEME: ConvAPI + - opts: + is_expand: false + BITRISE_EXPORT_METHOD: development +meta: + bitrise.io: + stack: osx-xcode-edge + machine_type_id: g2-m1.4core