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

feat(shorebird_cli): add xcodeVersion method to xcodebuild wrapper #1360

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

bryanoltman
Copy link
Contributor

Description

Adds the ability to get the currently installed Xcode version using xcodebuild -version.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (e584432) 100.00% compared to head (91173dd) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1360   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          152       152           
  Lines         4434      4446   +12     
=========================================
+ Hits          4434      4446   +12     
Flag Coverage Δ
shorebird_cli 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
.../shorebird_cli/lib/src/executables/xcodebuild.dart 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

);
}

// [Version.parse] requires a patch number. If Xcode does not report a patch
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this will work for all XCode versions and/or whether it would be easier and less error-prone to try to parse the version as a double and see if it’s greater than 15 since clearly XCode doesn’t follow semver I’m not sure this would be the only issue we encounter (for example if there’s a beta version of XCode do we handle that correctly with this logic). 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we should probably be consistent with the flutter_tool in this case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good Q about the beta, let me download one and give that a shot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interestingly, Xcode betas don't report that they're beta in xcodebuild -version:

⑆ xcrun xcodebuild -version
Xcode 15.1
Build version 15C5028h

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To resolve this, I don't think parsing it as a double would work, as there is occasionally a patch version.

@bryanoltman bryanoltman merged commit 9925017 into main Oct 5, 2023
@bryanoltman bryanoltman deleted the bo/xcode-version branch October 5, 2023 17:47
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.

2 participants