diff --git a/.swiftlint.yml b/.swiftlint.yml index 7b047986..35945f22 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -42,6 +42,7 @@ disabled_rules: - colon - comma - cyclomatic_complexity + - identifier_name trailing_comma: mandatory_comma: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 9815d969..d013d3bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ +## [3.1.1][] (2018-03-31) +- Add support for Swift 4.1. ([#168](https://github.com/mattrubin/OneTimePassword/pull/168)) +- Update build and linter settings for Xcode 9.3. ([#167](https://github.com/mattrubin/OneTimePassword/pull/167)) + + ## [3.1][] (2018-03-27) - Upgrade to Swift 4 and Xcode 9. ([#147](https://github.com/mattrubin/OneTimePassword/pull/147), @@ -143,8 +148,9 @@ Changes between prerelease versions of OneTimePassword version 2 can be found be ## [1.0.0][] (2014-07-17) -[develop]: https://github.com/mattrubin/OneTimePassword/compare/3.1...develop +[develop]: https://github.com/mattrubin/OneTimePassword/compare/3.1.1...develop +[3.1.1]: https://github.com/mattrubin/OneTimePassword/compare/3.1...3.1.1 [3.1]: https://github.com/mattrubin/OneTimePassword/compare/3.0.1...3.1 [3.0.1]: https://github.com/mattrubin/OneTimePassword/compare/3.0...3.0.1 [3.0]: https://github.com/mattrubin/OneTimePassword/compare/2.1.1...3.0 diff --git a/OneTimePassword.podspec b/OneTimePassword.podspec index 710c9760..437c2154 100644 --- a/OneTimePassword.podspec +++ b/OneTimePassword.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "OneTimePassword" - s.version = "3.1" + s.version = "3.1.1" s.summary = "A small library for generating TOTP and HOTP one-time passwords." s.homepage = "https://github.com/mattrubin/OneTimePassword" s.license = "MIT" diff --git a/OneTimePassword.xcodeproj/project.pbxproj b/OneTimePassword.xcodeproj/project.pbxproj index 6b08df04..33062460 100644 --- a/OneTimePassword.xcodeproj/project.pbxproj +++ b/OneTimePassword.xcodeproj/project.pbxproj @@ -521,7 +521,7 @@ attributes = { LastSwiftMigration = 0700; LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 0930; ORGANIZATIONNAME = "Matt Rubin"; TargetAttributes = { 5B39F4931DBD06BA00CD2DAB = { @@ -732,6 +732,7 @@ baseConfigurationReference = C996EC2C1A74D5830076B105 /* Debug.xcconfig */; buildSettings = { IPHONEOS_DEPLOYMENT_TARGET = 8.0; + SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 4.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -742,6 +743,8 @@ baseConfigurationReference = C996EC2E1A74D5830076B105 /* Release.xcconfig */; buildSettings = { IPHONEOS_DEPLOYMENT_TARGET = 8.0; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 4.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; diff --git a/OneTimePassword.xcodeproj/xcshareddata/xcschemes/OneTimePassword (iOS).xcscheme b/OneTimePassword.xcodeproj/xcshareddata/xcschemes/OneTimePassword (iOS).xcscheme index 97fa36ad..02a72571 100644 --- a/OneTimePassword.xcodeproj/xcshareddata/xcschemes/OneTimePassword (iOS).xcscheme +++ b/OneTimePassword.xcodeproj/xcshareddata/xcschemes/OneTimePassword (iOS).xcscheme @@ -1,6 +1,6 @@ + codeCoverageEnabled = "YES" + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -67,7 +66,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/OneTimePassword.xcodeproj/xcshareddata/xcschemes/OneTimePassword (watchOS).xcscheme b/OneTimePassword.xcodeproj/xcshareddata/xcschemes/OneTimePassword (watchOS).xcscheme index af2297cd..02738b64 100644 --- a/OneTimePassword.xcodeproj/xcshareddata/xcschemes/OneTimePassword (watchOS).xcscheme +++ b/OneTimePassword.xcodeproj/xcshareddata/xcschemes/OneTimePassword (watchOS).xcscheme @@ -1,6 +1,6 @@ + codeCoverageEnabled = "YES" + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -47,7 +46,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/OneTimePassword.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/OneTimePassword.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/OneTimePassword.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Sources/Crypto.swift b/Sources/Crypto.swift index ef35a502..d2e7c84f 100644 --- a/Sources/Crypto.swift +++ b/Sources/Crypto.swift @@ -30,7 +30,13 @@ func HMAC(algorithm: Generator.Algorithm, key: Data, data: Data) -> Data { let (hashFunction, hashLength) = algorithm.hashInfo let macOut = UnsafeMutablePointer.allocate(capacity: hashLength) - defer { macOut.deallocate(capacity: hashLength) } + defer { + #if swift(>=4.1) + macOut.deallocate() + #else + macOut.deallocate(capacity: hashLength) + #endif + } key.withUnsafeBytes { keyBytes in data.withUnsafeBytes { dataBytes in diff --git a/Sources/Info.plist b/Sources/Info.plist index 54106c8d..ae3a3e0f 100644 --- a/Sources/Info.plist +++ b/Sources/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 3.1 + 3.1.1 CFBundleSignature ???? CFBundleVersion - 3.1 + 3.1.1 NSPrincipalClass diff --git a/Tests/TokenSerializationTests.swift b/Tests/TokenSerializationTests.swift index 4ef313ba..551809e3 100644 --- a/Tests/TokenSerializationTests.swift +++ b/Tests/TokenSerializationTests.swift @@ -98,9 +98,6 @@ class TokenSerializationTests: XCTestCase { let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false) let items = urlComponents?.queryItems let expectedItemCount = 4 - // SwiftLint gives a false positive here because of a Swift/SourceKit bug. - // See https://github.com/realm/SwiftLint/issues/1785 - // swiftlint:disable vertical_parameter_alignment_on_call XCTAssertEqual(items?.count, expectedItemCount, "There shouldn't be any unexpected query arguments: \(url)") // swiftlint:enable vertical_parameter_alignment_on_call