Skip to content

Commit

Permalink
Merge pull request #13 from duosecurity/upgrade-swift-5
Browse files Browse the repository at this point in the history
Upgrade swift 5
  • Loading branch information
mikegb authored Oct 5, 2020
2 parents da75f88 + ae5a737 commit b730470
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 29 deletions.
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
language: objective-c
osx_image: xcode8.1
osx_image: xcode11.6
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
- 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
3 changes: 2 additions & 1 deletion DuoAPISwift.podspec
Original file line number Diff line number Diff line change
@@ -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' }
Expand All @@ -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
41 changes: 33 additions & 8 deletions DuoAPISwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -189,25 +189,26 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 1200;
ORGANIZATIONNAME = "Duo Security";
TargetAttributes = {
5708638F1D428B9F00FB86B6 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0820;
LastSwiftMigration = 1200;
};
570863991D428B9F00FB86B6 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0820;
LastSwiftMigration = 1200;
};
};
};
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 */;
Expand Down Expand Up @@ -289,14 +290,23 @@
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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
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;
Expand Down Expand Up @@ -325,6 +335,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -339,14 +350,23 @@
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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
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;
Expand All @@ -368,6 +388,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -393,7 +414,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 = 5.0;
};
name = Debug;
};
Expand All @@ -416,7 +438,8 @@
SKIP_INSTALL = YES;
SWIFT_INCLUDE_PATHS = "${SRCROOT}/CommonCrypto";
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -428,7 +451,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 = 5.0;
};
name = Debug;
};
Expand All @@ -440,7 +464,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 = 5.0;
};
name = Release;
};
Expand Down
24 changes: 10 additions & 14 deletions DuoAPISwift.xcodeproj/xcshareddata/xcschemes/DuoAPISwift.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -27,6 +27,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5708638F1D428B9F00FB86B6"
BuildableName = "DuoAPISwift.framework"
BlueprintName = "DuoAPISwift"
ReferencedContainer = "container:DuoAPISwift.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -39,17 +48,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5708638F1D428B9F00FB86B6"
BuildableName = "DuoAPISwift.framework"
BlueprintName = "DuoAPISwift"
ReferencedContainer = "container:DuoAPISwift.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -70,8 +68,6 @@
ReferencedContainer = "container:DuoAPISwift.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
2 changes: 1 addition & 1 deletion DuoAPISwift/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion DuoAPISwift/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.1.0</string>
<string>2.2.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit b730470

Please sign in to comment.