From 2c44e985e3627612dbdc8e53c14c77d06df9a23f Mon Sep 17 00:00:00 2001 From: Xin Date: Sun, 8 Apr 2018 14:36:01 +0800 Subject: [PATCH] xcode 9.3 --- .travis.yml | 4 ++-- Example.xcodeproj/project.pbxproj | 6 +++++- .../hongxin.xcuserdatad/xcschemes/Example.xcscheme | 4 +--- Example/Cartfile.resolved | 2 +- Example/EventsViewController.swift | 2 +- Example/ExampleViewController.swift | 2 +- Example/Info.plist | 4 ++-- Example/ProjectsViewController.swift | 2 +- Example/Transformers/ArrayValueTransformer.swift | 2 +- ManagedObjectAdapter.xcodeproj/project.pbxproj | 6 +++++- .../xcschemes/ManagedObjectAdapter iOS.xcscheme | 4 +--- .../xcschemes/ManagedObjectAdapter watchOS.xcscheme | 4 +--- .../xcschemes/ManagedObjectAdapterTests.xcscheme | 4 +--- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ ManagedObjectAdapter/ManagedObjectAdapter.swift | 2 +- ManagedObjectAdapter/ManagedObjectSerializing.swift | 2 +- ManagedObjectAdapter/Supporting Files/Info-iOS.plist | 2 +- ManagedObjectAdapter/Supporting Files/Info-watchOS.plist | 2 +- ManagedObjectAdapterTests/Info.plist | 2 +- 19 files changed, 36 insertions(+), 28 deletions(-) create mode 100644 ManagedObjectAdapter.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/.travis.yml b/.travis.yml index 8ebce74..6c74986 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ language: objective-c -osx_image: xcode9 +osx_image: xcode9.3 script: -- xcodebuild build test -workspace ManagedObjectAdapter.xcworkspace -scheme 'ManagedObjectAdapter iOS' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone X,OS=11.0' +- xcodebuild build test -workspace ManagedObjectAdapter.xcworkspace -scheme 'ManagedObjectAdapter iOS' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone X,OS=11.3' diff --git a/Example.xcodeproj/project.pbxproj b/Example.xcodeproj/project.pbxproj index bcf6821..e04ce4f 100644 --- a/Example.xcodeproj/project.pbxproj +++ b/Example.xcodeproj/project.pbxproj @@ -191,7 +191,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 0930; ORGANIZATIONNAME = Teambition; TargetAttributes = { D3283CA91D48812300E1B445 = { @@ -300,12 +300,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -354,12 +356,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; diff --git a/Example.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/Example.xcscheme b/Example.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/Example.xcscheme index ee68f25..8525d92 100644 --- a/Example.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/Example.xcscheme +++ b/Example.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/Example.xcscheme @@ -1,6 +1,6 @@ @@ -46,7 +45,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Example/Cartfile.resolved b/Example/Cartfile.resolved index 3e94aa3..7b5372c 100644 --- a/Example/Cartfile.resolved +++ b/Example/Cartfile.resolved @@ -1 +1 @@ -github "Hearst-DD/ObjectMapper" "3.0.0" +github "Hearst-DD/ObjectMapper" "3.1.0" diff --git a/Example/EventsViewController.swift b/Example/EventsViewController.swift index f7f9aaf..1000b8b 100644 --- a/Example/EventsViewController.swift +++ b/Example/EventsViewController.swift @@ -49,7 +49,7 @@ class EventsViewController: UITableViewController { return } - guard let events = json?.flatMap({ (object) -> Event? in + guard let events = json?.compactMap({ (object) -> Event? in return Event(object) }) else { return diff --git a/Example/ExampleViewController.swift b/Example/ExampleViewController.swift index 7b7505f..4d166ce 100644 --- a/Example/ExampleViewController.swift +++ b/Example/ExampleViewController.swift @@ -58,7 +58,7 @@ class ExampleViewController: UITableViewController { return } - guard let organizations = json?.flatMap({ (object) -> Organization? in + guard let organizations = json?.compactMap({ (object) -> Organization? in return Organization(object) }) else { return diff --git a/Example/Info.plist b/Example/Info.plist index a90bf0a..cd3eff8 100644 --- a/Example/Info.plist +++ b/Example/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.0.4 + 0.0.5 CFBundleSignature ???? CFBundleVersion - 4 + 5 LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/Example/ProjectsViewController.swift b/Example/ProjectsViewController.swift index 8b16ee2..5601146 100644 --- a/Example/ProjectsViewController.swift +++ b/Example/ProjectsViewController.swift @@ -57,7 +57,7 @@ class ProjectsViewController: UITableViewController { return } - guard let projects = json?.flatMap({ (object) -> Project? in + guard let projects = json?.compactMap({ (object) -> Project? in return Project(object) }) else { return diff --git a/Example/Transformers/ArrayValueTransformer.swift b/Example/Transformers/ArrayValueTransformer.swift index 85ffcab..dbee404 100644 --- a/Example/Transformers/ArrayValueTransformer.swift +++ b/Example/Transformers/ArrayValueTransformer.swift @@ -23,7 +23,7 @@ class ArrayValueTransformer: ValueTransformer { guard let jsonArray = NSKeyedUnarchiver.unarchiveObject(with: data) as? [Any] else { return nil } - return jsonArray.flatMap { Mapper().map(JSONObject: $0) } + return jsonArray.compactMap { Mapper().map(JSONObject: $0) } } return nil } diff --git a/ManagedObjectAdapter.xcodeproj/project.pbxproj b/ManagedObjectAdapter.xcodeproj/project.pbxproj index 02d9300..94da95c 100644 --- a/ManagedObjectAdapter.xcodeproj/project.pbxproj +++ b/ManagedObjectAdapter.xcodeproj/project.pbxproj @@ -195,7 +195,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 0930; ORGANIZATIONNAME = Teambition; TargetAttributes = { D3283C951D4880C500E1B445 = { @@ -308,12 +308,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -365,12 +367,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; diff --git a/ManagedObjectAdapter.xcodeproj/xcshareddata/xcschemes/ManagedObjectAdapter iOS.xcscheme b/ManagedObjectAdapter.xcodeproj/xcshareddata/xcschemes/ManagedObjectAdapter iOS.xcscheme index 718edbb..bd5c3d3 100644 --- a/ManagedObjectAdapter.xcodeproj/xcshareddata/xcschemes/ManagedObjectAdapter iOS.xcscheme +++ b/ManagedObjectAdapter.xcodeproj/xcshareddata/xcschemes/ManagedObjectAdapter iOS.xcscheme @@ -1,6 +1,6 @@ @@ -37,7 +36,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/ManagedObjectAdapter.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/ManagedObjectAdapterTests.xcscheme b/ManagedObjectAdapter.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/ManagedObjectAdapterTests.xcscheme index 23ff4fb..84052d5 100644 --- a/ManagedObjectAdapter.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/ManagedObjectAdapterTests.xcscheme +++ b/ManagedObjectAdapter.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/ManagedObjectAdapterTests.xcscheme @@ -1,6 +1,6 @@ + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ManagedObjectAdapter/ManagedObjectAdapter.swift b/ManagedObjectAdapter/ManagedObjectAdapter.swift index fcc507d..13587d4 100644 --- a/ManagedObjectAdapter/ManagedObjectAdapter.swift +++ b/ManagedObjectAdapter/ManagedObjectAdapter.swift @@ -93,7 +93,7 @@ public extension ManagedObjectSerializing { var models: [Any]? perform(in: managedObject.managedObjectContext, block: { if let relationshipCollection = value { - models = (relationshipCollection as AnyObject).objectEnumerator().allObjects.flatMap({ (object) -> Any? in + models = (relationshipCollection as AnyObject).objectEnumerator().allObjects.compactMap({ (object) -> Any? in if let nestedManagedObject = object as? NSManagedObject, let nestedClass = nestedClass as? ManagedObjectSerializing.Type { return nestedClass.model(from: nestedManagedObject, processedModels: mutableProcessedModels) } diff --git a/ManagedObjectAdapter/ManagedObjectSerializing.swift b/ManagedObjectAdapter/ManagedObjectSerializing.swift index 0ec4851..1010487 100644 --- a/ManagedObjectAdapter/ManagedObjectSerializing.swift +++ b/ManagedObjectAdapter/ManagedObjectSerializing.swift @@ -56,7 +56,7 @@ public extension ManagedObjectSerializing { var keys = [String]() var currentMirror = Mirror(reflecting: self) while true { - keys.append(contentsOf: currentMirror.children.flatMap { $0.label }) + keys.append(contentsOf: currentMirror.children.compactMap { $0.label }) if let superMirror = currentMirror.superclassMirror { currentMirror = superMirror } else { diff --git a/ManagedObjectAdapter/Supporting Files/Info-iOS.plist b/ManagedObjectAdapter/Supporting Files/Info-iOS.plist index 826542e..2a44702 100644 --- a/ManagedObjectAdapter/Supporting Files/Info-iOS.plist +++ b/ManagedObjectAdapter/Supporting Files/Info-iOS.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.0.4 + 0.0.5 CFBundleSignature ???? CFBundleVersion diff --git a/ManagedObjectAdapter/Supporting Files/Info-watchOS.plist b/ManagedObjectAdapter/Supporting Files/Info-watchOS.plist index 826542e..2a44702 100644 --- a/ManagedObjectAdapter/Supporting Files/Info-watchOS.plist +++ b/ManagedObjectAdapter/Supporting Files/Info-watchOS.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.0.4 + 0.0.5 CFBundleSignature ???? CFBundleVersion diff --git a/ManagedObjectAdapterTests/Info.plist b/ManagedObjectAdapterTests/Info.plist index 291b256..0d7111d 100644 --- a/ManagedObjectAdapterTests/Info.plist +++ b/ManagedObjectAdapterTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 0.0.4 + 0.0.5 CFBundleSignature ???? CFBundleVersion