8000 Better warning message for which Swift version was used during validation by dnkoutso · Pull Request #7131 · CocoaPods/CocoaPods · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Better warning message for which Swift version was used during validation #7131

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

Merged
merged 1 commit into from
Oct 13, 2017

Conversation

dnkoutso
Copy link
Contributor
@dnkoutso dnkoutso commented Oct 12, 2017

closes #7121, fixes regression from #6971 in CocoaPods 1.4.0.beta.1

/cc @thomasvl The validator will only output this message if the user has not provided a swift version via a parameter or via a .swift-version file.

This is how it looks now:

 -> CannonPodder (1.0.5)
    - WARN  | [iOS] swift_version: The validator for Swift projects used Swift 3.0 by default 
because no Swift version was specified. If you want to use a different version of Swift during 
validation, then either use the `--swift-version` parameter or use a `.swift-version` 
file to set the version of Swift to use for your Pod. For example to use Swift 2.3, run: 
`echo "2.3" > .swift-version`
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.

@@ -139,7 +143,7 @@ To install release candidates run `[sudo] gem install cocoapods --pre`

* Fix validation warnings when using --swift-version
[Danielle Tomlinson](https://github.com/dantoml)
[#6971](https://github.com/CocoaPods/CocoaPods/issue/6971)
[#6971](https://github.com/CocoaPods/CocoaPods/pull/6971)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed link

@@ -99,6 +99,7 @@ def self.add_xctest_search_paths(target)
# @return [void]
#
def self.add_swift_version(target, swift_version)
raise 'Cannot empty Swift version to target.' if swift_version.nil?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just being defensive here :)

@@ -256,7 +256,7 @@ def validation_dir
# @return [String] the SWIFT_VERSION to use for validation.
#
def swift_version
return @swift_version if defined?(@swift_version)
return @swift_version unless @swift_version.nil?
Copy link
Contributor Author
@dnkoutso dnkoutso Oct 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the regression fix. @swift_version is always defined but it is nil.

@dnkoutso dnkoutso added this to the 1.4.0 milestone Oct 12, 2017
@dnkoutso dnkoutso force-pushed the swift_doc_and_fix branch 3 times, most recently from 58a5ba9 to 2ccd062 Compare October 12, 2017 21:15
@dnkoutso dnkoutso changed the title Provide better warning message for which Swift version was used durin… Better warning message for which Swift version was used during validation Oct 12, 2017
@dnkoutso dnkoutso force-pushed the swift_doc_and_fix branch 2 times, most recently from 8adf860 to 546cfe7 Compare October 12, 2017 21:19
@dnkoutso
Copy link
Contributor Author

Should go green.

@amorde
Copy link
Member
amorde commented Oct 12, 2017

Looks like this will cause conflicts with #7109

@dnkoutso
Copy link
Contributor Author

That's OK whoever wins the race gets to resolve the conflict :)

@@ -99,6 +99,7 @@ def self.add_xctest_search_paths(target)
# @return [void]
#
def self.add_swift_version(target, swift_version)
raise 'Cannot set empty Swift version to target.' if swift_version.nil?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank? might be what you are looking for here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@dnkoutso
Copy link
Contributor Author

Updated.

@dnkoutso dnkoutso requested review from paulb777 and removed request for justinseanmartin October 13, 2017 17:13
Copy link
Member
@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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.

Document/Improve Swift language version support
4 participants
0