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

Add support for and default to Xcode Releases data source #129

Merged
merged 6 commits into from
Feb 2, 2021

Conversation

interstateone
Copy link
Contributor

This adds support for Xcode Releases as a data source for available Xcode versions, and makes it the default. It's still possible to use the Apple data source by providing the --data-source=apple option. The motivation for this is that while the data is unofficial it is more complete and reliable than scraping the Apple Developer website. This code is all taken from (with some small changes) Xcodes.app.

Two other changes come along with this:

  • Previously build identifiers (for example "12C33" for the final 12.3 release) were only shown for non-final release versions. I think there's value in showing this for all versions since sometimes you need to figure out exactly what versions are installed or available, for example when Apple releases a final version that was the same build as a release candidate. This is now done when versions are printed in a list (list, installed, select).
  • Version comparison has been simplified in most cases. It's still a little fuzzy when parsing version strings from the user, which is expected.

Testing

swift run xcodes update first to make sure you have Xcode Releases data, and then use other commands and make sure they still work the way you expect.

You can do the same after running swift run xcodes update --data-source=apple to make sure the Apple one still works, except for the issue noted in #123.


I'm going to say that this fixes #123 for now. We could invest more time into making the Apple data source work perfectly but part of the motivation for adding Xcode Releases support is to not have to do that. If another contributor wishes to do so we'd welcome that change.

Copy link
Contributor

@senmu senmu left a comment

Choose a reason for hiding this comment

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

Works great for me. Just had a minor suggestion to avoid repetition

Sources/XcodesKit/Version+.swift Outdated Show resolved Hide resolved
Sources/XcodesKit/Version+.swift Outdated Show resolved Hide resolved
@interstateone interstateone merged commit 09532d0 into XcodesOrg:main Feb 2, 2021
@interstateone interstateone added the enhancement New feature or request label Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Release candidate prerelease identifiers aren't being handled correctly
2 participants