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

Refactor to test and improve logging #85

Merged
merged 7 commits into from Dec 18, 2019

Conversation

interstateone
Copy link
Contributor

@interstateone interstateone commented Nov 30, 2019

Resolves #34

The goal of this PR is to make it more clear to the user what xcodes is doing during the long-running install command. This is done by adding more console output explaining each step, with emphasis on the unarchiving step. Providing the current step number and total step count should provide a sense of overall progress.

In order to have some confidence in this new implementation and shorten the feedback loop when making changes, some refactoring was done that moved more code into the XcodesKit library target where it can be tested with the help of the Environment type.

Example happy-path output:

❯ swift run xcodes install 11.2
(1/6) Downloading Xcode 11.2.0: 100%
(2/6) Unarchiving Xcode (This can take a while)
(3/6) Moving Xcode to /Applications/Xcode-11.2.0.app
(4/6) Moving Xcode archive Xcode-11.2.0.xip to the Trash
(5/6) Checking security assessment and code signing
(6/6) Finishing installation
xcodes requires superuser privileges in order to finish installation.
macOS User Password: 

Xcode 11.2.0 has been installed to /Applications/Xcode-11.2.0.app

The motivation for this is to be able to test more of the command implementations, and particularly logging during installation.
@interstateone interstateone marked this pull request as ready for review December 11, 2019 03:11
Copy link
Contributor

@MattKiazyk MattKiazyk left a comment

Choose a reason for hiding this comment

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

Tested today with 11.3 - worked as intended.

(1/6) Downloading Xcode 11.3.0: 100%
(2/6) Unarchiving Xcode (This can take a while)
(3/6) Moving Xcode to /Applications/Xcode-11.3.0.app
(4/6) Moving Xcode archive Xcode-11.3.0.xip to the Trash
(5/6) Checking security assessment and code signing
(6/6) Finishing installation
xcodes requires superuser privileges in order to finish installation.
macOS User Password: 

Xcode 11.3.0 has been installed to /Applications/Xcode-11.3.0.app

@interstateone interstateone merged commit aa11a6b into XcodesOrg:master Dec 18, 2019
@interstateone interstateone deleted the 34-improve-logging branch December 18, 2019 20:56
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.

Output more information about current step and progress in install process
2 participants