Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation with CocoaPods #157

Merged
merged 3 commits into from
Mar 8, 2018
Merged

Fix compilation with CocoaPods #157

merged 3 commits into from
Mar 8, 2018

Conversation

mattrubin
Copy link
Owner

@mattrubin mattrubin commented Mar 8, 2018

Since the release of Xcode 9, CocoaPods has been building OneTimePassword with Swift 4, even though it should be compiled with Swift 3.2, leading to compilation errors (see #152). Apparently, CocoaPods uses the version of Swift defined in the .swift-version file when validating a podspec, but not when installing the pod.

This PR fixes #152 in two different ways:

  • The new swift_version attribute (added in CocoaPods 1.4.0) indicates the pod should be built with Swift 3.2.
  • Removing the Token.defaultName and Token.defaultIssuer constants protects against build errors in the case where CocoaPods mistakenly uses Swift 4 again.

This PR also bumps the project version number to 3.0.1, in preparation for a new release.

Previously, CocoaPods would use the .swift-version file to specify the Swift version of a project when validating the podspec, but not when installing the pod. The new swift_version attribute added in CocoaPods 1.4.0 provides a Swift version to be used by the installed pod.
Swift 4 does not allow internal values to be used as default parameter values for public functions. While the project is still configured to build with Swift 3.2, this change should allow for building with Swift 4.0 if a build tool (such as CocoaPods) doesn't respect the project's specified Swift version.
@codecov
Copy link

codecov bot commented Mar 8, 2018

Codecov Report

Merging #157 into hotfix will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           hotfix     #157   +/-   ##
=======================================
  Coverage   95.74%   95.74%           
=======================================
  Files           6        6           
  Lines         470      470           
  Branches       30       30           
=======================================
  Hits          450      450           
  Misses         20       20
Impacted Files Coverage Δ
Sources/Token+URL.swift 98.69% <100%> (ø) ⬆️
Sources/Token.swift 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c099be...4475beb. Read the comment docs.

@mattrubin mattrubin merged commit 52bd116 into hotfix Mar 8, 2018
@mattrubin mattrubin deleted the cocoapods-hotfix branch March 8, 2018 07:49
@mattrubin mattrubin added this to the 3.0.1 milestone Mar 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant