From 6d8f7ec5203fb1bc629162b0a4032ad49bcff790 Mon Sep 17 00:00:00 2001 From: Randal Erman Date: Thu, 4 Apr 2019 14:39:51 -0700 Subject: [PATCH 1/3] Support for Swift 5.0. Modifies project to support english default language. Modifies git ignore to remove xcshareddata and derived data --- .gitignore | 10 ++++++++ ELFoundation.xcodeproj/project.pbxproj | 25 ++++++++++--------- .../xcschemes/ELFoundation.xcscheme | 2 +- .../xcschemes/ELFoundation_osx.xcscheme | 2 +- ELFoundation/Extensions/Array.swift | 2 +- ELFoundation/Extensions/NSBundle.swift | 2 +- ELFoundation/Extensions/NSObject.swift | 4 +-- ELFoundation/Extensions/NSThread.swift | 2 +- ELFoundation/Utilities/Swizzling.swift | 4 +-- 9 files changed, 32 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 712f71d..ef583ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # Xcode # build/ +DerivedData/ + *.pbxuser !default.pbxuser *.mode1v3 @@ -18,6 +20,14 @@ DerivedData *.xcscmblueprint *.xcuserstate + +### Xcode Patch ### +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcworkspace/contents.xcworkspacedata +/*.gcno + # CocoaPods # # We recommend against adding the Pods directory to your .gitignore. However diff --git a/ELFoundation.xcodeproj/project.pbxproj b/ELFoundation.xcodeproj/project.pbxproj index 654b116..a046e98 100644 --- a/ELFoundation.xcodeproj/project.pbxproj +++ b/ELFoundation.xcodeproj/project.pbxproj @@ -403,7 +403,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = WalmartLabs; TargetAttributes = { CA8CD5591B7A9DCA00DA8BF7 = { @@ -418,16 +418,17 @@ }; CACF2A141A9614D20084EFAE = { CreatedOnToolsVersion = 6.3; - LastSwiftMigration = 0920; + LastSwiftMigration = 1020; }; }; }; buildConfigurationList = CACF2A041A9614D20084EFAE /* Build configuration list for PBXProject "ELFoundation" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = CACF2A001A9614D20084EFAE; productRefGroup = CACF2A0B1A9614D20084EFAE /* Products */; @@ -577,6 +578,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -646,7 +648,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = QADeployment; }; @@ -663,8 +665,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.walmartlabs.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = QADeployment; }; @@ -831,6 +832,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -890,6 +892,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -955,7 +958,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -974,7 +977,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -991,8 +994,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.walmartlabs.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -1005,8 +1007,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.walmartlabs.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/ELFoundation.xcodeproj/xcshareddata/xcschemes/ELFoundation.xcscheme b/ELFoundation.xcodeproj/xcshareddata/xcschemes/ELFoundation.xcscheme index f0ec313..79f39b1 100644 --- a/ELFoundation.xcodeproj/xcshareddata/xcschemes/ELFoundation.xcscheme +++ b/ELFoundation.xcodeproj/xcshareddata/xcschemes/ELFoundation.xcscheme @@ -1,6 +1,6 @@ String? { + func reverseBundleIdentifier() -> String? { if let id = bundleIdentifier { let components: [String] = id.components(separatedBy: ".") let reverseComponents = Array(components.reversed()) diff --git a/ELFoundation/Extensions/NSObject.swift b/ELFoundation/Extensions/NSObject.swift index 01dd8be..c943e72 100644 --- a/ELFoundation/Extensions/NSObject.swift +++ b/ELFoundation/Extensions/NSObject.swift @@ -10,12 +10,12 @@ import Foundation public extension NSObject { /// Returns the NSBundle containing self's class. - @objc public static func bundle() -> Bundle { + @objc static func bundle() -> Bundle { return Bundle(for: self) } /// Returns the NSBundle containing self's class. - @objc public func bundle() -> Bundle { + @objc func bundle() -> Bundle { return Swift.type(of: self).bundle() } } diff --git a/ELFoundation/Extensions/NSThread.swift b/ELFoundation/Extensions/NSThread.swift index 68fe9f0..ec4a67a 100644 --- a/ELFoundation/Extensions/NSThread.swift +++ b/ELFoundation/Extensions/NSThread.swift @@ -21,7 +21,7 @@ public extension Thread { - parameter locale: The locale for the date formatter. - returns: The date formatter. */ - public class func dateFormatter(_ format: String, locale: Locale? = Locale.current) -> DateFormatter { + class func dateFormatter(_ format: String, locale: Locale? = Locale.current) -> DateFormatter { let threadDictionary = Thread.current.threadDictionary var cache: Dictionary? = threadDictionary.object(forKey: formatterCacheKey) as? Dictionary diff --git a/ELFoundation/Utilities/Swizzling.swift b/ELFoundation/Utilities/Swizzling.swift index ffcb669..0258fec 100644 --- a/ELFoundation/Utilities/Swizzling.swift +++ b/ELFoundation/Utilities/Swizzling.swift @@ -17,7 +17,7 @@ import Foundation */ public extension NSObject { /// Swizzles a class method on an Objective-C object. - public class func swizzleClassMethod(_ originalSelector: Selector, swizzledSelector:Selector) { + class func swizzleClassMethod(_ originalSelector: Selector, swizzledSelector:Selector) { if let c: AnyClass = object_getClass(self) { let originalMethod = class_getClassMethod(c, originalSelector) let swizzledMethod = class_getClassMethod(c, swizzledSelector) @@ -33,7 +33,7 @@ public extension NSObject { } /// Swizzles an instance method on an Objective-C object. - public class func swizzleInstanceMethod(_ originalSelector: Selector, swizzledSelector:Selector) { + class func swizzleInstanceMethod(_ originalSelector: Selector, swizzledSelector:Selector) { let originalMethod = class_getInstanceMethod(self, originalSelector) let swizzledMethod = class_getInstanceMethod(self, swizzledSelector) From 44b2907e3fb7d77a654e506dc9f10606349c7d5d Mon Sep 17 00:00:00 2001 From: PascalJedi Date: Thu, 4 Apr 2019 14:41:12 -0700 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3162d21..cc9961e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ELFoundation is a collection of Swift utilities for iOS development. ## Requirements -ELFoundation requires Swift 4 and Xcode 9.2. +ELFoundation requires Swift 5 and Xcode 10.2. ## Installation From 1023dd82de8bf54e163bc29ee29bd35f43760ada Mon Sep 17 00:00:00 2001 From: Randal Erman Date: Thu, 4 Apr 2019 15:01:43 -0700 Subject: [PATCH 3/3] Updates project settings --- ELFoundation.xcodeproj/project.pbxproj | 6 +++--- ELFoundation_osx/Info.plist | 4 ++-- README.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ELFoundation.xcodeproj/project.pbxproj b/ELFoundation.xcodeproj/project.pbxproj index a046e98..a3320ba 100644 --- a/ELFoundation.xcodeproj/project.pbxproj +++ b/ELFoundation.xcodeproj/project.pbxproj @@ -626,7 +626,7 @@ ONLY_ACTIVE_ARCH = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0.1; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -881,7 +881,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0.1; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -935,7 +935,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0.1; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; diff --git a/ELFoundation_osx/Info.plist b/ELFoundation_osx/Info.plist index 9194b9b..3b36f0a 100644 --- a/ELFoundation_osx/Info.plist +++ b/ELFoundation_osx/Info.plist @@ -15,13 +15,13 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 3.0.0 + 3.1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSHumanReadableCopyright - Copyright © 2015 WalmartLabs. All rights reserved. + Copyright © 2019 WalmartLabs. All rights reserved. NSPrincipalClass diff --git a/README.md b/README.md index 3162d21..cc9961e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ELFoundation is a collection of Swift utilities for iOS development. ## Requirements -ELFoundation requires Swift 4 and Xcode 9.2. +ELFoundation requires Swift 5 and Xcode 10.2. ## Installation