xcode-install 2.3.1 → 2.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 94d2ba944e260009634b80f9962d20322fd1f902
4
- data.tar.gz: eeefd86022b7f7b2649c2d336b74edcb86fae74e
2
+ SHA256:
3
+ metadata.gz: 0fea81231fe9d81aed11e53e9340d8749cb90b12b61cf455ef216c4659beaf85
4
+ data.tar.gz: d385404265a3453ff25f3f6c2c532235ca7ed9769e0c1b808c64749f930f6eca
5
5
  SHA512:
6
- metadata.gz: 0c35741166c044efbf422f5957bcb8527b6935ed0c8177d02f890d6ef5ee2b96bf46bfe379931317f5aca5491a387b199b08fe4e099299b406d2944530e802e1
7
- data.tar.gz: 58e3d669156fe437fb0519be9f2c08e2a987bda6c7c859cfd2c4019d6bd97a01fac06fc18ed5bd73bfe7712ebbde62e70794f8b33d428574d010b0523230ed74
6
+ metadata.gz: 4147ef290648e0f0ac2122be32a2cc0d4fd26d3c9509767661107527fe20e58534bab89c505d992a876202a40effa7913b3901e24f504952839e5f416d011503
7
+ data.tar.gz: fa470926afe6472b552bd7be37619542024913101997df6e00a47064714199594c6c0dafbf1a41c07aa79ea1cb22e35f3cca75a1bbce8bb068b9453ec7bc6a6d
@@ -0,0 +1,33 @@
1
+ version: 2
2
+
3
+ jobs:
4
+ build:
5
+ macos:
6
+ xcode: "9.0"
7
+ working_directory: ~/xcode-install
8
+ shell: /bin/bash --login -eo pipefail
9
+ steps:
10
+ - checkout
11
+
12
+ # See Also: https://discuss.circleci.com/t/circleci-2-0-ios-error-installing-gems/23291/4
13
+ - run:
14
+ name: Set Ruby Version
15
+ command: echo "ruby-2.4" > ~/.ruby-version
16
+
17
+ - run:
18
+ name: Install ruby dependencies
19
+ command: bundle install
20
+
21
+ - run:
22
+ name: Run test
23
+ command: bundle exec rake spec
24
+
25
+ - run:
26
+ name: Run lint
27
+ command: bundle exec rake rubocop
28
+
29
+ workflows:
30
+ version: 2
31
+ build_and_test:
32
+ jobs:
33
+ - build
@@ -0,0 +1,36 @@
1
+ name: "CI"
2
+ on: [pull_request]
3
+
4
+ jobs:
5
+ build:
6
+ strategy:
7
+ fail-fast: false
8
+ matrix:
9
+ ruby: ["2.5", "2.6"]
10
+
11
+ runs-on: macos-latest
12
+ steps:
13
+ # Setup env
14
+ - uses: actions/checkout@v2
15
+ - uses: actions/setup-ruby@v1
16
+ with:
17
+ ruby-version: "${{ matrix.ruby }}"
18
+
19
+ # Show env
20
+ - name: Show macOS version
21
+ run: sw_vers
22
+ - name: Show ruby version
23
+ run: |
24
+ ruby --version
25
+ bundler --version
26
+
27
+ # Prepare
28
+ - name: Install bundler 1.7
29
+ run: gem install bundler -v "~> 1.7"
30
+ - name: Install ruby dependencies
31
+ run: bundle install -j4 --clean --path=vendor
32
+
33
+ - name: Run test
34
+ run: bundle exec rake spec
35
+ - name: Run lint
36
+ run: bundle exec rake rubocop
data/.gitignore CHANGED
@@ -13,3 +13,4 @@
13
13
  *.a
14
14
  mkmf.log
15
15
  .DS_Store
16
+ test
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Xcode::Install
2
2
 
3
- [![Gem Version](http://img.shields.io/gem/v/xcode-install.svg?style=flat)](http://badge.fury.io/rb/xcode-install)
3
+ [![Gem Version](http://img.shields.io/gem/v/xcode-install.svg?style=flat)](http://badge.fury.io/rb/xcode-install) [![CircleCI](https://circleci.com/gh/xcpretty/xcode-install.svg?style=svg)](https://circleci.com/gh/xcpretty/xcode-install)
4
4
 
5
5
  Install and update your Xcodes automatically.
6
6
 
@@ -9,6 +9,8 @@ $ gem install xcode-install
9
9
  $ xcversion install 6.3
10
10
  ```
11
11
 
12
+ This tool uses the [Downloads for Apple Developer](https://developer.apple.com/download/more/) page.
13
+
12
14
  ## Installation
13
15
 
14
16
  ```
@@ -34,6 +36,8 @@ XCODE_INSTALL_USER
34
36
  XCODE_INSTALL_PASSWORD
35
37
  ```
36
38
 
39
+ ### List
40
+
37
41
  To list available versions:
38
42
 
39
43
  ```
@@ -41,17 +45,21 @@ $ xcversion list
41
45
  6.0.1
42
46
  6.1
43
47
  6.1.1
44
- 6.2
48
+ 6.2 (installed)
45
49
  6.3
46
50
  ```
47
51
 
48
- Installed versions will be omitted and by default, only the latest major version is listed.
52
+ Already installed versions are marked with `(installed)`.
53
+ (Use `$ xcversion installed` to only list installed Xcodes with their path).
54
+
55
+ To update the list of available versions, run:
49
56
 
50
- To list all available versions run
51
57
  ```
52
- $ xcversion list --all
58
+ $ xcversion update
53
59
  ```
54
60
 
61
+ ### Install
62
+
55
63
  To install a certain version, simply:
56
64
 
57
65
  ```
@@ -64,7 +72,10 @@ Xcode 8
64
72
  Build version 6D570
65
73
  ```
66
74
 
67
- This will download and install that version of Xcode. It will also be automatically selected.
75
+ This will download and install that version of Xcode. Then you can start it from `/Applications` as usual.
76
+ The new version will also be automatically selected for CLI commands (see below).
77
+
78
+ #### GMs and beta versions
68
79
 
69
80
  Note: GMs and beta versions usually have special names, e.g.
70
81
 
@@ -74,7 +85,24 @@ $ xcversion list
74
85
  7.1 beta
75
86
  ```
76
87
 
77
- they have to be installed using the full name, e.g. `xcversion install '7 GM seed'`.
88
+ They have to be installed using the full name, e.g. `xcversion install '7 GM seed'`.
89
+
90
+ ### Select
91
+
92
+ To see the currently selected version, run
93
+ ```
94
+ $ xcversion selected
95
+ ```
96
+
97
+ To select a version as active, run
98
+ ```
99
+ $ xcversion select 8
100
+ ```
101
+
102
+ To select a version as active and change the symlink at `/Applications/Xcode`, run
103
+ ```
104
+ $ xcversion select 8 --symlink
105
+ ```
78
106
 
79
107
  ### Command Line Tools
80
108
 
@@ -121,12 +149,16 @@ XcodeInstall automatically installs additional components so that it is immediat
121
149
  commandline. Unfortunately, Xcode will load third-party plugins even in that situation, which leads
122
150
  to a dialog popping up. Feel free to dupe [the radar][5]. 📡
123
151
 
124
- XcodeInstall uses the Spotlight index to locate installed versions of Xcode. If you use it while
152
+ XcodeInstall normally relies on the Spotlight index to locate installed versions of Xcode. If you use it while
125
153
  indexing is happening, it might show inaccurate results and it will not be able to see installed
126
- versions on unindexed volumes.
154
+ versions on unindexed volumes.
155
+
156
+ To workaround the Spotlight limitation, XcodeInstall searches `/Applications` folder to locate Xcodes when Spotlight is disabled on the machine, or when Spotlight query for Xcode does not return any results. But it still won't work if your Xcodes are not located under `/Applications` folder.
127
157
 
128
158
  ## Thanks
129
159
 
160
+ Thanks to [@neonichu](https://github.com/neonichu), the original (and best) author.
161
+
130
162
  [This][3] downloading script which has been used for some inspiration, also [this][4]
131
163
  for doing the installation. Additionally, many thanks to everyone who has contributed to this
132
164
  project, especially [@henrikhodne][6] and [@lacostej][7] for making XcodeInstall C extension free.
@@ -139,6 +171,18 @@ project, especially [@henrikhodne][6] and [@lacostej][7] for making XcodeInstall
139
171
  4. Push to the branch (`git push origin my-new-feature`)
140
172
  5. Create a new Pull Request
141
173
 
174
+ ### Running tests
175
+
176
+ ```
177
+ bundle exec rake spec
178
+ ```
179
+
180
+ ### Running code style linter
181
+
182
+ ```
183
+ bundle exec rubocop -a
184
+ ```
185
+
142
186
  ## License
143
187
 
144
188
  This project is licensed under the terms of the MIT license. See the [LICENSE](LICENSE) file.
data/bin//360/237/216/211 CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- load File.expand_path("../xcversion", __FILE__)
3
+ load File.expand_path('../xcversion', __FILE__)
@@ -5,7 +5,10 @@ module XcodeInstall
5
5
  self.summary = 'Installs Xcode Command Line Tools.'
6
6
 
7
7
  def run
8
- fail Informative, 'Xcode CLI Tools are already installed.' if installed?
8
+ if installed?
9
+ print 'Xcode CLI Tools are already installed.'
10
+ exit(0)
11
+ end
9
12
  install
10
13
  end
11
14
 
@@ -17,12 +17,14 @@ module XcodeInstall
17
17
  ['--no-install', 'Only download DMG, but do not install it.'],
18
18
  ['--no-progress', 'Don’t show download progress.'],
19
19
  ['--no-clean', 'Don’t delete DMG after installation.'],
20
- ['--no-show-release-notes', 'Don’t open release notes in browser after installation.']].concat(super)
20
+ ['--no-show-release-notes', 'Don’t open release notes in browser after installation.'],
21
+ ['--retry-download-count', 'Count of retrying download when curl is failed.']].concat(super)
21
22
  end
22
23
 
23
24
  def initialize(argv)
24
25
  @installer = Installer.new
25
26
  @version = argv.shift_argument
27
+ @version ||= File.read('.xcode-version') if File.exist?('.xcode-version')
26
28
  @url = argv.option('url')
27
29
  @force = argv.flag?('force', false)
28
30
  @should_clean = argv.flag?('clean', true)
@@ -30,6 +32,7 @@ module XcodeInstall
30
32
  @should_switch = argv.flag?('switch', true)
31
33
  @progress = argv.flag?('progress', true)
32
34
  @show_release_notes = argv.flag?('show-release-notes', true)
35
+ @retry_download_count = argv.option('retry-download-count', '3')
33
36
  super
34
37
  end
35
38
 
@@ -37,14 +40,18 @@ module XcodeInstall
37
40
  super
38
41
 
39
42
  help! 'A VERSION argument is required.' unless @version
40
- fail Informative, "Version #{@version} already installed." if @installer.installed?(@version) && !@force
43
+ if @installer.installed?(@version) && !@force
44
+ print "Version #{@version} already installed."
45
+ exit(0)
46
+ end
41
47
  fail Informative, "Version #{@version} doesn't exist." unless @url || @installer.exist?(@version)
42
48
  fail Informative, "Invalid URL: `#{@url}`" unless !@url || @url =~ /\A#{URI.regexp}\z/
49
+ fail Informative, "Invalid Retry: `#{@retry_download_count} is not positive number.`" if (@retry_download_count =~ /\A[0-9]*\z/).nil?
43
50
  end
44
51
 
45
52
  def run
46
53
  @installer.install_version(@version, @should_switch, @should_clean, @should_install,
47
- @progress, @url, @show_release_notes)
54
+ @progress, @url, @show_release_notes, nil, @retry_download_count.to_i)
48
55
  end
49
56
  end
50
57
  end
@@ -8,9 +8,14 @@ module XcodeInstall
8
8
  CLAide::Argument.new('VERSION', :true)
9
9
  ]
10
10
 
11
+ def self.options
12
+ [['--symlink', 'Update symlink in /Applications with selected Xcode']].concat(super)
13
+ end
14
+
11
15
  def initialize(argv)
12
16
  @installer = Installer.new
13
17
  @version = argv.shift_argument
18
+ @should_symlink = argv.flag?('symlink', false)
14
19
  super
15
20
  end
16
21
 
@@ -23,7 +28,8 @@ module XcodeInstall
23
28
 
24
29
  def run
25
30
  xcode = @installer.installed_versions.detect { |v| v.version == @version }
26
- `sudo xcode-select --switch #{xcode.path}`
31
+ `sudo xcode-select --switch "#{xcode.path}"`
32
+ @installer.symlink xcode.version if @should_symlink
27
33
  end
28
34
  end
29
35
  end
@@ -1,3 +1,3 @@
1
1
  module XcodeInstall
2
- VERSION = '2.3.1'.freeze
2
+ VERSION = '2.6.7'.freeze
3
3
  end