From 942f25b1951c4b67ac9caf5bfd720e3cbe9a9e28 Mon Sep 17 00:00:00 2001 From: Ajeet Thaevar Date: Thu, 24 Sep 2020 23:04:28 -0500 Subject: [PATCH 01/12] Recommended updates before upgrade to Swift 4.2 --- DuoAPISwift.xcodeproj/project.pbxproj | 18 +++++++++++++++++- .../xcschemes/DuoAPISwift.xcscheme | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/DuoAPISwift.xcodeproj/project.pbxproj b/DuoAPISwift.xcodeproj/project.pbxproj index 1054161..6cc1d06 100644 --- a/DuoAPISwift.xcodeproj/project.pbxproj +++ b/DuoAPISwift.xcodeproj/project.pbxproj @@ -189,7 +189,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 1010; ORGANIZATIONNAME = "Duo Security"; TargetAttributes = { 5708638F1D428B9F00FB86B6 = { @@ -289,14 +289,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -339,14 +347,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; diff --git a/DuoAPISwift.xcodeproj/xcshareddata/xcschemes/DuoAPISwift.xcscheme b/DuoAPISwift.xcodeproj/xcshareddata/xcschemes/DuoAPISwift.xcscheme index a0b9384..035951a 100644 --- a/DuoAPISwift.xcodeproj/xcshareddata/xcschemes/DuoAPISwift.xcscheme +++ b/DuoAPISwift.xcodeproj/xcshareddata/xcschemes/DuoAPISwift.xcscheme @@ -1,6 +1,6 @@ Date: Thu, 24 Sep 2020 23:06:30 -0500 Subject: [PATCH 02/12] Upgrade to Swift 4.2, and defaulting swift3 objc inferences --- DuoAPISwift.xcodeproj/project.pbxproj | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/DuoAPISwift.xcodeproj/project.pbxproj b/DuoAPISwift.xcodeproj/project.pbxproj index 6cc1d06..6cad4aa 100644 --- a/DuoAPISwift.xcodeproj/project.pbxproj +++ b/DuoAPISwift.xcodeproj/project.pbxproj @@ -194,11 +194,11 @@ TargetAttributes = { 5708638F1D428B9F00FB86B6 = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0820; + LastSwiftMigration = 1010; }; 570863991D428B9F00FB86B6 = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0820; + LastSwiftMigration = 1010; }; }; }; @@ -333,6 +333,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -384,6 +385,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -409,7 +411,8 @@ SWIFT_INCLUDE_PATHS = "${SRCROOT}/CommonCrypto"; SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -432,7 +435,8 @@ SKIP_INSTALL = YES; SWIFT_INCLUDE_PATHS = "${SRCROOT}/CommonCrypto"; SWIFT_OBJC_BRIDGING_HEADER = ""; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -444,7 +448,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.duosecurity.DuoAPISwiftTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -456,7 +461,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.duosecurity.DuoAPISwiftTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.2; }; name = Release; }; From 444a2ed909df9ba876feaddfb5ec1ff90bebee3f Mon Sep 17 00:00:00 2001 From: Ajeet Thaevar Date: Thu, 24 Sep 2020 23:07:11 -0500 Subject: [PATCH 03/12] Cleaning up deprecation for future Swift versions --- DuoAPISwift/Extensions.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DuoAPISwift/Extensions.swift b/DuoAPISwift/Extensions.swift index 8bd2af5..b09b2e4 100644 --- a/DuoAPISwift/Extensions.swift +++ b/DuoAPISwift/Extensions.swift @@ -56,7 +56,7 @@ extension String { let keyLen = Int(key.lengthOfBytes(using: String.Encoding.utf8)) CCHmac(algorithm.HMACAlgorithm, keyStr!, keyLen, str!, strLen, result) let digest = stringFromResult(result, length: digestLen) - result.deallocate(capacity: digestLen) + result.deallocate() return digest } From 6395d3a010ab894033ec7890d1ee8da635452997 Mon Sep 17 00:00:00 2001 From: Ajeet Thaevar Date: Fri, 25 Sep 2020 00:33:07 -0500 Subject: [PATCH 04/12] Updating Swift version file --- .swift-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.swift-version b/.swift-version index 9f55b2c..bf77d54 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -3.0 +4.2 From b9126772acee2dcd47cf494d9c993d4b7d621c70 Mon Sep 17 00:00:00 2001 From: Ajeet Thaevar Date: Fri, 25 Sep 2020 00:37:09 -0500 Subject: [PATCH 05/12] Recommended updates before upgrade to Swift 5 --- DuoAPISwift.xcodeproj/project.pbxproj | 7 ++++-- .../xcschemes/DuoAPISwift.xcscheme | 24 ++++++++----------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/DuoAPISwift.xcodeproj/project.pbxproj b/DuoAPISwift.xcodeproj/project.pbxproj index 6cad4aa..78ffa8d 100644 --- a/DuoAPISwift.xcodeproj/project.pbxproj +++ b/DuoAPISwift.xcodeproj/project.pbxproj @@ -189,7 +189,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 1010; + LastUpgradeCheck = 1200; ORGANIZATIONNAME = "Duo Security"; TargetAttributes = { 5708638F1D428B9F00FB86B6 = { @@ -204,10 +204,11 @@ }; buildConfigurationList = 5708638A1D428B9F00FB86B6 /* Build configuration list for PBXProject "DuoAPISwift" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 570863861D428B9F00FB86B6; productRefGroup = 570863911D428B9F00FB86B6 /* Products */; @@ -303,6 +304,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -362,6 +364,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; diff --git a/DuoAPISwift.xcodeproj/xcshareddata/xcschemes/DuoAPISwift.xcscheme b/DuoAPISwift.xcodeproj/xcshareddata/xcschemes/DuoAPISwift.xcscheme index 035951a..e99502c 100644 --- a/DuoAPISwift.xcodeproj/xcshareddata/xcschemes/DuoAPISwift.xcscheme +++ b/DuoAPISwift.xcodeproj/xcshareddata/xcschemes/DuoAPISwift.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -39,17 +48,6 @@ - - - - - - - - Date: Fri, 25 Sep 2020 00:38:20 -0500 Subject: [PATCH 06/12] Upgrade to Swift 5 --- DuoAPISwift.xcodeproj/project.pbxproj | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/DuoAPISwift.xcodeproj/project.pbxproj b/DuoAPISwift.xcodeproj/project.pbxproj index 78ffa8d..ca57ce1 100644 --- a/DuoAPISwift.xcodeproj/project.pbxproj +++ b/DuoAPISwift.xcodeproj/project.pbxproj @@ -194,11 +194,11 @@ TargetAttributes = { 5708638F1D428B9F00FB86B6 = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1010; + LastSwiftMigration = 1200; }; 570863991D428B9F00FB86B6 = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1010; + LastSwiftMigration = 1200; }; }; }; @@ -335,7 +335,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -388,7 +388,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -415,7 +415,7 @@ SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -439,7 +439,7 @@ SWIFT_INCLUDE_PATHS = "${SRCROOT}/CommonCrypto"; SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -452,7 +452,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.duosecurity.DuoAPISwiftTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -465,7 +465,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.duosecurity.DuoAPISwiftTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; From af895aa972bf3cf4e2f4b8806de50cc86366a41e Mon Sep 17 00:00:00 2001 From: Ajeet Thaevar Date: Fri, 25 Sep 2020 00:38:59 -0500 Subject: [PATCH 07/12] Updating swift version file --- .swift-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.swift-version b/.swift-version index bf77d54..819e07a 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -4.2 +5.0 From 91029526234340416ad957d86bd9d3bb5a6df68f Mon Sep 17 00:00:00 2001 From: Ajeet Thaevar Date: Fri, 2 Oct 2020 15:46:11 -0500 Subject: [PATCH 08/12] Build fix: xcode12, macosx10.14 --- .travis.yml | 4 ++-- DuoAPISwift.podspec | 2 +- DuoAPISwift/Info.plist | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 626ea1e..2130349 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: objective-c -osx_image: xcode8.1 +osx_image: xcode12.0 before_install: - gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet script: - set -o pipefail - xcodebuild -version - xcodebuild -showsdks - - xcodebuild -project "DuoAPISwift.xcodeproj" -scheme "DuoAPISwift" -sdk "macosx10.13" build test | xcpretty + - xcodebuild -project "DuoAPISwift.xcodeproj" -scheme "DuoAPISwift" -sdk "macosx10.14" build test | xcpretty - pod lib lint diff --git a/DuoAPISwift.podspec b/DuoAPISwift.podspec index 5662a8c..01fac55 100644 --- a/DuoAPISwift.podspec +++ b/DuoAPISwift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = "DuoAPISwift" - spec.version = "2.1.0" + spec.version = "2.2.0" spec.summary = "Duo Security API client for Swift." spec.homepage = "https://github.com/duosecurity/duo_api_swift" spec.license = { type: 'BSD', file: 'LICENSE' } diff --git a/DuoAPISwift/Info.plist b/DuoAPISwift/Info.plist index ae750fc..34eb653 100644 --- a/DuoAPISwift/Info.plist +++ b/DuoAPISwift/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.1.0 + 2.2.0 CFBundleSignature ???? CFBundleVersion From 046f06755614d6c37f79ee138e0ef40b4bcf4e75 Mon Sep 17 00:00:00 2001 From: Ajeet Thaevar Date: Fri, 2 Oct 2020 15:55:58 -0500 Subject: [PATCH 09/12] Fixing gem params --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2130349..7aff999 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: objective-c osx_image: xcode12.0 before_install: - - gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet + - gem install cocoapods --pre --no-document --quiet script: - set -o pipefail - xcodebuild -version From 088cd23eec41a41a4110ddf47af4e381e25122f7 Mon Sep 17 00:00:00 2001 From: Ajeet Thaevar Date: Fri, 2 Oct 2020 16:10:05 -0500 Subject: [PATCH 10/12] SDK 10.14 is not available on travis, so downgrading to 10.13 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7aff999..b60852c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,5 @@ script: - set -o pipefail - xcodebuild -version - xcodebuild -showsdks - - xcodebuild -project "DuoAPISwift.xcodeproj" -scheme "DuoAPISwift" -sdk "macosx10.14" build test | xcpretty + - xcodebuild -project "DuoAPISwift.xcodeproj" -scheme "DuoAPISwift" -sdk "macosx10.13" build test | xcpretty - pod lib lint From dbb5224b9b43dc49df30f753c5840c421ee3b2da Mon Sep 17 00:00:00 2001 From: Ajeet Thaevar Date: Mon, 5 Oct 2020 12:21:53 -0500 Subject: [PATCH 11/12] Cleaning up deprecation --- .swift-version | 1 - DuoAPISwift.podspec | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 .swift-version diff --git a/.swift-version b/.swift-version deleted file mode 100644 index 819e07a..0000000 --- a/.swift-version +++ /dev/null @@ -1 +0,0 @@ -5.0 diff --git a/DuoAPISwift.podspec b/DuoAPISwift.podspec index 01fac55..285e963 100644 --- a/DuoAPISwift.podspec +++ b/DuoAPISwift.podspec @@ -19,4 +19,5 @@ Pod::Spec.new do |spec| } spec.source_files = "DuoAPISwift/**/*.{h,swift}" spec.resources = ['DuoAPISwift/Trusted\ CA\ Certificates/*.der'] + spec.swift_versions = ['5.0'] end From ae5a7371f07f75b94ece83907590d3b8bd18b7e0 Mon Sep 17 00:00:00 2001 From: Ajeet Thaevar Date: Mon, 5 Oct 2020 13:14:22 -0500 Subject: [PATCH 12/12] targetting xcode11.6 to get sdk macos 10.15 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b60852c..f387000 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: objective-c -osx_image: xcode12.0 +osx_image: xcode11.6 before_install: - gem install cocoapods --pre --no-document --quiet script: - set -o pipefail - xcodebuild -version - xcodebuild -showsdks - - xcodebuild -project "DuoAPISwift.xcodeproj" -scheme "DuoAPISwift" -sdk "macosx10.13" build test | xcpretty + - xcodebuild -project "DuoAPISwift.xcodeproj" -scheme "DuoAPISwift" -sdk "macosx10.15" build test | xcpretty - pod lib lint