From 2d570c37d4e297c5d8fc94769976a940c3f945e2 Mon Sep 17 00:00:00 2001 From: Tristan Himmelman Date: Fri, 8 Jul 2016 14:29:53 -0400 Subject: [PATCH 01/27] swift 3.0 support (Xcode 8 beta 2) --- .../project.pbxproj | 15 +++++- .../AlamofireObjectMapper OSX.xcscheme | 2 +- .../AlamofireObjectMapper iOS.xcscheme | 2 +- .../AlamofireObjectMapper tvOS.xcscheme | 2 +- .../AlamofireObjectMapper watchOS.xcscheme | 2 +- .../AlamofireObjectMapper.swift | 46 ++++++++--------- .../AlamofireObjectMapperTests.swift | 50 +++++++++---------- Cartfile | 4 +- Cartfile.resolved | 4 +- Carthage/Checkouts/Alamofire | 2 +- Carthage/Checkouts/ObjectMapper | 2 +- 11 files changed, 72 insertions(+), 59 deletions(-) diff --git a/AlamofireObjectMapper.xcodeproj/project.pbxproj b/AlamofireObjectMapper.xcodeproj/project.pbxproj index 0386421..50496bd 100644 --- a/AlamofireObjectMapper.xcodeproj/project.pbxproj +++ b/AlamofireObjectMapper.xcodeproj/project.pbxproj @@ -393,14 +393,16 @@ CLASSPREFIX = ""; LastSwiftMigration = 0700; LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0700; + LastUpgradeCheck = 0800; ORGANIZATIONNAME = "Tristan Himmelman"; TargetAttributes = { 6AB2A0101AF26C36001EBB20 = { CreatedOnToolsVersion = 6.3.1; + LastSwiftMigration = 0800; }; 6AB2A01B1AF26C36001EBB20 = { CreatedOnToolsVersion = 6.3.1; + LastSwiftMigration = 0800; }; 6AB2A0841AF27DF1001EBB20 = { CreatedOnToolsVersion = 6.3.1; @@ -672,6 +674,7 @@ PRODUCT_NAME = AlamofireObjectMapper; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -700,6 +703,8 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = AlamofireObjectMapper; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -722,6 +727,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -738,6 +744,8 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -797,6 +805,7 @@ PRODUCT_NAME = AlamofireObjectMapper; SDKROOT = macosx; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -842,6 +851,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; }; name = Release; }; @@ -896,6 +906,7 @@ PRODUCT_NAME = AlamofireObjectMapper; SDKROOT = watchos; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = 4; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; @@ -951,6 +962,7 @@ PRODUCT_NAME = AlamofireObjectMapper; SDKROOT = appletvos; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; @@ -978,6 +990,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; diff --git a/AlamofireObjectMapper.xcodeproj/xcshareddata/xcschemes/AlamofireObjectMapper OSX.xcscheme b/AlamofireObjectMapper.xcodeproj/xcshareddata/xcschemes/AlamofireObjectMapper OSX.xcscheme index 8730d53..93372c6 100644 --- a/AlamofireObjectMapper.xcodeproj/xcshareddata/xcschemes/AlamofireObjectMapper OSX.xcscheme +++ b/AlamofireObjectMapper.xcodeproj/xcshareddata/xcschemes/AlamofireObjectMapper OSX.xcscheme @@ -1,6 +1,6 @@ NSError { + internal static func newError(_ code: Error.Code, failureReason: String) -> NSError { let errorDomain = "com.alamofireobjectmapper.error" let userInfo = [NSLocalizedFailureReasonErrorKey: failureReason] @@ -41,38 +41,38 @@ extension Request { return returnError } - public static func ObjectMapperSerializer(keyPath: String?, mapToObject object: T? = nil, context: MapContext? = nil) -> ResponseSerializer { + public static func ObjectMapperSerializer(_ keyPath: String?, mapToObject object: T? = nil, context: MapContext? = nil) -> ResponseSerializer { return ResponseSerializer { request, response, data, error in guard error == nil else { - return .Failure(error!) + return .failure(error!) } guard let _ = data else { let failureReason = "Data could not be serialized. Input data was nil." - let error = newError(.DataSerializationFailed, failureReason: failureReason) - return .Failure(error) + let error = newError(.dataSerializationFailed, failureReason: failureReason) + return .failure(error) } - let JSONResponseSerializer = Request.JSONResponseSerializer(options: .AllowFragments) + let JSONResponseSerializer = Request.JSONResponseSerializer(options: .allowFragments) let result = JSONResponseSerializer.serializeResponse(request, response, data, error) let JSONToMap: AnyObject? if let keyPath = keyPath where keyPath.isEmpty == false { - JSONToMap = result.value?.valueForKeyPath(keyPath) + JSONToMap = result.value?.value(forKeyPath: keyPath) } else { JSONToMap = result.value } if let object = object { - Mapper().map(JSONToMap, toObject: object) - return .Success(object) + _ = Mapper().map(JSONToMap, toObject: object) + return .success(object) } else if let parsedObject = Mapper(context: context).map(JSONToMap){ - return .Success(parsedObject) + return .success(parsedObject) } let failureReason = "ObjectMapper failed to serialize response." - let error = newError(.DataSerializationFailed, failureReason: failureReason) - return .Failure(error) + let error = newError(.dataSerializationFailed, failureReason: failureReason) + return .failure(error) } } @@ -87,39 +87,39 @@ extension Request { - returns: The request. */ - public func responseObject(queue queue: dispatch_queue_t? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil, completionHandler: Response -> Void) -> Self { + public func responseObject(queue: DispatchQueue? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil, completionHandler: (Response) -> Void) -> Self { return response(queue: queue, responseSerializer: Request.ObjectMapperSerializer(keyPath, mapToObject: object, context: context), completionHandler: completionHandler) } - public static func ObjectMapperArraySerializer(keyPath: String?, context: MapContext? = nil) -> ResponseSerializer<[T], NSError> { + public static func ObjectMapperArraySerializer(_ keyPath: String?, context: MapContext? = nil) -> ResponseSerializer<[T], NSError> { return ResponseSerializer { request, response, data, error in guard error == nil else { - return .Failure(error!) + return .failure(error!) } guard let _ = data else { let failureReason = "Data could not be serialized. Input data was nil." - let error = newError(.DataSerializationFailed, failureReason: failureReason) - return .Failure(error) + let error = newError(.dataSerializationFailed, failureReason: failureReason) + return .failure(error) } - let JSONResponseSerializer = Request.JSONResponseSerializer(options: .AllowFragments) + let JSONResponseSerializer = Request.JSONResponseSerializer(options: .allowFragments) let result = JSONResponseSerializer.serializeResponse(request, response, data, error) let JSONToMap: AnyObject? if let keyPath = keyPath where keyPath.isEmpty == false { - JSONToMap = result.value?.valueForKeyPath(keyPath) + JSONToMap = result.value?.value(forKeyPath: keyPath) } else { JSONToMap = result.value } if let parsedObject = Mapper(context: context).mapArray(JSONToMap){ - return .Success(parsedObject) + return .success(parsedObject) } let failureReason = "ObjectMapper failed to serialize response." - let error = newError(.DataSerializationFailed, failureReason: failureReason) - return .Failure(error) + let error = newError(.dataSerializationFailed, failureReason: failureReason) + return .failure(error) } } @@ -132,7 +132,7 @@ extension Request { - returns: The request. */ - public func responseArray(queue queue: dispatch_queue_t? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: Response<[T], NSError> -> Void) -> Self { + public func responseArray(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: (Response<[T], NSError>) -> Void) -> Self { return response(queue: queue, responseSerializer: Request.ObjectMapperArraySerializer(keyPath, context: context), completionHandler: completionHandler) } } diff --git a/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift b/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift index 435e236..d51a443 100644 --- a/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift +++ b/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift @@ -47,9 +47,9 @@ class AlamofireObjectMapperTests: XCTestCase { func testResponseObject() { // This is an example of a functional test case. let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/d8bb95982be8a11a2308e779bb9a9707ebe42ede/sample_json" - let expectation = expectationWithDescription("\(URL)") + let expectation = self.expectation(withDescription: "\(URL)") - Alamofire.request(.GET, URL).responseObject { (response: Response) in + _ = Alamofire.request(.GET, URL).responseObject { (response: Response) in expectation.fulfill() let mappedObject = response.result.value @@ -65,7 +65,7 @@ class AlamofireObjectMapperTests: XCTestCase { } } - waitForExpectationsWithTimeout(10) { (error: NSError?) -> Void in + waitForExpectations(withTimeout: 10) { (error: NSError?) -> Void in XCTAssertNil(error, "\(error)") } } @@ -73,12 +73,12 @@ class AlamofireObjectMapperTests: XCTestCase { func testResponseObjectMapToObject() { // This is an example of a functional test case. let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/d8bb95982be8a11a2308e779bb9a9707ebe42ede/sample_json" - let expectation = expectationWithDescription("\(URL)") + let expectation = self.expectation(withDescription: "\(URL)") let weatherResponse = WeatherResponse() - weatherResponse.date = NSDate() + weatherResponse.date = Date() - Alamofire.request(.GET, URL).responseObject(mapToObject: weatherResponse) { (response: Response) in + _ = Alamofire.request(.GET, URL).responseObject(mapToObject: weatherResponse) { (response: Response) in expectation.fulfill() let mappedObject = response.result.value @@ -95,7 +95,7 @@ class AlamofireObjectMapperTests: XCTestCase { } } - waitForExpectationsWithTimeout(10) { (error: NSError?) -> Void in + waitForExpectations(withTimeout: 10) { (error: NSError?) -> Void in XCTAssertNil(error, "\(error)") } } @@ -103,9 +103,9 @@ class AlamofireObjectMapperTests: XCTestCase { func testResponseObjectWithKeyPath() { // This is an example of a functional test case. let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/2ee8f34d21e8febfdefb2b3a403f18a43818d70a/sample_keypath_json" - let expectation = expectationWithDescription("\(URL)") + let expectation = self.expectation(withDescription: "\(URL)") - Alamofire.request(.GET, URL).responseObject(keyPath: "data") { (response: Response) in + _ = Alamofire.request(.GET, URL).responseObject(keyPath: "data") { (response: Response) in expectation.fulfill() let mappedObject = response.result.value @@ -121,7 +121,7 @@ class AlamofireObjectMapperTests: XCTestCase { } } - waitForExpectationsWithTimeout(10) { (error: NSError?) -> Void in + waitForExpectations(withTimeout: 10) { (error: NSError?) -> Void in XCTAssertNil(error, "\(error)") } } @@ -129,9 +129,9 @@ class AlamofireObjectMapperTests: XCTestCase { func testResponseObjectWithNestedKeyPath() { // This is an example of a functional test case. let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/97231a04e6e4970612efcc0b7e0c125a83e3de6e/sample_keypath_json" - let expectation = expectationWithDescription("\(URL)") + let expectation = self.expectation(withDescription: "\(URL)") - Alamofire.request(.GET, URL).responseObject(keyPath: "response.data") { (response: Response) in + _ = Alamofire.request(.GET, URL).responseObject(keyPath: "response.data") { (response: Response) in expectation.fulfill() let mappedObject = response.result.value @@ -147,7 +147,7 @@ class AlamofireObjectMapperTests: XCTestCase { } } - waitForExpectationsWithTimeout(10) { (error: NSError?) -> Void in + waitForExpectations(withTimeout: 10) { (error: NSError?) -> Void in XCTAssertNil(error, "\(error)") } } @@ -155,9 +155,9 @@ class AlamofireObjectMapperTests: XCTestCase { func testResponseArray() { // This is an example of a functional test case. let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/f583be1121dbc5e9b0381b3017718a70c31054f7/sample_array_json" - let expectation = expectationWithDescription("\(URL)") + let expectation = self.expectation(withDescription: "\(URL)") - Alamofire.request(.GET, URL).responseArray { (response: Response<[Forecast], NSError>) in + _ = Alamofire.request(.GET, URL).responseArray { (response: Response<[Forecast], NSError>) in expectation.fulfill() let mappedArray = response.result.value @@ -171,7 +171,7 @@ class AlamofireObjectMapperTests: XCTestCase { } } - waitForExpectationsWithTimeout(10) { (error: NSError?) -> Void in + waitForExpectations(withTimeout: 10) { (error: NSError?) -> Void in XCTAssertNil(error, "\(error)") } } @@ -179,9 +179,9 @@ class AlamofireObjectMapperTests: XCTestCase { func testArrayResponseArrayWithKeyPath() { // This is an example of a functional test case. let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/d8bb95982be8a11a2308e779bb9a9707ebe42ede/sample_json" - let expectation = expectationWithDescription("\(URL)") + let expectation = self.expectation(withDescription: "\(URL)") - Alamofire.request(.GET, URL).responseArray(keyPath: "three_day_forecast") { (response: Response<[Forecast], NSError>) in + _ = Alamofire.request(.GET, URL).responseArray(keyPath: "three_day_forecast") { (response: Response<[Forecast], NSError>) in expectation.fulfill() @@ -196,7 +196,7 @@ class AlamofireObjectMapperTests: XCTestCase { } } - waitForExpectationsWithTimeout(10) { (error: NSError?) -> Void in + waitForExpectations(withTimeout: 10) { (error: NSError?) -> Void in XCTAssertNil(error, "\(error)") } } @@ -204,9 +204,9 @@ class AlamofireObjectMapperTests: XCTestCase { func testArrayResponseArrayWithNestedKeyPath() { // This is an example of a functional test case. let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/97231a04e6e4970612efcc0b7e0c125a83e3de6e/sample_keypath_json" - let expectation = expectationWithDescription("\(URL)") + let expectation = self.expectation(withDescription: "\(URL)") - Alamofire.request(.GET, URL).responseArray(keyPath: "response.data.three_day_forecast") { (response: Response<[Forecast], NSError>) in + _ = Alamofire.request(.GET, URL).responseArray(keyPath: "response.data.three_day_forecast") { (response: Response<[Forecast], NSError>) in expectation.fulfill() @@ -221,7 +221,7 @@ class AlamofireObjectMapperTests: XCTestCase { } } - waitForExpectationsWithTimeout(10) { (error: NSError?) -> Void in + waitForExpectations(withTimeout: 10) { (error: NSError?) -> Void in XCTAssertNil(error, "\(error)") } } @@ -230,7 +230,7 @@ class AlamofireObjectMapperTests: XCTestCase { class WeatherResponse: Mappable { var location: String? var threeDayForecast: [Forecast]? - var date: NSDate? + var date: Date? init(){} @@ -238,7 +238,7 @@ class WeatherResponse: Mappable { } - func mapping(map: Map) { + func mapping(_ map: Map) { location <- map["location"] threeDayForecast <- map["three_day_forecast"] } @@ -253,7 +253,7 @@ class Forecast: Mappable { } - func mapping(map: Map) { + func mapping(_ map: Map) { day <- map["day"] temperature <- map["temperature"] conditions <- map["conditions"] diff --git a/Cartfile b/Cartfile index 5aff952..9e70bba 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ -github "Alamofire/Alamofire" ~> 3.0.0 -github "Hearst-DD/ObjectMapper" ~> 1.3.0 +github "Alamofire/Alamofire" "swift3" +github "Hearst-DD/ObjectMapper" "swift-3" diff --git a/Cartfile.resolved b/Cartfile.resolved index 3669a05..df53632 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "Alamofire/Alamofire" "3.4.0" -github "Hearst-DD/ObjectMapper" "1.3.0" +github "Alamofire/Alamofire" "fcb4829a78d28e3491c6767cfb74e774871943b0" +github "Hearst-DD/ObjectMapper" "a8ba5a6b4d87ab6d57571ea7a01c6439ecfa09b2" diff --git a/Carthage/Checkouts/Alamofire b/Carthage/Checkouts/Alamofire index d2f1f7c..fcb4829 160000 --- a/Carthage/Checkouts/Alamofire +++ b/Carthage/Checkouts/Alamofire @@ -1 +1 @@ -Subproject commit d2f1f7c0fccec61ef5b85bada8661236e671082e +Subproject commit fcb4829a78d28e3491c6767cfb74e774871943b0 diff --git a/Carthage/Checkouts/ObjectMapper b/Carthage/Checkouts/ObjectMapper index cf7c4ba..a8ba5a6 160000 --- a/Carthage/Checkouts/ObjectMapper +++ b/Carthage/Checkouts/ObjectMapper @@ -1 +1 @@ -Subproject commit cf7c4ba9e206531176104e06c24449c48823e136 +Subproject commit a8ba5a6b4d87ab6d57571ea7a01c6439ecfa09b2 From 72a8e7f7194b2ae16f857dc9dc9cb8ac0cb70803 Mon Sep 17 00:00:00 2001 From: Amol Gupta Date: Fri, 5 Aug 2016 18:35:08 +0530 Subject: [PATCH 02/27] Error.Code to ErrorCode enum --- AlamofireObjectMapper/AlamofireObjectMapper.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AlamofireObjectMapper/AlamofireObjectMapper.swift b/AlamofireObjectMapper/AlamofireObjectMapper.swift index a8f75f3..b18b7a9 100644 --- a/AlamofireObjectMapper/AlamofireObjectMapper.swift +++ b/AlamofireObjectMapper/AlamofireObjectMapper.swift @@ -32,7 +32,7 @@ import ObjectMapper extension Request { - internal static func newError(_ code: Error.Code, failureReason: String) -> NSError { + internal static func newError(_ code: ErrorCode, failureReason: String) -> NSError { let errorDomain = "com.alamofireobjectmapper.error" let userInfo = [NSLocalizedFailureReasonErrorKey: failureReason] @@ -64,7 +64,7 @@ extension Request { } if let object = object { - _ = Mapper().map(JSONToMap, toObject: object) + Mapper().map(JSONToMap, toObject: object) return .success(object) } else if let parsedObject = Mapper(context: context).map(JSONToMap){ return .success(parsedObject) From 892ccdb8db750e221aba18e4ef2540086cd68ae3 Mon Sep 17 00:00:00 2001 From: Tristan Himmelman Date: Fri, 5 Aug 2016 17:01:06 -0400 Subject: [PATCH 03/27] updates to test for swift 3 --- .../project.pbxproj | 8 +++--- .../AlamofireObjectMapper.swift | 6 ++-- .../AlamofireObjectMapperTests.swift | 28 +++++++++---------- Cartfile.resolved | 4 +-- Carthage/Checkouts/Alamofire | 2 +- Carthage/Checkouts/ObjectMapper | 2 +- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/AlamofireObjectMapper.xcodeproj/project.pbxproj b/AlamofireObjectMapper.xcodeproj/project.pbxproj index 50496bd..96844f1 100644 --- a/AlamofireObjectMapper.xcodeproj/project.pbxproj +++ b/AlamofireObjectMapper.xcodeproj/project.pbxproj @@ -598,7 +598,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -640,7 +640,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -668,7 +668,7 @@ ); INFOPLIST_FILE = AlamofireObjectMapper/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = AlamofireObjectMapper; @@ -698,7 +698,7 @@ ); INFOPLIST_FILE = AlamofireObjectMapper/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = AlamofireObjectMapper; diff --git a/AlamofireObjectMapper/AlamofireObjectMapper.swift b/AlamofireObjectMapper/AlamofireObjectMapper.swift index b18b7a9..5ff61b8 100644 --- a/AlamofireObjectMapper/AlamofireObjectMapper.swift +++ b/AlamofireObjectMapper/AlamofireObjectMapper.swift @@ -57,14 +57,14 @@ extension Request { let result = JSONResponseSerializer.serializeResponse(request, response, data, error) let JSONToMap: AnyObject? - if let keyPath = keyPath where keyPath.isEmpty == false { + if let keyPath = keyPath , keyPath.isEmpty == false { JSONToMap = result.value?.value(forKeyPath: keyPath) } else { JSONToMap = result.value } if let object = object { - Mapper().map(JSONToMap, toObject: object) + _ = Mapper().map(JSONToMap, toObject: object) return .success(object) } else if let parsedObject = Mapper(context: context).map(JSONToMap){ return .success(parsedObject) @@ -107,7 +107,7 @@ extension Request { let result = JSONResponseSerializer.serializeResponse(request, response, data, error) let JSONToMap: AnyObject? - if let keyPath = keyPath where keyPath.isEmpty == false { + if let keyPath = keyPath, keyPath.isEmpty == false { JSONToMap = result.value?.value(forKeyPath: keyPath) } else { JSONToMap = result.value diff --git a/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift b/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift index d51a443..4acddbb 100644 --- a/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift +++ b/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift @@ -47,7 +47,7 @@ class AlamofireObjectMapperTests: XCTestCase { func testResponseObject() { // This is an example of a functional test case. let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/d8bb95982be8a11a2308e779bb9a9707ebe42ede/sample_json" - let expectation = self.expectation(withDescription: "\(URL)") + let expectation = self.expectation(description: "\(URL)") _ = Alamofire.request(.GET, URL).responseObject { (response: Response) in expectation.fulfill() @@ -65,7 +65,7 @@ class AlamofireObjectMapperTests: XCTestCase { } } - waitForExpectations(withTimeout: 10) { (error: NSError?) -> Void in + waitForExpectations(timeout: 10) { error in XCTAssertNil(error, "\(error)") } } @@ -73,7 +73,7 @@ class AlamofireObjectMapperTests: XCTestCase { func testResponseObjectMapToObject() { // This is an example of a functional test case. let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/d8bb95982be8a11a2308e779bb9a9707ebe42ede/sample_json" - let expectation = self.expectation(withDescription: "\(URL)") + let expectation = self.expectation(description: "\(URL)") let weatherResponse = WeatherResponse() weatherResponse.date = Date() @@ -95,7 +95,7 @@ class AlamofireObjectMapperTests: XCTestCase { } } - waitForExpectations(withTimeout: 10) { (error: NSError?) -> Void in + waitForExpectations(timeout: 10) { error in XCTAssertNil(error, "\(error)") } } @@ -103,7 +103,7 @@ class AlamofireObjectMapperTests: XCTestCase { func testResponseObjectWithKeyPath() { // This is an example of a functional test case. let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/2ee8f34d21e8febfdefb2b3a403f18a43818d70a/sample_keypath_json" - let expectation = self.expectation(withDescription: "\(URL)") + let expectation = self.expectation(description: "\(URL)") _ = Alamofire.request(.GET, URL).responseObject(keyPath: "data") { (response: Response) in expectation.fulfill() @@ -121,7 +121,7 @@ class AlamofireObjectMapperTests: XCTestCase { } } - waitForExpectations(withTimeout: 10) { (error: NSError?) -> Void in + waitForExpectations(timeout: 10) { error in XCTAssertNil(error, "\(error)") } } @@ -129,7 +129,7 @@ class AlamofireObjectMapperTests: XCTestCase { func testResponseObjectWithNestedKeyPath() { // This is an example of a functional test case. let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/97231a04e6e4970612efcc0b7e0c125a83e3de6e/sample_keypath_json" - let expectation = self.expectation(withDescription: "\(URL)") + let expectation = self.expectation(description: "\(URL)") _ = Alamofire.request(.GET, URL).responseObject(keyPath: "response.data") { (response: Response) in expectation.fulfill() @@ -147,7 +147,7 @@ class AlamofireObjectMapperTests: XCTestCase { } } - waitForExpectations(withTimeout: 10) { (error: NSError?) -> Void in + waitForExpectations(timeout: 10) { error in XCTAssertNil(error, "\(error)") } } @@ -155,7 +155,7 @@ class AlamofireObjectMapperTests: XCTestCase { func testResponseArray() { // This is an example of a functional test case. let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/f583be1121dbc5e9b0381b3017718a70c31054f7/sample_array_json" - let expectation = self.expectation(withDescription: "\(URL)") + let expectation = self.expectation(description: "\(URL)") _ = Alamofire.request(.GET, URL).responseArray { (response: Response<[Forecast], NSError>) in expectation.fulfill() @@ -171,7 +171,7 @@ class AlamofireObjectMapperTests: XCTestCase { } } - waitForExpectations(withTimeout: 10) { (error: NSError?) -> Void in + waitForExpectations(timeout: 10) { error in XCTAssertNil(error, "\(error)") } } @@ -179,7 +179,7 @@ class AlamofireObjectMapperTests: XCTestCase { func testArrayResponseArrayWithKeyPath() { // This is an example of a functional test case. let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/d8bb95982be8a11a2308e779bb9a9707ebe42ede/sample_json" - let expectation = self.expectation(withDescription: "\(URL)") + let expectation = self.expectation(description: "\(URL)") _ = Alamofire.request(.GET, URL).responseArray(keyPath: "three_day_forecast") { (response: Response<[Forecast], NSError>) in @@ -196,7 +196,7 @@ class AlamofireObjectMapperTests: XCTestCase { } } - waitForExpectations(withTimeout: 10) { (error: NSError?) -> Void in + waitForExpectations(timeout: 10) { error in XCTAssertNil(error, "\(error)") } } @@ -204,7 +204,7 @@ class AlamofireObjectMapperTests: XCTestCase { func testArrayResponseArrayWithNestedKeyPath() { // This is an example of a functional test case. let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/97231a04e6e4970612efcc0b7e0c125a83e3de6e/sample_keypath_json" - let expectation = self.expectation(withDescription: "\(URL)") + let expectation = self.expectation(description: "\(URL)") _ = Alamofire.request(.GET, URL).responseArray(keyPath: "response.data.three_day_forecast") { (response: Response<[Forecast], NSError>) in @@ -221,7 +221,7 @@ class AlamofireObjectMapperTests: XCTestCase { } } - waitForExpectations(withTimeout: 10) { (error: NSError?) -> Void in + waitForExpectations(timeout: 10) { error in XCTAssertNil(error, "\(error)") } } diff --git a/Cartfile.resolved b/Cartfile.resolved index df53632..cbb1989 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "Alamofire/Alamofire" "fcb4829a78d28e3491c6767cfb74e774871943b0" -github "Hearst-DD/ObjectMapper" "a8ba5a6b4d87ab6d57571ea7a01c6439ecfa09b2" +github "Alamofire/Alamofire" "a94323c6e556d47408b6186c948324b040d7ffc8" +github "Hearst-DD/ObjectMapper" "ad3f7ef42b072190dc3b0e15beab0816afd983fd" diff --git a/Carthage/Checkouts/Alamofire b/Carthage/Checkouts/Alamofire index fcb4829..a94323c 160000 --- a/Carthage/Checkouts/Alamofire +++ b/Carthage/Checkouts/Alamofire @@ -1 +1 @@ -Subproject commit fcb4829a78d28e3491c6767cfb74e774871943b0 +Subproject commit a94323c6e556d47408b6186c948324b040d7ffc8 diff --git a/Carthage/Checkouts/ObjectMapper b/Carthage/Checkouts/ObjectMapper index a8ba5a6..ad3f7ef 160000 --- a/Carthage/Checkouts/ObjectMapper +++ b/Carthage/Checkouts/ObjectMapper @@ -1 +1 @@ -Subproject commit a8ba5a6b4d87ab6d57571ea7a01c6439ecfa09b2 +Subproject commit ad3f7ef42b072190dc3b0e15beab0816afd983fd From 51216ac75deb8fb65d2cd544b61257db2a49ecfe Mon Sep 17 00:00:00 2001 From: Eugene Tulusha Date: Mon, 22 Aug 2016 23:18:02 +0300 Subject: [PATCH 04/27] Fix @escaping completionHandler for Swift 3, Xcode 8 beta 6 --- AlamofireObjectMapper/AlamofireObjectMapper.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AlamofireObjectMapper/AlamofireObjectMapper.swift b/AlamofireObjectMapper/AlamofireObjectMapper.swift index 5ff61b8..c5d51ae 100644 --- a/AlamofireObjectMapper/AlamofireObjectMapper.swift +++ b/AlamofireObjectMapper/AlamofireObjectMapper.swift @@ -87,7 +87,7 @@ extension Request { - returns: The request. */ - public func responseObject(queue: DispatchQueue? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil, completionHandler: (Response) -> Void) -> Self { + public func responseObject(queue: DispatchQueue? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil, completionHandler: @escaping (Response) -> Void) -> Self { return response(queue: queue, responseSerializer: Request.ObjectMapperSerializer(keyPath, mapToObject: object, context: context), completionHandler: completionHandler) } @@ -132,7 +132,7 @@ extension Request { - returns: The request. */ - public func responseArray(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: (Response<[T], NSError>) -> Void) -> Self { + public func responseArray(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: @escaping (Response<[T], NSError>) -> Void) -> Self { return response(queue: queue, responseSerializer: Request.ObjectMapperArraySerializer(keyPath, context: context), completionHandler: completionHandler) } } From 7dd5a7ee1658fa5ace7b03d3cd1a43008d15e869 Mon Sep 17 00:00:00 2001 From: Eugene Tulusha Date: Mon, 22 Aug 2016 23:56:47 +0300 Subject: [PATCH 05/27] Fix type casting --- AlamofireObjectMapper/AlamofireObjectMapper.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/AlamofireObjectMapper/AlamofireObjectMapper.swift b/AlamofireObjectMapper/AlamofireObjectMapper.swift index c5d51ae..2838faa 100644 --- a/AlamofireObjectMapper/AlamofireObjectMapper.swift +++ b/AlamofireObjectMapper/AlamofireObjectMapper.swift @@ -58,7 +58,9 @@ extension Request { let JSONToMap: AnyObject? if let keyPath = keyPath , keyPath.isEmpty == false { - JSONToMap = result.value?.value(forKeyPath: keyPath) + JSONToMap = result.value.map({ + $0 as AnyObject + })?.value(forKeyPath: keyPath) } else { JSONToMap = result.value } @@ -108,7 +110,9 @@ extension Request { let JSONToMap: AnyObject? if let keyPath = keyPath, keyPath.isEmpty == false { - JSONToMap = result.value?.value(forKeyPath: keyPath) + JSONToMap = result.value.map({ + $0 as AnyObject + })?.value(forKeyPath: keyPath) } else { JSONToMap = result.value } From 2277454f6662787eeb2ffe055706e46d6c35ca12 Mon Sep 17 00:00:00 2001 From: Eugene Tulusha Date: Tue, 23 Aug 2016 20:00:49 +0300 Subject: [PATCH 06/27] Fix travis build --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7cd1d8b..1d5690c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode7.3 +osx_image: xcode8 env: global: From f31cf8697df3b95551b8612d4c4a6be56b71bc3f Mon Sep 17 00:00:00 2001 From: Tristan Himmelman Date: Thu, 25 Aug 2016 10:16:23 -0400 Subject: [PATCH 07/27] Revert "Fix @escaping completionHandler for Swift 3, Xcode 8 beta 6" --- .travis.yml | 2 +- AlamofireObjectMapper/AlamofireObjectMapper.swift | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1d5690c..7cd1d8b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode8 +osx_image: xcode7.3 env: global: diff --git a/AlamofireObjectMapper/AlamofireObjectMapper.swift b/AlamofireObjectMapper/AlamofireObjectMapper.swift index 2838faa..5ff61b8 100644 --- a/AlamofireObjectMapper/AlamofireObjectMapper.swift +++ b/AlamofireObjectMapper/AlamofireObjectMapper.swift @@ -58,9 +58,7 @@ extension Request { let JSONToMap: AnyObject? if let keyPath = keyPath , keyPath.isEmpty == false { - JSONToMap = result.value.map({ - $0 as AnyObject - })?.value(forKeyPath: keyPath) + JSONToMap = result.value?.value(forKeyPath: keyPath) } else { JSONToMap = result.value } @@ -89,7 +87,7 @@ extension Request { - returns: The request. */ - public func responseObject(queue: DispatchQueue? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil, completionHandler: @escaping (Response) -> Void) -> Self { + public func responseObject(queue: DispatchQueue? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil, completionHandler: (Response) -> Void) -> Self { return response(queue: queue, responseSerializer: Request.ObjectMapperSerializer(keyPath, mapToObject: object, context: context), completionHandler: completionHandler) } @@ -110,9 +108,7 @@ extension Request { let JSONToMap: AnyObject? if let keyPath = keyPath, keyPath.isEmpty == false { - JSONToMap = result.value.map({ - $0 as AnyObject - })?.value(forKeyPath: keyPath) + JSONToMap = result.value?.value(forKeyPath: keyPath) } else { JSONToMap = result.value } @@ -136,7 +132,7 @@ extension Request { - returns: The request. */ - public func responseArray(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: @escaping (Response<[T], NSError>) -> Void) -> Self { + public func responseArray(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: (Response<[T], NSError>) -> Void) -> Self { return response(queue: queue, responseSerializer: Request.ObjectMapperArraySerializer(keyPath, context: context), completionHandler: completionHandler) } } From e9ee598c5277c0577e910ea1a7d5977c8378ea23 Mon Sep 17 00:00:00 2001 From: Brad Bergeron Date: Tue, 23 Aug 2016 17:20:42 -0700 Subject: [PATCH 08/27] Update for Xcode 8b6 --- AlamofireObjectMapper.xcodeproj/project.pbxproj | 10 ++++++++-- AlamofireObjectMapper/AlamofireObjectMapper.swift | 12 ++++++------ Cartfile.resolved | 4 ++-- Carthage/Checkouts/Alamofire | 2 +- Carthage/Checkouts/ObjectMapper | 2 +- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/AlamofireObjectMapper.xcodeproj/project.pbxproj b/AlamofireObjectMapper.xcodeproj/project.pbxproj index 96844f1..1c995e3 100644 --- a/AlamofireObjectMapper.xcodeproj/project.pbxproj +++ b/AlamofireObjectMapper.xcodeproj/project.pbxproj @@ -772,11 +772,12 @@ INFOPLIST_FILE = AlamofireObjectMapper/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = AlamofireObjectMapper; SDKROOT = macosx; SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -800,12 +801,13 @@ INFOPLIST_FILE = AlamofireObjectMapper/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = AlamofireObjectMapper; SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -878,6 +880,7 @@ PRODUCT_NAME = AlamofireObjectMapper; SDKROOT = watchos; SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 4; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; @@ -907,6 +910,7 @@ SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 4; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; @@ -935,6 +939,7 @@ PRODUCT_NAME = AlamofireObjectMapper; SDKROOT = appletvos; SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; @@ -963,6 +968,7 @@ SDKROOT = appletvos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; diff --git a/AlamofireObjectMapper/AlamofireObjectMapper.swift b/AlamofireObjectMapper/AlamofireObjectMapper.swift index 5ff61b8..9a3c5fa 100644 --- a/AlamofireObjectMapper/AlamofireObjectMapper.swift +++ b/AlamofireObjectMapper/AlamofireObjectMapper.swift @@ -56,9 +56,9 @@ extension Request { let JSONResponseSerializer = Request.JSONResponseSerializer(options: .allowFragments) let result = JSONResponseSerializer.serializeResponse(request, response, data, error) - let JSONToMap: AnyObject? + let JSONToMap: Any? if let keyPath = keyPath , keyPath.isEmpty == false { - JSONToMap = result.value?.value(forKeyPath: keyPath) + JSONToMap = (result.value as AnyObject?)?.value(forKeyPath: keyPath) } else { JSONToMap = result.value } @@ -87,7 +87,7 @@ extension Request { - returns: The request. */ - public func responseObject(queue: DispatchQueue? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil, completionHandler: (Response) -> Void) -> Self { + public func responseObject(queue: DispatchQueue? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil, completionHandler: @escaping (Response) -> Void) -> Self { return response(queue: queue, responseSerializer: Request.ObjectMapperSerializer(keyPath, mapToObject: object, context: context), completionHandler: completionHandler) } @@ -106,9 +106,9 @@ extension Request { let JSONResponseSerializer = Request.JSONResponseSerializer(options: .allowFragments) let result = JSONResponseSerializer.serializeResponse(request, response, data, error) - let JSONToMap: AnyObject? + let JSONToMap: Any? if let keyPath = keyPath, keyPath.isEmpty == false { - JSONToMap = result.value?.value(forKeyPath: keyPath) + JSONToMap = (result.value as AnyObject?)?.value(forKeyPath: keyPath) } else { JSONToMap = result.value } @@ -132,7 +132,7 @@ extension Request { - returns: The request. */ - public func responseArray(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: (Response<[T], NSError>) -> Void) -> Self { + public func responseArray(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: @escaping (Response<[T], NSError>) -> Void) -> Self { return response(queue: queue, responseSerializer: Request.ObjectMapperArraySerializer(keyPath, context: context), completionHandler: completionHandler) } } diff --git a/Cartfile.resolved b/Cartfile.resolved index cbb1989..989f31a 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "Alamofire/Alamofire" "a94323c6e556d47408b6186c948324b040d7ffc8" -github "Hearst-DD/ObjectMapper" "ad3f7ef42b072190dc3b0e15beab0816afd983fd" +github "Alamofire/Alamofire" "3cc5b4e8453bec9fd6b973d60e6b0605a38e4cf4" +github "Hearst-DD/ObjectMapper" "c4affdd91d2049d98109f197e56a814e2773852f" diff --git a/Carthage/Checkouts/Alamofire b/Carthage/Checkouts/Alamofire index a94323c..3cc5b4e 160000 --- a/Carthage/Checkouts/Alamofire +++ b/Carthage/Checkouts/Alamofire @@ -1 +1 @@ -Subproject commit a94323c6e556d47408b6186c948324b040d7ffc8 +Subproject commit 3cc5b4e8453bec9fd6b973d60e6b0605a38e4cf4 diff --git a/Carthage/Checkouts/ObjectMapper b/Carthage/Checkouts/ObjectMapper index ad3f7ef..c4affdd 160000 --- a/Carthage/Checkouts/ObjectMapper +++ b/Carthage/Checkouts/ObjectMapper @@ -1 +1 @@ -Subproject commit ad3f7ef42b072190dc3b0e15beab0816afd983fd +Subproject commit c4affdd91d2049d98109f197e56a814e2773852f From 50a77b9168a98fc23e32bf18d3176e2cf360c8a7 Mon Sep 17 00:00:00 2001 From: Bradley David Bergeron Date: Wed, 24 Aug 2016 11:28:59 -0700 Subject: [PATCH 09/27] Fix framework references for tvOS; add missing SWIFT_VERSION flag --- .../project.pbxproj | 56 +++++++++---------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/AlamofireObjectMapper.xcodeproj/project.pbxproj b/AlamofireObjectMapper.xcodeproj/project.pbxproj index 1c995e3..8d4060a 100644 --- a/AlamofireObjectMapper.xcodeproj/project.pbxproj +++ b/AlamofireObjectMapper.xcodeproj/project.pbxproj @@ -18,8 +18,6 @@ 6AC6921D1BE3F857004C119A /* AlamofireObjectMapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AB2A0231AF26C36001EBB20 /* AlamofireObjectMapperTests.swift */; }; 6AC6921E1BE3F96B004C119A /* AlamofireObjectMapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 6AB2A0161AF26C36001EBB20 /* AlamofireObjectMapper.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6AC692231BE3F9AE004C119A /* AlamofireObjectMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AB2A02D1AF2746D001EBB20 /* AlamofireObjectMapper.swift */; }; - 6AC6924A1BE3FEA4004C119A /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6AC692481BE3FEA4004C119A /* Alamofire.framework */; }; - 6AC6924B1BE3FEA4004C119A /* ObjectMapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6AC692491BE3FEA4004C119A /* ObjectMapper.framework */; }; 6AC6924C1BE7BC47004C119A /* AlamofireObjectMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AB2A02D1AF2746D001EBB20 /* AlamofireObjectMapper.swift */; }; 6AC787651BA86CA3007BBD2B /* AlamofireObjectMapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 6AB2A0161AF26C36001EBB20 /* AlamofireObjectMapper.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6AC787661BA871C4007BBD2B /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A905E3A1B067CAC00884083 /* Alamofire.framework */; }; @@ -29,6 +27,8 @@ 6AC787701BA87286007BBD2B /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A905E361B067CA100884083 /* Alamofire.framework */; }; 6AC787711BA87286007BBD2B /* ObjectMapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A905E371B067CA100884083 /* ObjectMapper.framework */; }; 6AC787721BA87E01007BBD2B /* AlamofireObjectMapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6AB2A0851AF27DF1001EBB20 /* AlamofireObjectMapper.framework */; }; + E80A64061D6E1AD0000AE51B /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E80A64021D6E1ABB000AE51B /* Alamofire.framework */; }; + E80A64081D6E1AD5000AE51B /* ObjectMapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E80A64031D6E1ABB000AE51B /* ObjectMapper.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -69,16 +69,13 @@ 6AB2A02D1AF2746D001EBB20 /* AlamofireObjectMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlamofireObjectMapper.swift; sourceTree = ""; }; 6AB2A0851AF27DF1001EBB20 /* AlamofireObjectMapper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireObjectMapper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 6AB2A08F1AF27DF1001EBB20 /* AlamofireObjectMapperTests OSX.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AlamofireObjectMapperTests OSX.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 6AB2A09F1AF28166001EBB20 /* ObjectMapper.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjectMapper.framework; path = "../../../../../Library/Developer/Xcode/DerivedData/AlamofireObjectMapper-dauotuqewdtvbqbcptlcgtwkqndr/Build/Products/Debug-iphoneos/ObjectMapper.framework"; sourceTree = ""; }; - 6AB2A0A11AF2816E001EBB20 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = "../../../../../Library/Developer/Xcode/DerivedData/AlamofireObjectMapper-dauotuqewdtvbqbcptlcgtwkqndr/Build/Products/Debug-iphoneos/Alamofire.framework"; sourceTree = ""; }; 6AC4580C1BA34C5600054758 /* AlamofireObjectMapper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireObjectMapper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 6AC692061BE3F69E004C119A /* AlamofireObjectMapper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireObjectMapper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 6AC692121BE3F7F5004C119A /* AlamofireObjectMapperTests tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AlamofireObjectMapperTests tvOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 6AC692481BE3FEA4004C119A /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = "Carthage/Checkouts/Alamofire/build/Debug-appletvos/Alamofire.framework"; sourceTree = ""; }; - 6AC692491BE3FEA4004C119A /* ObjectMapper.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjectMapper.framework; path = "Carthage/Checkouts/ObjectMapper/build/Debug-appletvos/ObjectMapper.framework"; sourceTree = ""; }; - 6AC7876A1BA87221007BBD2B /* AlamofireObjectMapper.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AlamofireObjectMapper.framework; path = Carthage/Build/Mac/AlamofireObjectMapper.framework; sourceTree = ""; }; 6AC7876C1BA8726F007BBD2B /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/watchOS/Alamofire.framework; sourceTree = ""; }; 6AC7876D1BA8726F007BBD2B /* ObjectMapper.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjectMapper.framework; path = Carthage/Build/watchOS/ObjectMapper.framework; sourceTree = ""; }; + E80A64021D6E1ABB000AE51B /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/tvOS/Alamofire.framework; sourceTree = ""; }; + E80A64031D6E1ABB000AE51B /* ObjectMapper.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjectMapper.framework; path = Carthage/Build/tvOS/ObjectMapper.framework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -129,8 +126,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6AC6924A1BE3FEA4004C119A /* Alamofire.framework in Frameworks */, - 6AC6924B1BE3FEA4004C119A /* ObjectMapper.framework in Frameworks */, + E80A64081D6E1AD5000AE51B /* ObjectMapper.framework in Frameworks */, + E80A64061D6E1AD0000AE51B /* Alamofire.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -148,11 +145,10 @@ 6A905E3E1B067CBC00884083 /* Frameworks */ = { isa = PBXGroup; children = ( - 6AC692481BE3FEA4004C119A /* Alamofire.framework */, - 6AC692491BE3FEA4004C119A /* ObjectMapper.framework */, + E80A64021D6E1ABB000AE51B /* Alamofire.framework */, + E80A64031D6E1ABB000AE51B /* ObjectMapper.framework */, 6AC7876C1BA8726F007BBD2B /* Alamofire.framework */, 6AC7876D1BA8726F007BBD2B /* ObjectMapper.framework */, - 6AC7876A1BA87221007BBD2B /* AlamofireObjectMapper.framework */, 6A905E3A1B067CAC00884083 /* Alamofire.framework */, 6A905E3B1B067CAC00884083 /* ObjectMapper.framework */, 6A905E361B067CA100884083 /* Alamofire.framework */, @@ -198,8 +194,6 @@ 6AB2A0141AF26C36001EBB20 /* Supporting Files */ = { isa = PBXGroup; children = ( - 6AB2A0A11AF2816E001EBB20 /* Alamofire.framework */, - 6AB2A09F1AF28166001EBB20 /* ObjectMapper.framework */, 6AB2A0151AF26C36001EBB20 /* Info.plist */, ); name = "Supporting Files"; @@ -675,8 +669,6 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; }; @@ -705,8 +697,6 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; }; @@ -717,6 +707,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(PROJECT_DIR)/Carthage/Build/iOS", ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -738,6 +729,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = AlamofireObjectMapperTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -778,8 +770,6 @@ SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; }; @@ -808,8 +798,6 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; }; @@ -830,10 +818,11 @@ ); INFOPLIST_FILE = AlamofireObjectMapperTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -849,11 +838,12 @@ ); INFOPLIST_FILE = AlamofireObjectMapperTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -874,7 +864,6 @@ ); INFOPLIST_FILE = AlamofireObjectMapper/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = AlamofireObjectMapper; @@ -882,7 +871,6 @@ SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 4; - TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; @@ -903,7 +891,6 @@ ); INFOPLIST_FILE = AlamofireObjectMapper/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = AlamofireObjectMapper; @@ -912,7 +899,6 @@ SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 4; - TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; @@ -942,7 +928,6 @@ SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; }; @@ -971,7 +956,6 @@ SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; }; @@ -979,11 +963,17 @@ isa = XCBuildConfiguration; buildSettings = { DEBUG_INFORMATION_FORMAT = dwarf; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(PROJECT_DIR)/Carthage/Build/tvOS", + ); INFOPLIST_FILE = AlamofireObjectMapperTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; + SWIFT_VERSION = 3.0; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Debug; @@ -991,12 +981,18 @@ 6AC6921C1BE3F7F6004C119A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(PROJECT_DIR)/Carthage/Build/tvOS", + ); INFOPLIST_FILE = AlamofireObjectMapperTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; From e31f839e45c1a570af6f002a4c390b33a940a8d4 Mon Sep 17 00:00:00 2001 From: Bradley David Bergeron Date: Wed, 24 Aug 2016 11:29:40 -0700 Subject: [PATCH 10/27] Update tests with Alamofire API changes --- .../AlamofireObjectMapperTests.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift b/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift index 4acddbb..620a677 100644 --- a/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift +++ b/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift @@ -48,8 +48,8 @@ class AlamofireObjectMapperTests: XCTestCase { // This is an example of a functional test case. let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/d8bb95982be8a11a2308e779bb9a9707ebe42ede/sample_json" let expectation = self.expectation(description: "\(URL)") - - _ = Alamofire.request(.GET, URL).responseObject { (response: Response) in + + _ = Alamofire.request(URL, withMethod: .get).responseObject { (response: Response) in expectation.fulfill() let mappedObject = response.result.value @@ -78,7 +78,7 @@ class AlamofireObjectMapperTests: XCTestCase { let weatherResponse = WeatherResponse() weatherResponse.date = Date() - _ = Alamofire.request(.GET, URL).responseObject(mapToObject: weatherResponse) { (response: Response) in + _ = Alamofire.request(URL, withMethod: .get).responseObject(mapToObject: weatherResponse) { (response: Response) in expectation.fulfill() let mappedObject = response.result.value @@ -105,7 +105,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/2ee8f34d21e8febfdefb2b3a403f18a43818d70a/sample_keypath_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(.GET, URL).responseObject(keyPath: "data") { (response: Response) in + _ = Alamofire.request(URL, withMethod: .get).responseObject(keyPath: "data") { (response: Response) in expectation.fulfill() let mappedObject = response.result.value @@ -131,7 +131,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/97231a04e6e4970612efcc0b7e0c125a83e3de6e/sample_keypath_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(.GET, URL).responseObject(keyPath: "response.data") { (response: Response) in + _ = Alamofire.request(URL, withMethod: .get).responseObject(keyPath: "response.data") { (response: Response) in expectation.fulfill() let mappedObject = response.result.value @@ -157,7 +157,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/f583be1121dbc5e9b0381b3017718a70c31054f7/sample_array_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(.GET, URL).responseArray { (response: Response<[Forecast], NSError>) in + _ = Alamofire.request(URL, withMethod: .get).responseArray { (response: Response<[Forecast], NSError>) in expectation.fulfill() let mappedArray = response.result.value @@ -181,7 +181,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/d8bb95982be8a11a2308e779bb9a9707ebe42ede/sample_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(.GET, URL).responseArray(keyPath: "three_day_forecast") { (response: Response<[Forecast], NSError>) in + _ = Alamofire.request(URL, withMethod: .get).responseArray(keyPath: "three_day_forecast") { (response: Response<[Forecast], NSError>) in expectation.fulfill() @@ -206,7 +206,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/97231a04e6e4970612efcc0b7e0c125a83e3de6e/sample_keypath_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(.GET, URL).responseArray(keyPath: "response.data.three_day_forecast") { (response: Response<[Forecast], NSError>) in + _ = Alamofire.request(URL, withMethod: .get).responseArray(keyPath: "response.data.three_day_forecast") { (response: Response<[Forecast], NSError>) in expectation.fulfill() From 0afe7a25671115e4dc56afaa2822a41f299d81ba Mon Sep 17 00:00:00 2001 From: Brad Bergeron Date: Wed, 24 Aug 2016 11:58:34 -0700 Subject: [PATCH 11/27] Use xcodebuild for travis It appears that xctool does not yet support Xcode 8 --- .travis.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7cd1d8b..95453c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,14 +9,15 @@ env: matrix: - SCHEME="AlamofireObjectMapper iOS" - SCHEME="AlamofireObjectMapper OSX" - - SCHEME="AlamofireObjectMapper tvOS" + - SCHEME="AlamofireObjectMapper tvOS" before_install: - - brew install xctool + - gem install xcpretty --no-rdoc --no-ri --no-document --quiet -script: - - xctool -workspace $XCODE_WORKSPACE -scheme "$SCHEME" -configuration Debug clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO - - xctool -workspace $XCODE_WORKSPACE -scheme "$SCHEME" -configuration Release clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO +script: + - set -o pipefail + - xcodebuild -workspace "$XCODE_WORKSPACE" -scheme "$SCHEME" -configuration Debug clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty -c; + - xcodebuild -workspace "$XCODE_WORKSPACE" -scheme "$SCHEME" -configuration Release clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty -c; notifications: email: false From d9e4716475c73bcb62d4cefbb28d2ff8ccaf76b4 Mon Sep 17 00:00:00 2001 From: Bradley David Bergeron Date: Thu, 25 Aug 2016 10:26:20 -0700 Subject: [PATCH 12/27] Add Alamofire and ObjectMapper as subprojects * Allows use of carthage --no-build --- .gitignore | 76 +++- .../project.pbxproj | 335 ++++++++++++++---- 2 files changed, 327 insertions(+), 84 deletions(-) diff --git a/.gitignore b/.gitignore index 485049e..7165410 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,45 @@ + +# Created by https://www.gitignore.io/api/osx,swift + +### OSX ### +*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + + +### Swift ### # Xcode # +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated build/ +DerivedData/ + +## Various settings *.pbxuser !default.pbxuser *.mode1v3 @@ -9,20 +48,33 @@ build/ !default.mode2v3 *.perspectivev3 !default.perspectivev3 -xcuserdata -*.xccheckout -*.xcscmblueprint +xcuserdata/ + +## Other *.moved-aside -DerivedData +*.xcuserstate + +## Obj-C/Swift specific *.hmap *.ipa -*.xcuserstate +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +.build/ # CocoaPods # # We recommend against adding the Pods directory to your .gitignore. However # you should judge for yourself, the pros and cons are mentioned at: -# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control # # Pods/ @@ -32,3 +84,15 @@ DerivedData # Carthage/Checkouts Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output diff --git a/AlamofireObjectMapper.xcodeproj/project.pbxproj b/AlamofireObjectMapper.xcodeproj/project.pbxproj index 8d4060a..7084b21 100644 --- a/AlamofireObjectMapper.xcodeproj/project.pbxproj +++ b/AlamofireObjectMapper.xcodeproj/project.pbxproj @@ -20,15 +20,15 @@ 6AC692231BE3F9AE004C119A /* AlamofireObjectMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AB2A02D1AF2746D001EBB20 /* AlamofireObjectMapper.swift */; }; 6AC6924C1BE7BC47004C119A /* AlamofireObjectMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AB2A02D1AF2746D001EBB20 /* AlamofireObjectMapper.swift */; }; 6AC787651BA86CA3007BBD2B /* AlamofireObjectMapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 6AB2A0161AF26C36001EBB20 /* AlamofireObjectMapper.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6AC787661BA871C4007BBD2B /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A905E3A1B067CAC00884083 /* Alamofire.framework */; }; - 6AC787671BA871C4007BBD2B /* ObjectMapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A905E3B1B067CAC00884083 /* ObjectMapper.framework */; }; - 6AC7876E1BA8726F007BBD2B /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6AC7876C1BA8726F007BBD2B /* Alamofire.framework */; }; - 6AC7876F1BA8726F007BBD2B /* ObjectMapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6AC7876D1BA8726F007BBD2B /* ObjectMapper.framework */; }; - 6AC787701BA87286007BBD2B /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A905E361B067CA100884083 /* Alamofire.framework */; }; - 6AC787711BA87286007BBD2B /* ObjectMapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A905E371B067CA100884083 /* ObjectMapper.framework */; }; 6AC787721BA87E01007BBD2B /* AlamofireObjectMapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6AB2A0851AF27DF1001EBB20 /* AlamofireObjectMapper.framework */; }; - E80A64061D6E1AD0000AE51B /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E80A64021D6E1ABB000AE51B /* Alamofire.framework */; }; - E80A64081D6E1AD5000AE51B /* ObjectMapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E80A64031D6E1ABB000AE51B /* ObjectMapper.framework */; }; + E89A90241D6F5F620023C364 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E89A8FFF1D6F5F480023C364 /* Alamofire.framework */; }; + E89A90251D6F5F620023C364 /* ObjectMapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E89A90171D6F5F520023C364 /* ObjectMapper.framework */; }; + E89A90261D6F5F6A0023C364 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E89A90031D6F5F480023C364 /* Alamofire.framework */; }; + E89A90271D6F5F6A0023C364 /* ObjectMapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E89A90191D6F5F520023C364 /* ObjectMapper.framework */; }; + E89A90281D6F5F710023C364 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E89A90071D6F5F480023C364 /* Alamofire.framework */; }; + E89A90291D6F5F710023C364 /* ObjectMapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E89A901D1D6F5F520023C364 /* ObjectMapper.framework */; }; + E89A902A1D6F5F760023C364 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E89A900B1D6F5F480023C364 /* Alamofire.framework */; }; + E89A902B1D6F5F760023C364 /* ObjectMapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E89A901B1D6F5F520023C364 /* ObjectMapper.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -53,13 +53,107 @@ remoteGlobalIDString = 6AC692051BE3F69E004C119A; remoteInfo = "AlamofireObjectMapper tvOS"; }; + E89A8FFE1D6F5F480023C364 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E89A8FF31D6F5F480023C364 /* Alamofire.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F8111E3319A95C8B0040E7D1; + remoteInfo = "Alamofire iOS"; + }; + E89A90001D6F5F480023C364 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E89A8FF31D6F5F480023C364 /* Alamofire.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F8111E3E19A95C8B0040E7D1; + remoteInfo = "Alamofire iOS Tests"; + }; + E89A90021D6F5F480023C364 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E89A8FF31D6F5F480023C364 /* Alamofire.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 4DD67C0B1A5C55C900ED2280; + remoteInfo = "Alamofire OSX"; + }; + E89A90041D6F5F480023C364 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E89A8FF31D6F5F480023C364 /* Alamofire.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F829C6B21A7A94F100A2CD59; + remoteInfo = "Alamofire OSX Tests"; + }; + E89A90061D6F5F480023C364 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E89A8FF31D6F5F480023C364 /* Alamofire.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 4CF626EF1BA7CB3E0011A099; + remoteInfo = "Alamofire tvOS"; + }; + E89A90081D6F5F480023C364 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E89A8FF31D6F5F480023C364 /* Alamofire.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 4CF626F81BA7CB3E0011A099; + remoteInfo = "Alamofire tvOS Tests"; + }; + E89A900A1D6F5F480023C364 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E89A8FF31D6F5F480023C364 /* Alamofire.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = E4202FE01B667AA100C997FB; + remoteInfo = "Alamofire watchOS"; + }; + E89A90161D6F5F520023C364 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E89A900C1D6F5F520023C364 /* ObjectMapper.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 6AAC8F7619F03C2900E7A677; + remoteInfo = "ObjectMapper-iOS"; + }; + E89A90181D6F5F520023C364 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E89A900C1D6F5F520023C364 /* ObjectMapper.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = CD1602FF1AC023D5000CD69A; + remoteInfo = "ObjectMapper-Mac"; + }; + E89A901A1D6F5F520023C364 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E89A900C1D6F5F520023C364 /* ObjectMapper.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 6A2AD03D1B2C78540097E150; + remoteInfo = "ObjectMapper-watchOS"; + }; + E89A901C1D6F5F520023C364 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E89A900C1D6F5F520023C364 /* ObjectMapper.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 6A05B7A61BE274BE00F19B53; + remoteInfo = "ObjectMapper-tvOS"; + }; + E89A901E1D6F5F520023C364 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E89A900C1D6F5F520023C364 /* ObjectMapper.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 6AAC8F8119F03C2900E7A677; + remoteInfo = "ObjectMapper-iOSTests"; + }; + E89A90201D6F5F520023C364 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E89A900C1D6F5F520023C364 /* ObjectMapper.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = CD1603091AC023D6000CD69A; + remoteInfo = "ObjectMapper-MacTests"; + }; + E89A90221D6F5F520023C364 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E89A900C1D6F5F520023C364 /* ObjectMapper.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 6A05B7AF1BE274BE00F19B53; + remoteInfo = "ObjectMapper-tvOSTests"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 6A905E361B067CA100884083 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/iOS/Alamofire.framework; sourceTree = ""; }; - 6A905E371B067CA100884083 /* ObjectMapper.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjectMapper.framework; path = Carthage/Build/iOS/ObjectMapper.framework; sourceTree = ""; }; - 6A905E3A1B067CAC00884083 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/Mac/Alamofire.framework; sourceTree = ""; }; - 6A905E3B1B067CAC00884083 /* ObjectMapper.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjectMapper.framework; path = Carthage/Build/Mac/ObjectMapper.framework; sourceTree = ""; }; 6AB2A0111AF26C36001EBB20 /* AlamofireObjectMapper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireObjectMapper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 6AB2A0151AF26C36001EBB20 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 6AB2A0161AF26C36001EBB20 /* AlamofireObjectMapper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AlamofireObjectMapper.h; sourceTree = ""; }; @@ -72,10 +166,8 @@ 6AC4580C1BA34C5600054758 /* AlamofireObjectMapper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireObjectMapper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 6AC692061BE3F69E004C119A /* AlamofireObjectMapper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireObjectMapper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 6AC692121BE3F7F5004C119A /* AlamofireObjectMapperTests tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AlamofireObjectMapperTests tvOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 6AC7876C1BA8726F007BBD2B /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/watchOS/Alamofire.framework; sourceTree = ""; }; - 6AC7876D1BA8726F007BBD2B /* ObjectMapper.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjectMapper.framework; path = Carthage/Build/watchOS/ObjectMapper.framework; sourceTree = ""; }; - E80A64021D6E1ABB000AE51B /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/tvOS/Alamofire.framework; sourceTree = ""; }; - E80A64031D6E1ABB000AE51B /* ObjectMapper.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjectMapper.framework; path = Carthage/Build/tvOS/ObjectMapper.framework; sourceTree = ""; }; + E89A8FF31D6F5F480023C364 /* Alamofire.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Alamofire.xcodeproj; path = Carthage/Checkouts/Alamofire/Alamofire.xcodeproj; sourceTree = ""; }; + E89A900C1D6F5F520023C364 /* ObjectMapper.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ObjectMapper.xcodeproj; path = Carthage/Checkouts/ObjectMapper/ObjectMapper.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -83,8 +175,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6AC787701BA87286007BBD2B /* Alamofire.framework in Frameworks */, - 6AC787711BA87286007BBD2B /* ObjectMapper.framework in Frameworks */, + E89A90241D6F5F620023C364 /* Alamofire.framework in Frameworks */, + E89A90251D6F5F620023C364 /* ObjectMapper.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -100,8 +192,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6AC787661BA871C4007BBD2B /* Alamofire.framework in Frameworks */, - 6AC787671BA871C4007BBD2B /* ObjectMapper.framework in Frameworks */, + E89A90261D6F5F6A0023C364 /* Alamofire.framework in Frameworks */, + E89A90271D6F5F6A0023C364 /* ObjectMapper.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -117,8 +209,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6AC7876E1BA8726F007BBD2B /* Alamofire.framework in Frameworks */, - 6AC7876F1BA8726F007BBD2B /* ObjectMapper.framework in Frameworks */, + E89A902A1D6F5F760023C364 /* Alamofire.framework in Frameworks */, + E89A902B1D6F5F760023C364 /* ObjectMapper.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -126,8 +218,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - E80A64081D6E1AD5000AE51B /* ObjectMapper.framework in Frameworks */, - E80A64061D6E1AD0000AE51B /* Alamofire.framework in Frameworks */, + E89A90281D6F5F710023C364 /* Alamofire.framework in Frameworks */, + E89A90291D6F5F710023C364 /* ObjectMapper.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -142,28 +234,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 6A905E3E1B067CBC00884083 /* Frameworks */ = { - isa = PBXGroup; - children = ( - E80A64021D6E1ABB000AE51B /* Alamofire.framework */, - E80A64031D6E1ABB000AE51B /* ObjectMapper.framework */, - 6AC7876C1BA8726F007BBD2B /* Alamofire.framework */, - 6AC7876D1BA8726F007BBD2B /* ObjectMapper.framework */, - 6A905E3A1B067CAC00884083 /* Alamofire.framework */, - 6A905E3B1B067CAC00884083 /* ObjectMapper.framework */, - 6A905E361B067CA100884083 /* Alamofire.framework */, - 6A905E371B067CA100884083 /* ObjectMapper.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; 6AB2A0071AF26C36001EBB20 = { isa = PBXGroup; children = ( + E89A8FF31D6F5F480023C364 /* Alamofire.xcodeproj */, + E89A900C1D6F5F520023C364 /* ObjectMapper.xcodeproj */, 6AB2A0131AF26C36001EBB20 /* AlamofireObjectMapper */, 6AB2A0201AF26C36001EBB20 /* AlamofireObjectMapperTests */, 6AB2A0121AF26C36001EBB20 /* Products */, - 6A905E3E1B067CBC00884083 /* Frameworks */, ); sourceTree = ""; }; @@ -216,6 +294,34 @@ name = "Supporting Files"; sourceTree = ""; }; + E89A8FF41D6F5F480023C364 /* Products */ = { + isa = PBXGroup; + children = ( + E89A8FFF1D6F5F480023C364 /* Alamofire.framework */, + E89A90011D6F5F480023C364 /* Alamofire iOS Tests.xctest */, + E89A90031D6F5F480023C364 /* Alamofire.framework */, + E89A90051D6F5F480023C364 /* Alamofire OSX Tests.xctest */, + E89A90071D6F5F480023C364 /* Alamofire.framework */, + E89A90091D6F5F480023C364 /* Alamofire tvOS Tests.xctest */, + E89A900B1D6F5F480023C364 /* Alamofire.framework */, + ); + name = Products; + sourceTree = ""; + }; + E89A900D1D6F5F520023C364 /* Products */ = { + isa = PBXGroup; + children = ( + E89A90171D6F5F520023C364 /* ObjectMapper.framework */, + E89A90191D6F5F520023C364 /* ObjectMapper.framework */, + E89A901B1D6F5F520023C364 /* ObjectMapper.framework */, + E89A901D1D6F5F520023C364 /* ObjectMapper.framework */, + E89A901F1D6F5F520023C364 /* ObjectMapper-iOSTests.xctest */, + E89A90211D6F5F520023C364 /* ObjectMapper-MacTests.xctest */, + E89A90231D6F5F520023C364 /* ObjectMapper-tvOSTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -425,6 +531,16 @@ mainGroup = 6AB2A0071AF26C36001EBB20; productRefGroup = 6AB2A0121AF26C36001EBB20 /* Products */; projectDirPath = ""; + projectReferences = ( + { + ProductGroup = E89A8FF41D6F5F480023C364 /* Products */; + ProjectRef = E89A8FF31D6F5F480023C364 /* Alamofire.xcodeproj */; + }, + { + ProductGroup = E89A900D1D6F5F520023C364 /* Products */; + ProjectRef = E89A900C1D6F5F520023C364 /* ObjectMapper.xcodeproj */; + }, + ); projectRoot = ""; targets = ( 6AB2A0101AF26C36001EBB20 /* AlamofireObjectMapper iOS */, @@ -438,6 +554,107 @@ }; /* End PBXProject section */ +/* Begin PBXReferenceProxy section */ + E89A8FFF1D6F5F480023C364 /* Alamofire.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Alamofire.framework; + remoteRef = E89A8FFE1D6F5F480023C364 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E89A90011D6F5F480023C364 /* Alamofire iOS Tests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "Alamofire iOS Tests.xctest"; + remoteRef = E89A90001D6F5F480023C364 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E89A90031D6F5F480023C364 /* Alamofire.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Alamofire.framework; + remoteRef = E89A90021D6F5F480023C364 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E89A90051D6F5F480023C364 /* Alamofire OSX Tests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "Alamofire OSX Tests.xctest"; + remoteRef = E89A90041D6F5F480023C364 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E89A90071D6F5F480023C364 /* Alamofire.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Alamofire.framework; + remoteRef = E89A90061D6F5F480023C364 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E89A90091D6F5F480023C364 /* Alamofire tvOS Tests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "Alamofire tvOS Tests.xctest"; + remoteRef = E89A90081D6F5F480023C364 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E89A900B1D6F5F480023C364 /* Alamofire.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Alamofire.framework; + remoteRef = E89A900A1D6F5F480023C364 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E89A90171D6F5F520023C364 /* ObjectMapper.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = ObjectMapper.framework; + remoteRef = E89A90161D6F5F520023C364 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E89A90191D6F5F520023C364 /* ObjectMapper.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = ObjectMapper.framework; + remoteRef = E89A90181D6F5F520023C364 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E89A901B1D6F5F520023C364 /* ObjectMapper.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = ObjectMapper.framework; + remoteRef = E89A901A1D6F5F520023C364 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E89A901D1D6F5F520023C364 /* ObjectMapper.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = ObjectMapper.framework; + remoteRef = E89A901C1D6F5F520023C364 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E89A901F1D6F5F520023C364 /* ObjectMapper-iOSTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "ObjectMapper-iOSTests.xctest"; + remoteRef = E89A901E1D6F5F520023C364 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E89A90211D6F5F520023C364 /* ObjectMapper-MacTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "ObjectMapper-MacTests.xctest"; + remoteRef = E89A90201D6F5F520023C364 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E89A90231D6F5F520023C364 /* ObjectMapper-tvOSTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "ObjectMapper-tvOSTests.xctest"; + remoteRef = E89A90221D6F5F520023C364 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + /* Begin PBXResourcesBuildPhase section */ 6AB2A01A1AF26C36001EBB20 /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -656,10 +873,6 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); INFOPLIST_FILE = AlamofireObjectMapper/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; @@ -684,10 +897,6 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); INFOPLIST_FILE = AlamofireObjectMapper/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; @@ -707,7 +916,6 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(PROJECT_DIR)/Carthage/Build/iOS", ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -729,7 +937,6 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = AlamofireObjectMapperTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -752,10 +959,6 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/Mac", - ); FRAMEWORK_VERSION = A; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -783,10 +986,6 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/Mac", - ); FRAMEWORK_VERSION = A; INFOPLIST_FILE = AlamofireObjectMapper/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -810,7 +1009,6 @@ FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/Mac", ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -834,7 +1032,6 @@ FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/Mac", ); INFOPLIST_FILE = AlamofireObjectMapperTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; @@ -858,10 +1055,6 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/watchOS", - ); INFOPLIST_FILE = AlamofireObjectMapper/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -885,10 +1078,6 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/watchOS", - ); INFOPLIST_FILE = AlamofireObjectMapper/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -914,10 +1103,6 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/tvOS", - ); INFOPLIST_FILE = AlamofireObjectMapper/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -941,10 +1126,6 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/tvOS", - ); INFOPLIST_FILE = AlamofireObjectMapper/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -966,7 +1147,6 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(PROJECT_DIR)/Carthage/Build/tvOS", ); INFOPLIST_FILE = AlamofireObjectMapperTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -984,7 +1164,6 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(PROJECT_DIR)/Carthage/Build/tvOS", ); INFOPLIST_FILE = AlamofireObjectMapperTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; From 9e0c10be9dda77a88a142743a5adf9731ff6f08e Mon Sep 17 00:00:00 2001 From: Bradley David Bergeron Date: Thu, 25 Aug 2016 13:51:14 -0700 Subject: [PATCH 13/27] Update Podspec --- AlamofireObjectMapper.podspec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AlamofireObjectMapper.podspec b/AlamofireObjectMapper.podspec index ca01d7c..7f5c74c 100644 --- a/AlamofireObjectMapper.podspec +++ b/AlamofireObjectMapper.podspec @@ -1,20 +1,20 @@ Pod::Spec.new do |s| s.name = "AlamofireObjectMapper" - s.version = "3.0.0" + s.version = "4.0.0-beta" s.license = { :type => "MIT", :file => "LICENSE" } s.summary = "An extension to Alamofire which automatically converts JSON response data into swift objects using ObjectMapper" s.homepage = "https://github.com/tristanhimmelman/AlamofireObjectMapper" s.author = { "Tristan Himmelman" => "tristanhimmelman@gmail.com" } s.source = { :git => 'https://github.com/tristanhimmelman/AlamofireObjectMapper.git', :tag => s.version.to_s } - s.ios.deployment_target = '8.0' - s.osx.deployment_target = '10.9' + s.ios.deployment_target = '9.0' + s.osx.deployment_target = '10.11' s.watchos.deployment_target = '2.0' s.tvos.deployment_target = '9.0' s.requires_arc = 'true' s.source_files = 'AlamofireObjectMapper/**/*.swift' - s.dependency 'Alamofire', '~> 3.2' + s.dependency 'Alamofire', '~> 4.0.0-beta.1' s.dependency 'ObjectMapper', '~> 1.0' end From c677c0c6cf4223820b666eee725ccd2647e9f1c3 Mon Sep 17 00:00:00 2001 From: Bradley David Bergeron Date: Thu, 25 Aug 2016 13:59:14 -0700 Subject: [PATCH 14/27] Use Xcode 8 for Travis Missed this when updating the file earlier :grin: --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 95453c0..2c51b33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode7.3 +osx_image: xcode8 env: global: From bcd3fc282f8b41e2876a43cb35542d430c0f337b Mon Sep 17 00:00:00 2001 From: Tristan Himmelman Date: Mon, 29 Aug 2016 10:29:40 -0400 Subject: [PATCH 15/27] - updated ResponseSerializer in function definition due to Alamofire change - added ErrorCode enum --- .../AlamofireObjectMapper.xccheckout | 41 +++++++++++++++++++ .../AlamofireObjectMapper.xccheckout | 41 +++++++++++++++++++ .../AlamofireObjectMapper.xcscmblueprint | 37 +++++++++++++++++ .../AlamofireObjectMapper.swift | 15 ++++--- .../AlamofireObjectMapperTests.swift | 14 +++---- Cartfile.resolved | 2 +- Carthage/Checkouts/Alamofire | 2 +- 7 files changed, 138 insertions(+), 14 deletions(-) create mode 100644 AlamofireObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/AlamofireObjectMapper.xccheckout create mode 100644 AlamofireObjectMapper.xcworkspace/xcshareddata/AlamofireObjectMapper.xccheckout create mode 100644 AlamofireObjectMapper.xcworkspace/xcshareddata/AlamofireObjectMapper.xcscmblueprint diff --git a/AlamofireObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/AlamofireObjectMapper.xccheckout b/AlamofireObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/AlamofireObjectMapper.xccheckout new file mode 100644 index 0000000..a6d9010 --- /dev/null +++ b/AlamofireObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/AlamofireObjectMapper.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + E216F167-6BBD-4B09-9721-39268CC4E710 + IDESourceControlProjectName + AlamofireObjectMapper + IDESourceControlProjectOriginsDictionary + + D712610954CA9BFA7A6E793AC8CA9FD9B6557F56 + https://github.com/tristanhimmelman/Alamofire-ObjectMapper.git + + IDESourceControlProjectPath + AlamofireObjectMapper.xcodeproj + IDESourceControlProjectRelativeInstallPathDictionary + + D712610954CA9BFA7A6E793AC8CA9FD9B6557F56 + ../.. + + IDESourceControlProjectURL + https://github.com/tristanhimmelman/Alamofire-ObjectMapper.git + IDESourceControlProjectVersion + 111 + IDESourceControlProjectWCCIdentifier + D712610954CA9BFA7A6E793AC8CA9FD9B6557F56 + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + D712610954CA9BFA7A6E793AC8CA9FD9B6557F56 + IDESourceControlWCCName + Alamofire-ObjectMapper + + + + diff --git a/AlamofireObjectMapper.xcworkspace/xcshareddata/AlamofireObjectMapper.xccheckout b/AlamofireObjectMapper.xcworkspace/xcshareddata/AlamofireObjectMapper.xccheckout new file mode 100644 index 0000000..c297681 --- /dev/null +++ b/AlamofireObjectMapper.xcworkspace/xcshareddata/AlamofireObjectMapper.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + C7BE09AD-45C0-4DDF-AC80-A6D8717D2DCE + IDESourceControlProjectName + AlamofireObjectMapper + IDESourceControlProjectOriginsDictionary + + D712610954CA9BFA7A6E793AC8CA9FD9B6557F56 + https://github.com/tristanhimmelman/Alamofire-ObjectMapper.git + + IDESourceControlProjectPath + AlamofireObjectMapper.xcworkspace + IDESourceControlProjectRelativeInstallPathDictionary + + D712610954CA9BFA7A6E793AC8CA9FD9B6557F56 + .. + + IDESourceControlProjectURL + https://github.com/tristanhimmelman/Alamofire-ObjectMapper.git + IDESourceControlProjectVersion + 111 + IDESourceControlProjectWCCIdentifier + D712610954CA9BFA7A6E793AC8CA9FD9B6557F56 + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + D712610954CA9BFA7A6E793AC8CA9FD9B6557F56 + IDESourceControlWCCName + AlamofireObjectMapper + + + + diff --git a/AlamofireObjectMapper.xcworkspace/xcshareddata/AlamofireObjectMapper.xcscmblueprint b/AlamofireObjectMapper.xcworkspace/xcshareddata/AlamofireObjectMapper.xcscmblueprint new file mode 100644 index 0000000..8b80939 --- /dev/null +++ b/AlamofireObjectMapper.xcworkspace/xcshareddata/AlamofireObjectMapper.xcscmblueprint @@ -0,0 +1,37 @@ +{ + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "D712610954CA9BFA7A6E793AC8CA9FD9B6557F56", + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { + + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { + "D712610954CA9BFA7A6E793AC8CA9FD9B6557F56" : 0, + "58AAB0051E2B4EEDF1845A552012E6D0EBAD9127" : 0, + "67620B5EFA902936DF04070AF595B76AB0333747" : 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "C7BE09AD-45C0-4DDF-AC80-A6D8717D2DCE", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { + "D712610954CA9BFA7A6E793AC8CA9FD9B6557F56" : "AlamofireObjectMapper\/", + "58AAB0051E2B4EEDF1845A552012E6D0EBAD9127" : "AlamofireObjectMapper\/Carthage\/Checkouts\/ObjectMapper\/", + "67620B5EFA902936DF04070AF595B76AB0333747" : "AlamofireObjectMapper\/Carthage\/Checkouts\/Alamofire\/" + }, + "DVTSourceControlWorkspaceBlueprintNameKey" : "AlamofireObjectMapper", + "DVTSourceControlWorkspaceBlueprintVersion" : 204, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "AlamofireObjectMapper.xcworkspace", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/Hearst-DD\/ObjectMapper.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "58AAB0051E2B4EEDF1845A552012E6D0EBAD9127" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/Alamofire\/Alamofire.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "67620B5EFA902936DF04070AF595B76AB0333747" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/tristanhimmelman\/Alamofire-ObjectMapper.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "D712610954CA9BFA7A6E793AC8CA9FD9B6557F56" + } + ] +} \ No newline at end of file diff --git a/AlamofireObjectMapper/AlamofireObjectMapper.swift b/AlamofireObjectMapper/AlamofireObjectMapper.swift index 9a3c5fa..a3ee0ad 100644 --- a/AlamofireObjectMapper/AlamofireObjectMapper.swift +++ b/AlamofireObjectMapper/AlamofireObjectMapper.swift @@ -32,6 +32,11 @@ import ObjectMapper extension Request { + enum ErrorCode: Int { + case noData = 1 + case dataSerializationFailed = 2 + } + internal static func newError(_ code: ErrorCode, failureReason: String) -> NSError { let errorDomain = "com.alamofireobjectmapper.error" @@ -41,7 +46,7 @@ extension Request { return returnError } - public static func ObjectMapperSerializer(_ keyPath: String?, mapToObject object: T? = nil, context: MapContext? = nil) -> ResponseSerializer { + public static func ObjectMapperSerializer(_ keyPath: String?, mapToObject object: T? = nil, context: MapContext? = nil) -> ResponseSerializer { return ResponseSerializer { request, response, data, error in guard error == nil else { return .failure(error!) @@ -49,7 +54,7 @@ extension Request { guard let _ = data else { let failureReason = "Data could not be serialized. Input data was nil." - let error = newError(.dataSerializationFailed, failureReason: failureReason) + let error = newError(.noData, failureReason: failureReason) return .failure(error) } @@ -87,11 +92,11 @@ extension Request { - returns: The request. */ - public func responseObject(queue: DispatchQueue? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil, completionHandler: @escaping (Response) -> Void) -> Self { + public func responseObject(queue: DispatchQueue? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil, completionHandler: @escaping (Response) -> Void) -> Self { return response(queue: queue, responseSerializer: Request.ObjectMapperSerializer(keyPath, mapToObject: object, context: context), completionHandler: completionHandler) } - public static func ObjectMapperArraySerializer(_ keyPath: String?, context: MapContext? = nil) -> ResponseSerializer<[T], NSError> { + public static func ObjectMapperArraySerializer(_ keyPath: String?, context: MapContext? = nil) -> ResponseSerializer<[T]> { return ResponseSerializer { request, response, data, error in guard error == nil else { return .failure(error!) @@ -132,7 +137,7 @@ extension Request { - returns: The request. */ - public func responseArray(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: @escaping (Response<[T], NSError>) -> Void) -> Self { + public func responseArray(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: @escaping (Response<[T]>) -> Void) -> Self { return response(queue: queue, responseSerializer: Request.ObjectMapperArraySerializer(keyPath, context: context), completionHandler: completionHandler) } } diff --git a/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift b/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift index 620a677..587820e 100644 --- a/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift +++ b/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift @@ -49,7 +49,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/d8bb95982be8a11a2308e779bb9a9707ebe42ede/sample_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(URL, withMethod: .get).responseObject { (response: Response) in + _ = Alamofire.request(URL, withMethod: .get).responseObject { (response: Response) in expectation.fulfill() let mappedObject = response.result.value @@ -78,7 +78,7 @@ class AlamofireObjectMapperTests: XCTestCase { let weatherResponse = WeatherResponse() weatherResponse.date = Date() - _ = Alamofire.request(URL, withMethod: .get).responseObject(mapToObject: weatherResponse) { (response: Response) in + _ = Alamofire.request(URL, withMethod: .get).responseObject(mapToObject: weatherResponse) { (response: Response) in expectation.fulfill() let mappedObject = response.result.value @@ -105,7 +105,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/2ee8f34d21e8febfdefb2b3a403f18a43818d70a/sample_keypath_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(URL, withMethod: .get).responseObject(keyPath: "data") { (response: Response) in + _ = Alamofire.request(URL, withMethod: .get).responseObject(keyPath: "data") { (response: Response) in expectation.fulfill() let mappedObject = response.result.value @@ -131,7 +131,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/97231a04e6e4970612efcc0b7e0c125a83e3de6e/sample_keypath_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(URL, withMethod: .get).responseObject(keyPath: "response.data") { (response: Response) in + _ = Alamofire.request(URL, withMethod: .get).responseObject(keyPath: "response.data") { (response: Response) in expectation.fulfill() let mappedObject = response.result.value @@ -157,7 +157,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/f583be1121dbc5e9b0381b3017718a70c31054f7/sample_array_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(URL, withMethod: .get).responseArray { (response: Response<[Forecast], NSError>) in + _ = Alamofire.request(URL, withMethod: .get).responseArray { (response: Response<[Forecast]>) in expectation.fulfill() let mappedArray = response.result.value @@ -181,7 +181,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/d8bb95982be8a11a2308e779bb9a9707ebe42ede/sample_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(URL, withMethod: .get).responseArray(keyPath: "three_day_forecast") { (response: Response<[Forecast], NSError>) in + _ = Alamofire.request(URL, withMethod: .get).responseArray(keyPath: "three_day_forecast") { (response: Response<[Forecast]>) in expectation.fulfill() @@ -206,7 +206,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/97231a04e6e4970612efcc0b7e0c125a83e3de6e/sample_keypath_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(URL, withMethod: .get).responseArray(keyPath: "response.data.three_day_forecast") { (response: Response<[Forecast], NSError>) in + _ = Alamofire.request(URL, withMethod: .get).responseArray(keyPath: "response.data.three_day_forecast") { (response: Response<[Forecast]>) in expectation.fulfill() diff --git a/Cartfile.resolved b/Cartfile.resolved index 989f31a..eda2494 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "Alamofire/Alamofire" "3cc5b4e8453bec9fd6b973d60e6b0605a38e4cf4" +github "Alamofire/Alamofire" "f48f28ef5a8e5a5047c63c346964fcc0ee039ab6" github "Hearst-DD/ObjectMapper" "c4affdd91d2049d98109f197e56a814e2773852f" diff --git a/Carthage/Checkouts/Alamofire b/Carthage/Checkouts/Alamofire index 3cc5b4e..f48f28e 160000 --- a/Carthage/Checkouts/Alamofire +++ b/Carthage/Checkouts/Alamofire @@ -1 +1 @@ -Subproject commit 3cc5b4e8453bec9fd6b973d60e6b0605a38e4cf4 +Subproject commit f48f28ef5a8e5a5047c63c346964fcc0ee039ab6 From a64a863445f5e0147996a13dcb73d418bd44b511 Mon Sep 17 00:00:00 2001 From: Tristan Himmelman Date: Mon, 29 Aug 2016 10:31:03 -0400 Subject: [PATCH 16/27] carthage update --- Carthage/Checkouts/Alamofire | 2 +- Carthage/Checkouts/ObjectMapper | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Carthage/Checkouts/Alamofire b/Carthage/Checkouts/Alamofire index f48f28e..a94323c 160000 --- a/Carthage/Checkouts/Alamofire +++ b/Carthage/Checkouts/Alamofire @@ -1 +1 @@ -Subproject commit f48f28ef5a8e5a5047c63c346964fcc0ee039ab6 +Subproject commit a94323c6e556d47408b6186c948324b040d7ffc8 diff --git a/Carthage/Checkouts/ObjectMapper b/Carthage/Checkouts/ObjectMapper index c4affdd..ad3f7ef 160000 --- a/Carthage/Checkouts/ObjectMapper +++ b/Carthage/Checkouts/ObjectMapper @@ -1 +1 @@ -Subproject commit c4affdd91d2049d98109f197e56a814e2773852f +Subproject commit ad3f7ef42b072190dc3b0e15beab0816afd983fd From 7900271a4903196b91c4686363d76c10028af74a Mon Sep 17 00:00:00 2001 From: Tristan Himmelman Date: Mon, 29 Aug 2016 12:57:32 -0400 Subject: [PATCH 17/27] Ran carthage update to update dependencies --- Cartfile.resolved | 2 +- Carthage/Checkouts/Alamofire | 2 +- Carthage/Checkouts/ObjectMapper | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cartfile.resolved b/Cartfile.resolved index eda2494..910add1 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "Alamofire/Alamofire" "f48f28ef5a8e5a5047c63c346964fcc0ee039ab6" +github "Alamofire/Alamofire" "3ec40fd85a80b451e42ee2c247bcc329cb85cbf5" github "Hearst-DD/ObjectMapper" "c4affdd91d2049d98109f197e56a814e2773852f" diff --git a/Carthage/Checkouts/Alamofire b/Carthage/Checkouts/Alamofire index a94323c..3ec40fd 160000 --- a/Carthage/Checkouts/Alamofire +++ b/Carthage/Checkouts/Alamofire @@ -1 +1 @@ -Subproject commit a94323c6e556d47408b6186c948324b040d7ffc8 +Subproject commit 3ec40fd85a80b451e42ee2c247bcc329cb85cbf5 diff --git a/Carthage/Checkouts/ObjectMapper b/Carthage/Checkouts/ObjectMapper index ad3f7ef..c4affdd 160000 --- a/Carthage/Checkouts/ObjectMapper +++ b/Carthage/Checkouts/ObjectMapper @@ -1 +1 @@ -Subproject commit ad3f7ef42b072190dc3b0e15beab0816afd983fd +Subproject commit c4affdd91d2049d98109f197e56a814e2773852f From a68c2d9088b27c8b9e2a6a08b17c1fc5d2bb5c66 Mon Sep 17 00:00:00 2001 From: "Henry Glendening, Micah Hainline" Date: Thu, 1 Sep 2016 09:58:57 -0500 Subject: [PATCH 18/27] Fixed podspec to allow using Alamofire 4.0.0-beta.2 or any future beta of 4.0 --- AlamofireObjectMapper.podspec | 2 +- Cartfile.resolved | 2 +- Carthage/Checkouts/Alamofire | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AlamofireObjectMapper.podspec b/AlamofireObjectMapper.podspec index 7f5c74c..bb73663 100644 --- a/AlamofireObjectMapper.podspec +++ b/AlamofireObjectMapper.podspec @@ -15,6 +15,6 @@ Pod::Spec.new do |s| s.requires_arc = 'true' s.source_files = 'AlamofireObjectMapper/**/*.swift' - s.dependency 'Alamofire', '~> 4.0.0-beta.1' + s.dependency 'Alamofire', '~> 4.0-beta' s.dependency 'ObjectMapper', '~> 1.0' end diff --git a/Cartfile.resolved b/Cartfile.resolved index 910add1..8ba1d02 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "Alamofire/Alamofire" "3ec40fd85a80b451e42ee2c247bcc329cb85cbf5" +github "Alamofire/Alamofire" "a78137ab4559f37219d6b2825552eea5462e4272" github "Hearst-DD/ObjectMapper" "c4affdd91d2049d98109f197e56a814e2773852f" diff --git a/Carthage/Checkouts/Alamofire b/Carthage/Checkouts/Alamofire index 3ec40fd..a78137a 160000 --- a/Carthage/Checkouts/Alamofire +++ b/Carthage/Checkouts/Alamofire @@ -1 +1 @@ -Subproject commit 3ec40fd85a80b451e42ee2c247bcc329cb85cbf5 +Subproject commit a78137ab4559f37219d6b2825552eea5462e4272 From c8e42a0eaecfb98a390e01ea05b735c7259e3c55 Mon Sep 17 00:00:00 2001 From: "Jason Stephens, Micah Hainline" Date: Tue, 6 Sep 2016 10:18:51 -0500 Subject: [PATCH 19/27] Fixed issues caused by naming change when Alamofire added support for background download --- .../AlamofireObjectMapper.swift | 26 +++++++++---------- .../AlamofireObjectMapperTests.swift | 14 +++++----- Cartfile.resolved | 4 +-- Carthage/Checkouts/Alamofire | 2 +- Carthage/Checkouts/ObjectMapper | 2 +- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/AlamofireObjectMapper/AlamofireObjectMapper.swift b/AlamofireObjectMapper/AlamofireObjectMapper.swift index a3ee0ad..a0caac6 100644 --- a/AlamofireObjectMapper/AlamofireObjectMapper.swift +++ b/AlamofireObjectMapper/AlamofireObjectMapper.swift @@ -30,7 +30,7 @@ import Foundation import Alamofire import ObjectMapper -extension Request { +extension DataRequest { enum ErrorCode: Int { case noData = 1 @@ -46,8 +46,8 @@ extension Request { return returnError } - public static func ObjectMapperSerializer(_ keyPath: String?, mapToObject object: T? = nil, context: MapContext? = nil) -> ResponseSerializer { - return ResponseSerializer { request, response, data, error in + public static func ObjectMapperSerializer(_ keyPath: String?, mapToObject object: T? = nil, context: MapContext? = nil) -> DataResponseSerializer { + return DataResponseSerializer { request, response, data, error in guard error == nil else { return .failure(error!) } @@ -58,8 +58,8 @@ extension Request { return .failure(error) } - let JSONResponseSerializer = Request.JSONResponseSerializer(options: .allowFragments) - let result = JSONResponseSerializer.serializeResponse(request, response, data, error) + let jsonResponseSerializer = DataRequest.jsonResponseSerializer(options: .allowFragments) + let result = jsonResponseSerializer.serializeResponse(request, response, data, error) let JSONToMap: Any? if let keyPath = keyPath , keyPath.isEmpty == false { @@ -92,12 +92,12 @@ extension Request { - returns: The request. */ - public func responseObject(queue: DispatchQueue? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil, completionHandler: @escaping (Response) -> Void) -> Self { - return response(queue: queue, responseSerializer: Request.ObjectMapperSerializer(keyPath, mapToObject: object, context: context), completionHandler: completionHandler) + public func responseObject(queue: DispatchQueue? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil, completionHandler: @escaping (DataResponse) -> Void) -> Self { + return response(queue: queue, responseSerializer: DataRequest.ObjectMapperSerializer(keyPath, mapToObject: object, context: context), completionHandler: completionHandler) } - public static func ObjectMapperArraySerializer(_ keyPath: String?, context: MapContext? = nil) -> ResponseSerializer<[T]> { - return ResponseSerializer { request, response, data, error in + public static func ObjectMapperArraySerializer(_ keyPath: String?, context: MapContext? = nil) -> DataResponseSerializer<[T]> { + return DataResponseSerializer { request, response, data, error in guard error == nil else { return .failure(error!) } @@ -108,8 +108,8 @@ extension Request { return .failure(error) } - let JSONResponseSerializer = Request.JSONResponseSerializer(options: .allowFragments) - let result = JSONResponseSerializer.serializeResponse(request, response, data, error) + let jsonResponseSerializer = DataRequest.jsonResponseSerializer(options: .allowFragments) + let result = jsonResponseSerializer.serializeResponse(request, response, data, error) let JSONToMap: Any? if let keyPath = keyPath, keyPath.isEmpty == false { @@ -137,7 +137,7 @@ extension Request { - returns: The request. */ - public func responseArray(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: @escaping (Response<[T]>) -> Void) -> Self { - return response(queue: queue, responseSerializer: Request.ObjectMapperArraySerializer(keyPath, context: context), completionHandler: completionHandler) + public func responseArray(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: @escaping (DataResponse<[T]>) -> Void) -> Self { + return response(queue: queue, responseSerializer: DataRequest.ObjectMapperArraySerializer(keyPath, context: context), completionHandler: completionHandler) } } diff --git a/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift b/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift index 587820e..d72bf9d 100644 --- a/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift +++ b/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift @@ -49,7 +49,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/d8bb95982be8a11a2308e779bb9a9707ebe42ede/sample_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(URL, withMethod: .get).responseObject { (response: Response) in + _ = Alamofire.request(URL, method: .get).responseObject { (response: DataResponse) in expectation.fulfill() let mappedObject = response.result.value @@ -78,7 +78,7 @@ class AlamofireObjectMapperTests: XCTestCase { let weatherResponse = WeatherResponse() weatherResponse.date = Date() - _ = Alamofire.request(URL, withMethod: .get).responseObject(mapToObject: weatherResponse) { (response: Response) in + _ = Alamofire.request(URL, method: .get).responseObject(mapToObject: weatherResponse) { (response: DataResponse) in expectation.fulfill() let mappedObject = response.result.value @@ -105,7 +105,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/2ee8f34d21e8febfdefb2b3a403f18a43818d70a/sample_keypath_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(URL, withMethod: .get).responseObject(keyPath: "data") { (response: Response) in + _ = Alamofire.request(URL, method: .get).responseObject(keyPath: "data") { (response: DataResponse) in expectation.fulfill() let mappedObject = response.result.value @@ -131,7 +131,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/97231a04e6e4970612efcc0b7e0c125a83e3de6e/sample_keypath_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(URL, withMethod: .get).responseObject(keyPath: "response.data") { (response: Response) in + _ = Alamofire.request(URL, method: .get).responseObject(keyPath: "response.data") { (response: DataResponse) in expectation.fulfill() let mappedObject = response.result.value @@ -157,7 +157,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/f583be1121dbc5e9b0381b3017718a70c31054f7/sample_array_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(URL, withMethod: .get).responseArray { (response: Response<[Forecast]>) in + _ = Alamofire.request(URL, method: .get).responseArray { (response: DataResponse<[Forecast]>) in expectation.fulfill() let mappedArray = response.result.value @@ -181,7 +181,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/d8bb95982be8a11a2308e779bb9a9707ebe42ede/sample_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(URL, withMethod: .get).responseArray(keyPath: "three_day_forecast") { (response: Response<[Forecast]>) in + _ = Alamofire.request(URL, method: .get).responseArray(keyPath: "three_day_forecast") { (response: DataResponse<[Forecast]>) in expectation.fulfill() @@ -206,7 +206,7 @@ class AlamofireObjectMapperTests: XCTestCase { let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/97231a04e6e4970612efcc0b7e0c125a83e3de6e/sample_keypath_json" let expectation = self.expectation(description: "\(URL)") - _ = Alamofire.request(URL, withMethod: .get).responseArray(keyPath: "response.data.three_day_forecast") { (response: Response<[Forecast]>) in + _ = Alamofire.request(URL, method: .get).responseArray(keyPath: "response.data.three_day_forecast") { (response: DataResponse<[Forecast]>) in expectation.fulfill() diff --git a/Cartfile.resolved b/Cartfile.resolved index 8ba1d02..002d326 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "Alamofire/Alamofire" "a78137ab4559f37219d6b2825552eea5462e4272" -github "Hearst-DD/ObjectMapper" "c4affdd91d2049d98109f197e56a814e2773852f" +github "Alamofire/Alamofire" "78c7b9d7665b9c758709b104513987c2f853d97f" +github "Hearst-DD/ObjectMapper" "16a2c9e9ba4c9949497699a21338d99f58b2686d" diff --git a/Carthage/Checkouts/Alamofire b/Carthage/Checkouts/Alamofire index a78137a..78c7b9d 160000 --- a/Carthage/Checkouts/Alamofire +++ b/Carthage/Checkouts/Alamofire @@ -1 +1 @@ -Subproject commit a78137ab4559f37219d6b2825552eea5462e4272 +Subproject commit 78c7b9d7665b9c758709b104513987c2f853d97f diff --git a/Carthage/Checkouts/ObjectMapper b/Carthage/Checkouts/ObjectMapper index c4affdd..16a2c9e 160000 --- a/Carthage/Checkouts/ObjectMapper +++ b/Carthage/Checkouts/ObjectMapper @@ -1 +1 @@ -Subproject commit c4affdd91d2049d98109f197e56a814e2773852f +Subproject commit 16a2c9e9ba4c9949497699a21338d99f58b2686d From fec7018e11da4f5a0c7e4c2229068f7b226b045a Mon Sep 17 00:00:00 2001 From: Tristan Himmelman Date: Thu, 8 Sep 2016 10:04:37 -0400 Subject: [PATCH 20/27] updated carthage dependencies --- Cartfile.resolved | 4 ++-- Carthage/Checkouts/Alamofire | 2 +- Carthage/Checkouts/ObjectMapper | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cartfile.resolved b/Cartfile.resolved index 002d326..07c213e 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "Alamofire/Alamofire" "78c7b9d7665b9c758709b104513987c2f853d97f" -github "Hearst-DD/ObjectMapper" "16a2c9e9ba4c9949497699a21338d99f58b2686d" +github "Alamofire/Alamofire" "680690beaa7abf9578487688de4d24d038f679b5" +github "Hearst-DD/ObjectMapper" "0ba8034e626f973fc8449081c0463a0de1940b3f" diff --git a/Carthage/Checkouts/Alamofire b/Carthage/Checkouts/Alamofire index 78c7b9d..680690b 160000 --- a/Carthage/Checkouts/Alamofire +++ b/Carthage/Checkouts/Alamofire @@ -1 +1 @@ -Subproject commit 78c7b9d7665b9c758709b104513987c2f853d97f +Subproject commit 680690beaa7abf9578487688de4d24d038f679b5 diff --git a/Carthage/Checkouts/ObjectMapper b/Carthage/Checkouts/ObjectMapper index 16a2c9e..0ba8034 160000 --- a/Carthage/Checkouts/ObjectMapper +++ b/Carthage/Checkouts/ObjectMapper @@ -1 +1 @@ -Subproject commit 16a2c9e9ba4c9949497699a21338d99f58b2686d +Subproject commit 0ba8034e626f973fc8449081c0463a0de1940b3f From 223eb20f427529b3b2bb3c388cdce3e4d5796cae Mon Sep 17 00:00:00 2001 From: Ethan Setnik Date: Thu, 8 Sep 2016 17:28:10 -0400 Subject: [PATCH 21/27] target Alamofire/Alamofire master branch --- .../AlamofireObjectMapper.xcscmblueprint | 37 +++++++++++++++++++ Cartfile | 2 +- Cartfile.resolved | 2 +- Carthage/Checkouts/Alamofire | 2 +- 4 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 AlamofireObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/AlamofireObjectMapper.xcscmblueprint diff --git a/AlamofireObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/AlamofireObjectMapper.xcscmblueprint b/AlamofireObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/AlamofireObjectMapper.xcscmblueprint new file mode 100644 index 0000000..90e2055 --- /dev/null +++ b/AlamofireObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/AlamofireObjectMapper.xcscmblueprint @@ -0,0 +1,37 @@ +{ + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "D712610954CA9BFA7A6E793AC8CA9FD9B6557F56", + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { + + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { + "D712610954CA9BFA7A6E793AC8CA9FD9B6557F56" : 0, + "58AAB0051E2B4EEDF1845A552012E6D0EBAD9127" : 9223372036854775807, + "67620B5EFA902936DF04070AF595B76AB0333747" : 9223372036854775807 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "E216F167-6BBD-4B09-9721-39268CC4E710", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { + "D712610954CA9BFA7A6E793AC8CA9FD9B6557F56" : "AlamofireObjectMapper\/", + "58AAB0051E2B4EEDF1845A552012E6D0EBAD9127" : "AlamofireObjectMapper\/Carthage\/Checkouts\/ObjectMapper\/", + "67620B5EFA902936DF04070AF595B76AB0333747" : "AlamofireObjectMapper\/Carthage\/Checkouts\/Alamofire\/" + }, + "DVTSourceControlWorkspaceBlueprintNameKey" : "AlamofireObjectMapper", + "DVTSourceControlWorkspaceBlueprintVersion" : 204, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "AlamofireObjectMapper.xcodeproj", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "ssh:\/\/github.com\/Hearst-DD\/ObjectMapper.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "58AAB0051E2B4EEDF1845A552012E6D0EBAD9127" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "ssh:\/\/github.com\/Alamofire\/Alamofire.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "67620B5EFA902936DF04070AF595B76AB0333747" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/tristanhimmelman\/Alamofire-ObjectMapper.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "D712610954CA9BFA7A6E793AC8CA9FD9B6557F56" + } + ] +} \ No newline at end of file diff --git a/Cartfile b/Cartfile index 9e70bba..b1c4b50 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ -github "Alamofire/Alamofire" "swift3" +github "Alamofire/Alamofire" "master" github "Hearst-DD/ObjectMapper" "swift-3" diff --git a/Cartfile.resolved b/Cartfile.resolved index 07c213e..02cc41c 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "Alamofire/Alamofire" "680690beaa7abf9578487688de4d24d038f679b5" +github "Alamofire/Alamofire" "ee4d6ce6b4297c8554d441be3d7f53054e89fd7b" github "Hearst-DD/ObjectMapper" "0ba8034e626f973fc8449081c0463a0de1940b3f" diff --git a/Carthage/Checkouts/Alamofire b/Carthage/Checkouts/Alamofire index 680690b..ee4d6ce 160000 --- a/Carthage/Checkouts/Alamofire +++ b/Carthage/Checkouts/Alamofire @@ -1 +1 @@ -Subproject commit 680690beaa7abf9578487688de4d24d038f679b5 +Subproject commit ee4d6ce6b4297c8554d441be3d7f53054e89fd7b From 5f2146466488d6ea44879d29c6c3605e38c576a5 Mon Sep 17 00:00:00 2001 From: Ethan Setnik Date: Thu, 8 Sep 2016 22:02:24 -0400 Subject: [PATCH 22/27] add @discardableResult to silence warnings --- .../xcshareddata/AlamofireObjectMapper.xcscmblueprint | 7 +++++++ AlamofireObjectMapper/AlamofireObjectMapper.swift | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/AlamofireObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/AlamofireObjectMapper.xcscmblueprint b/AlamofireObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/AlamofireObjectMapper.xcscmblueprint index 90e2055..20d07de 100644 --- a/AlamofireObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/AlamofireObjectMapper.xcscmblueprint +++ b/AlamofireObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/AlamofireObjectMapper.xcscmblueprint @@ -6,12 +6,14 @@ "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { "D712610954CA9BFA7A6E793AC8CA9FD9B6557F56" : 0, "58AAB0051E2B4EEDF1845A552012E6D0EBAD9127" : 9223372036854775807, + "C9532DB34657C9B197EE3CA2A5C379A9162E6DF6" : 9223372036854775807, "67620B5EFA902936DF04070AF595B76AB0333747" : 9223372036854775807 }, "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "E216F167-6BBD-4B09-9721-39268CC4E710", "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { "D712610954CA9BFA7A6E793AC8CA9FD9B6557F56" : "AlamofireObjectMapper\/", "58AAB0051E2B4EEDF1845A552012E6D0EBAD9127" : "AlamofireObjectMapper\/Carthage\/Checkouts\/ObjectMapper\/", + "C9532DB34657C9B197EE3CA2A5C379A9162E6DF6" : "..\/..", "67620B5EFA902936DF04070AF595B76AB0333747" : "AlamofireObjectMapper\/Carthage\/Checkouts\/Alamofire\/" }, "DVTSourceControlWorkspaceBlueprintNameKey" : "AlamofireObjectMapper", @@ -28,6 +30,11 @@ "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "67620B5EFA902936DF04070AF595B76AB0333747" }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:5UMU\/sumu_ios.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "C9532DB34657C9B197EE3CA2A5C379A9162E6DF6" + }, { "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/tristanhimmelman\/Alamofire-ObjectMapper.git", "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", diff --git a/AlamofireObjectMapper/AlamofireObjectMapper.swift b/AlamofireObjectMapper/AlamofireObjectMapper.swift index a0caac6..556c1ce 100644 --- a/AlamofireObjectMapper/AlamofireObjectMapper.swift +++ b/AlamofireObjectMapper/AlamofireObjectMapper.swift @@ -91,7 +91,7 @@ extension DataRequest { - returns: The request. */ - + @discardableResult public func responseObject(queue: DispatchQueue? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil, completionHandler: @escaping (DataResponse) -> Void) -> Self { return response(queue: queue, responseSerializer: DataRequest.ObjectMapperSerializer(keyPath, mapToObject: object, context: context), completionHandler: completionHandler) } @@ -137,6 +137,7 @@ extension DataRequest { - returns: The request. */ + @discardableResult public func responseArray(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: @escaping (DataResponse<[T]>) -> Void) -> Self { return response(queue: queue, responseSerializer: DataRequest.ObjectMapperArraySerializer(keyPath, context: context), completionHandler: completionHandler) } From 75054e40d78c5f9a341fb4d6fba41a260056dd4b Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Fri, 9 Sep 2016 15:55:44 -0700 Subject: [PATCH 23/27] Conform functions to BaseMappable See also #462 --- AlamofireObjectMapper/AlamofireObjectMapper.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AlamofireObjectMapper/AlamofireObjectMapper.swift b/AlamofireObjectMapper/AlamofireObjectMapper.swift index 556c1ce..9890b3a 100644 --- a/AlamofireObjectMapper/AlamofireObjectMapper.swift +++ b/AlamofireObjectMapper/AlamofireObjectMapper.swift @@ -46,7 +46,7 @@ extension DataRequest { return returnError } - public static func ObjectMapperSerializer(_ keyPath: String?, mapToObject object: T? = nil, context: MapContext? = nil) -> DataResponseSerializer { + public static func ObjectMapperSerializer(_ keyPath: String?, mapToObject object: T? = nil, context: MapContext? = nil) -> DataResponseSerializer { return DataResponseSerializer { request, response, data, error in guard error == nil else { return .failure(error!) @@ -92,11 +92,11 @@ extension DataRequest { - returns: The request. */ @discardableResult - public func responseObject(queue: DispatchQueue? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil, completionHandler: @escaping (DataResponse) -> Void) -> Self { + public func responseObject(queue: DispatchQueue? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil, completionHandler: @escaping (DataResponse) -> Void) -> Self { return response(queue: queue, responseSerializer: DataRequest.ObjectMapperSerializer(keyPath, mapToObject: object, context: context), completionHandler: completionHandler) } - public static func ObjectMapperArraySerializer(_ keyPath: String?, context: MapContext? = nil) -> DataResponseSerializer<[T]> { + public static func ObjectMapperArraySerializer(_ keyPath: String?, context: MapContext? = nil) -> DataResponseSerializer<[T]> { return DataResponseSerializer { request, response, data, error in guard error == nil else { return .failure(error!) @@ -138,7 +138,7 @@ extension DataRequest { - returns: The request. */ @discardableResult - public func responseArray(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: @escaping (DataResponse<[T]>) -> Void) -> Self { + public func responseArray(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: @escaping (DataResponse<[T]>) -> Void) -> Self { return response(queue: queue, responseSerializer: DataRequest.ObjectMapperArraySerializer(keyPath, context: context), completionHandler: completionHandler) } } From 783508efc27506749cfe90e626d74241dbacec9c Mon Sep 17 00:00:00 2001 From: Ethan Setnik Date: Sun, 11 Sep 2016 15:43:15 -0400 Subject: [PATCH 24/27] update Alamofire v4.0 dependency --- AlamofireObjectMapper.podspec | 2 +- Cartfile | 4 ++-- Cartfile.resolved | 2 +- Carthage/Checkouts/Alamofire | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/AlamofireObjectMapper.podspec b/AlamofireObjectMapper.podspec index bb73663..b5d3f87 100644 --- a/AlamofireObjectMapper.podspec +++ b/AlamofireObjectMapper.podspec @@ -15,6 +15,6 @@ Pod::Spec.new do |s| s.requires_arc = 'true' s.source_files = 'AlamofireObjectMapper/**/*.swift' - s.dependency 'Alamofire', '~> 4.0-beta' + s.dependency 'Alamofire', '~> 4.0' s.dependency 'ObjectMapper', '~> 1.0' end diff --git a/Cartfile b/Cartfile index b1c4b50..cac6d68 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ -github "Alamofire/Alamofire" "master" -github "Hearst-DD/ObjectMapper" "swift-3" +github "Alamofire/Alamofire" ~> 4.0 +github "Hearst-DD/ObjectMapper" "swift-3" diff --git a/Cartfile.resolved b/Cartfile.resolved index 02cc41c..207abe7 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "Alamofire/Alamofire" "ee4d6ce6b4297c8554d441be3d7f53054e89fd7b" +github "Alamofire/Alamofire" "4.0.0" github "Hearst-DD/ObjectMapper" "0ba8034e626f973fc8449081c0463a0de1940b3f" diff --git a/Carthage/Checkouts/Alamofire b/Carthage/Checkouts/Alamofire index ee4d6ce..5fe5b20 160000 --- a/Carthage/Checkouts/Alamofire +++ b/Carthage/Checkouts/Alamofire @@ -1 +1 @@ -Subproject commit ee4d6ce6b4297c8554d441be3d7f53054e89fd7b +Subproject commit 5fe5b201057b0d009d168074ea886b1b59d41626 From f419ad079561af8c257911eb95c78df570a68f26 Mon Sep 17 00:00:00 2001 From: Xi Chen Date: Wed, 14 Sep 2016 14:38:27 +0200 Subject: [PATCH 25/27] Fixed compiler errors following ObjectMapper's 2.0.0 release. --- AlamofireObjectMapper/AlamofireObjectMapper.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/AlamofireObjectMapper/AlamofireObjectMapper.swift b/AlamofireObjectMapper/AlamofireObjectMapper.swift index 9890b3a..bb1c1ce 100644 --- a/AlamofireObjectMapper/AlamofireObjectMapper.swift +++ b/AlamofireObjectMapper/AlamofireObjectMapper.swift @@ -60,7 +60,7 @@ extension DataRequest { let jsonResponseSerializer = DataRequest.jsonResponseSerializer(options: .allowFragments) let result = jsonResponseSerializer.serializeResponse(request, response, data, error) - + let JSONToMap: Any? if let keyPath = keyPath , keyPath.isEmpty == false { JSONToMap = (result.value as AnyObject?)?.value(forKeyPath: keyPath) @@ -69,18 +69,18 @@ extension DataRequest { } if let object = object { - _ = Mapper().map(JSONToMap, toObject: object) + _ = Mapper().map(JSONObject: JSONToMap, toObject: object) return .success(object) - } else if let parsedObject = Mapper(context: context).map(JSONToMap){ + } else if let parsedObject = Mapper(context: context).map(JSONObject: JSONToMap){ return .success(parsedObject) } - + let failureReason = "ObjectMapper failed to serialize response." let error = newError(.dataSerializationFailed, failureReason: failureReason) return .failure(error) } } - + /** Adds a handler to be called once the request has finished. @@ -118,7 +118,7 @@ extension DataRequest { JSONToMap = result.value } - if let parsedObject = Mapper(context: context).mapArray(JSONToMap){ + if let parsedObject = Mapper(context: context).mapArray(JSONObject: JSONToMap){ return .success(parsedObject) } @@ -136,7 +136,7 @@ extension DataRequest { - parameter completionHandler: A closure to be executed once the request has finished and the data has been mapped by ObjectMapper. - returns: The request. - */ + */ @discardableResult public func responseArray(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil, completionHandler: @escaping (DataResponse<[T]>) -> Void) -> Self { return response(queue: queue, responseSerializer: DataRequest.ObjectMapperArraySerializer(keyPath, context: context), completionHandler: completionHandler) From f16365fe5eb33fc17afc2977b2a55eee6b391763 Mon Sep 17 00:00:00 2001 From: Lluis Gerard Date: Wed, 14 Sep 2016 16:55:26 +0100 Subject: [PATCH 26/27] Use ObjectMapper 2.0 for Swift 3 --- AlamofireObjectMapper.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AlamofireObjectMapper.podspec b/AlamofireObjectMapper.podspec index 6963fd0..6491133 100644 --- a/AlamofireObjectMapper.podspec +++ b/AlamofireObjectMapper.podspec @@ -16,5 +16,5 @@ Pod::Spec.new do |s| s.requires_arc = 'true' s.source_files = 'AlamofireObjectMapper/**/*.swift' s.dependency 'Alamofire', '~> 4.0' - s.dependency 'ObjectMapper', '~> 1.0' + s.dependency 'ObjectMapper', '~> 2.0' end From 108d204ec85369906b6961a8f916c8a7da307272 Mon Sep 17 00:00:00 2001 From: Tristan Himmelman Date: Wed, 14 Sep 2016 12:30:43 -0400 Subject: [PATCH 27/27] - Updated tests to support Mappable protocol updates - Updated Cartfile --- .../AlamofireObjectMapperTests.swift | 8 ++++---- Cartfile | 2 +- Cartfile.resolved | 2 +- Carthage/Checkouts/ObjectMapper | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift b/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift index d72bf9d..ae16371 100644 --- a/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift +++ b/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift @@ -234,11 +234,11 @@ class WeatherResponse: Mappable { init(){} - required init?(_ map: Map){ + required init?(map: Map){ } - func mapping(_ map: Map) { + func mapping(map: Map) { location <- map["location"] threeDayForecast <- map["three_day_forecast"] } @@ -249,11 +249,11 @@ class Forecast: Mappable { var temperature: Int? var conditions: String? - required init?(_ map: Map){ + required init?(map: Map){ } - func mapping(_ map: Map) { + func mapping(map: Map) { day <- map["day"] temperature <- map["temperature"] conditions <- map["conditions"] diff --git a/Cartfile b/Cartfile index cac6d68..f8bc7a2 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ github "Alamofire/Alamofire" ~> 4.0 -github "Hearst-DD/ObjectMapper" "swift-3" +github "Hearst-DD/ObjectMapper" ~> 2.0 diff --git a/Cartfile.resolved b/Cartfile.resolved index 207abe7..b036edf 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ github "Alamofire/Alamofire" "4.0.0" -github "Hearst-DD/ObjectMapper" "0ba8034e626f973fc8449081c0463a0de1940b3f" +github "Hearst-DD/ObjectMapper" "2.0.0" diff --git a/Carthage/Checkouts/ObjectMapper b/Carthage/Checkouts/ObjectMapper index 0ba8034..680f5cd 160000 --- a/Carthage/Checkouts/ObjectMapper +++ b/Carthage/Checkouts/ObjectMapper @@ -1 +1 @@ -Subproject commit 0ba8034e626f973fc8449081c0463a0de1940b3f +Subproject commit 680f5cdfe87b94aefce8f94adcbf73adf54c1f37