-
Notifications
You must be signed in to change notification settings - Fork 28.8k
Ensure Xcode major, minor version always return non-null #10980
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
Conversation
Previously, xcodeMajorVersion and xcodeMinorVersion returned null unless xcodeVersionSatisfactory had been called first. We now compute them on demand, and cache the resultant values.
|
||
final String version = match.group(1); | ||
final List<String> components = version.split('.'); | ||
_xcodeMajorVersion = int.parse(components[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.
Looks like xcodeVersionSatisfactory
needs an update too (it updates _xcodeMajorVersion
and _xcodeMinorVersion
)
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.
That's what I get for picking this up on a Monday after writing most of it on a Friday! Done.
_xcodeMajorVersion = int.parse(components[0]); | ||
_xcodeMinorVersion = components.length == 1 ? 0 : int.parse(components[1]); | ||
} on ProcessException { | ||
// Ignore: return null below. |
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.
This isn't right any more.
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.
Good point - updated comment text.
Previously, xcodeMajorVersion and xcodeMinorVersion returned null unless xcodeVersionSatisfactory had been called first. We now compute them on demand, and cache the resultant values.
Previously, xcodeMajorVersion and xcodeMinorVersion returned null unless
xcodeVersionSatisfactory had been called first. We now compute them on
demand, and cache the resultant values.