-
Notifications
You must be signed in to change notification settings - Fork 352
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
[Podspec] Add swift_version
DSL
#417
Conversation
fff33b8
to
9ec2021
Compare
# specification. | ||
# | ||
def swift_versions | ||
@swift_versions ||= if versions = attributes_hash['swift_versions'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need the if versions = attributes_hash['swift_versions']
Does it also need to be set in the cocoapods_versions
method or does that have a default value always set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Requirement
initializer covers the case of nil
or empty string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but i guess we would prefer a nil
value than a Requirement
value with <Pod::Version version=0>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer a nil here for the objective-c pod case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nil here is the right call
|
||
# @!method swift_version=(version) | ||
# | ||
# The version of Swift that the specification supports. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could probably expand slightly more for the end user in which we document how this is used as a "best effort" value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, planning on following up with more info and docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer need to do this, this is just a string.
👍 |
Feels like good foundations 👍 |
:container => Array, | ||
:singularize => true, | ||
:multi_platform => false, | ||
:root_only => true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think root_attribute
by default sets root_only
property to true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup
@dantoml Hello and thanks for improvements. I've noticed same problem with spec dependencies: Cocoapods overrides As a result of |
@dantoml want me to rebase/merge? |
# specification. | ||
# | ||
def swift_versions | ||
@swift_versions ||= if versions = attributes_hash['swift_versions'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nil here is the right call
:container => Array, | ||
:singularize => true, | ||
:multi_platform => false, | ||
:root_only => true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup
|
||
it 'returns the requirement when only one is specified' do | ||
@spec.swift_versions = '= 3.0' | ||
@spec.swift_versions.should == Requirement.new('= 3.0') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: also test nil
@dnkoutso waiting till I have the main pr ready too. I don’t like merging core changes till an integration pr is at least in review |
ah! ok cool sorry didn't know :) |
48264c1
to
135535f
Compare
Updated per our new design decision to scale down and not support ranges. Now This will always be used if the pod author had set it, otherwise we fallback to what we do today. PR for https://github.com/CocoaPods/CocoaPods coming up. |
de995e6
to
51c466e
Compare
Any objections from merging this? |
51c466e
to
7ad59a0
Compare
swift_version
DSL
7ad59a0
to
839ffce
Compare
Going for it! |
Relates to: CocoaPods/CocoaPods#7134