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

Adding Command Line Tools Installer (for all versions) #378

Closed
wants to merge 8 commits into from
Closed

Adding Command Line Tools Installer (for all versions) #378

wants to merge 8 commits into from

Conversation

BytesGuy
Copy link
Contributor

@BytesGuy BytesGuy commented Feb 26, 2020

Summary

This supersedes #350 from @marcomorain as I used it as a base to work from on this idea.

The idea here is that while we can currently install the latest version of the CLI tools, this only installs the latest version via softwareupdate - this will always be the latest stable version.

Where we are installing beta versions of Xcode, we may wish to install the beta CLI tools that go along with them. This is especially true in the beta images we create at CircleCI.

Usage

xcversion tools will list all version of CLI tools available to download and install:

Screenshot 2020-02-26 at 15 41 27

xcversion tools --install="Command Line Tools for Xcode x.x.x" will install the specified version (e.g., xcversion tools --install="Command Line Tools for Xcode 11.2 beta 2")

screenshot_2020-02-20_at_11 59 11

Implementation

This is piggybacking on the implementation for grabbing Xcode information and downloading it.

Listing the tools will ping the api and parse it, saving a copy of the response to the cache file.

The installation will use the info from the api to find and download the specified tools version. It will then proceed to install by mounting the dmg and installing the pkg. This has a simple check to compare the tools version number we have downloaded to that the version which is installed after the install is complete, just as an extra step of verification (this check will only work on macOS 10.9 and above for now due to the change in the way the CLI tools are packaged)

This will possibly need merging with the current cli.rb and I intend to look into that soon, but thought I would open this PR now to get any feedback!

marcomorain and others added 8 commits September 23, 2019 07:04
It was finding a beta version despite the release one being already available (11.4 beta instead of 11.4).
Now it tries to match the name first and when nothing matches it falls back to matching version.

Resolves #381

Solution proposed here: #381 (comment).
@martinm82
Copy link

@BytesGuy are there any plans to follow-up on this PR? Is anyone reviewing this?

@BytesGuy
Copy link
Contributor Author

@martinm82 No idea to be honest, haven’t seen any activity on this from the repo maintainers. The changes probably need some polishing up (I am very new to Ruby and contributing to OSS) but generally it works - we have had it in production since I wrote the modification and it’s been reliable.

@BytesGuy BytesGuy closed this Sep 19, 2020
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.

4 participants