xcode-install 2.6.8 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +12 -6
- data/.gitignore +1 -0
- data/README.md +13 -3
- data/XCODE_VERSION.md +49 -0
- data/lib/xcode/install.rb +36 -32
- data/lib/xcode/install/install.rb +1 -1
- data/lib/xcode/install/version.rb +1 -1
- data/xcode-install.gemspec +1 -1
- metadata +16 -10
- data/.circleci/config.yml +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5f95c1ec6494fb1482c6862a786fd3f149327096468dbfd01886d6a320ab31f
|
4
|
+
data.tar.gz: ef0e89795d7a5169a97adb29467025693644db1a8805e1ae395cd76066ae2569
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fa023f63479190d92da8f7a54d9ac0a9556eab534e4e4ea4a784f6bbd10837678910570dd9665d409214d52e47432ebafa99aaae0a9022097bde4540d42390f
|
7
|
+
data.tar.gz: 73c28ae14d7081a62376ce4611cae869987b8e2681325770b20d8d5f3be153abc02c7c0e3b94828c703ab786dd5960a62c6f3b097b162b82be39cf197e031d99
|
data/.github/workflows/ci.yml
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
name: "CI"
|
2
|
-
on: [pull_request]
|
2
|
+
on: [push, pull_request]
|
3
3
|
|
4
4
|
jobs:
|
5
5
|
build:
|
6
6
|
strategy:
|
7
7
|
fail-fast: false
|
8
8
|
matrix:
|
9
|
-
ruby: ["2.5", "2.6"]
|
9
|
+
ruby: ["2.5", "2.6", "2.7"]
|
10
10
|
|
11
11
|
runs-on: macos-latest
|
12
12
|
steps:
|
@@ -19,16 +19,22 @@ jobs:
|
|
19
19
|
# Show env
|
20
20
|
- name: Show macOS version
|
21
21
|
run: sw_vers
|
22
|
-
- name: Show
|
22
|
+
- name: Show env versions
|
23
23
|
run: |
|
24
24
|
ruby --version
|
25
25
|
bundler --version
|
26
|
+
echo $HOME
|
26
27
|
|
27
28
|
# Prepare
|
28
|
-
- name: Install bundler
|
29
|
-
run: gem install bundler -v "~>
|
29
|
+
- name: Install bundler 2.2.14
|
30
|
+
run: gem install bundler -v "~> 2.2.14"
|
30
31
|
- name: Install ruby dependencies
|
31
|
-
run:
|
32
|
+
run: |
|
33
|
+
bundle config --local clean 'true'
|
34
|
+
bundle config --local path '.vendor'
|
35
|
+
bundle config --local jobs 8
|
36
|
+
bundle config --local without 'system_tests'
|
37
|
+
bundle install
|
32
38
|
|
33
39
|
- name: Run test
|
34
40
|
run: bundle exec rake spec
|
data/.gitignore
CHANGED
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) [![Build Status](https://github.com/xcpretty/xcode-install/actions/workflows/ci.yml/badge.svg)](https://github.com/xcpretty/xcode-install/actions)
|
4
4
|
|
5
5
|
Install and update your Xcodes automatically.
|
6
6
|
|
@@ -87,6 +87,16 @@ $ xcversion list
|
|
87
87
|
|
88
88
|
They have to be installed using the full name, e.g. `xcversion install '7 GM seed'`.
|
89
89
|
|
90
|
+
#### `.xcode-version`
|
91
|
+
|
92
|
+
We recommend the creation of a `.xcode-version` file to explicitly declare and store the Xcode version to be used by your CI environment as well as your team.
|
93
|
+
|
94
|
+
```
|
95
|
+
12.5
|
96
|
+
```
|
97
|
+
|
98
|
+
Read [the proposal](/XCODE_VERSION.md) of `.xcode-version`.
|
99
|
+
|
90
100
|
### Select
|
91
101
|
|
92
102
|
To see the currently selected version, run
|
@@ -151,7 +161,7 @@ to a dialog popping up. Feel free to dupe [the radar][5]. 📡
|
|
151
161
|
|
152
162
|
XcodeInstall normally relies on the Spotlight index to locate installed versions of Xcode. If you use it while
|
153
163
|
indexing is happening, it might show inaccurate results and it will not be able to see installed
|
154
|
-
versions on unindexed volumes.
|
164
|
+
versions on unindexed volumes.
|
155
165
|
|
156
166
|
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.
|
157
167
|
|
@@ -165,7 +175,7 @@ project, especially [@henrikhodne][6] and [@lacostej][7] for making XcodeInstall
|
|
165
175
|
|
166
176
|
## Contributing
|
167
177
|
|
168
|
-
1. Fork it ( https://github.com/
|
178
|
+
1. Fork it ( https://github.com/xcpretty/xcode-install/fork )
|
169
179
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
170
180
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
171
181
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/XCODE_VERSION.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# `.xcode-version`
|
2
|
+
|
3
|
+
## Introduction
|
4
|
+
|
5
|
+
This is a proposal for a new standard for the iOS community: a text-based file that defines the Xcode version to use to compile and package a given iOS project.
|
6
|
+
|
7
|
+
This will be used by this gem, however it's designed in a way that any tool in the future can pick it up, no matter if it's Ruby based, Swift, JavaScript, etc.
|
8
|
+
|
9
|
+
Similar to the [.ruby-version file](https://en.wikipedia.org/wiki/Ruby_Version_Manager), the `.xcode-version` file allows any CI system or IDE to automatically install and switch to the Xcode version needed for a given project to successfully compile your project.
|
10
|
+
|
11
|
+
## Filename
|
12
|
+
|
13
|
+
The filename must always be `.xcode-version`.
|
14
|
+
|
15
|
+
## File location
|
16
|
+
|
17
|
+
The file must be located in the same directory as your Xcode project/workspace, and you should add it to your versioning system (e.g. git).
|
18
|
+
|
19
|
+
## File content
|
20
|
+
|
21
|
+
The file content must be a simple string in a text file. The file may or may not end with an empty new line, this gem is responsible for stripping out the trailing `\n` (if used).
|
22
|
+
|
23
|
+
### Sample files
|
24
|
+
|
25
|
+
To define an official Xcode release
|
26
|
+
|
27
|
+
```
|
28
|
+
9.3
|
29
|
+
```
|
30
|
+
|
31
|
+
```
|
32
|
+
7.2.1
|
33
|
+
```
|
34
|
+
|
35
|
+
You can also use pre-releases
|
36
|
+
|
37
|
+
```
|
38
|
+
11.5 GM Seed
|
39
|
+
```
|
40
|
+
|
41
|
+
```
|
42
|
+
12 beta 6
|
43
|
+
```
|
44
|
+
|
45
|
+
Always following the same version naming listed by `xcversion list`.
|
46
|
+
|
47
|
+
**Note**: Be aware that pre-releases might be eventually taken down from Apple's servers, meaning that it won't allow you to have fully reproducible builds as you won't be able to download the Xcode release once it's gone.
|
48
|
+
|
49
|
+
It is recommended to only use non-beta releases in an `.xcode-version` file to have fully reproducible builds that you'll be able to run in a few years also.
|
data/lib/xcode/install.rb
CHANGED
@@ -26,7 +26,6 @@ module XcodeInstall
|
|
26
26
|
# @param progress_block: A block that's called whenever we have an updated progress %
|
27
27
|
# the parameter is a single number that's literally percent (e.g. 1, 50, 80 or 100)
|
28
28
|
# @param retry_download_count: A count to retry the downloading Xcode dmg/xip
|
29
|
-
# rubocop:disable Metrics/AbcSize
|
30
29
|
def fetch(url: nil,
|
31
30
|
directory: nil,
|
32
31
|
cookies: nil,
|
@@ -81,37 +80,7 @@ module XcodeInstall
|
|
81
80
|
# https://curl.haxx.se/mail/archive-2008-07/0098.html
|
82
81
|
# https://github.com/KrauseFx/xcode-install/issues/210
|
83
82
|
retry_download_count.times do
|
84
|
-
|
85
|
-
# We're not using the block based syntax, as the bacon testing
|
86
|
-
# library doesn't seem to support writing tests for it
|
87
|
-
stdin, stdout, stderr, wait_thr = Open3.popen3(command_string)
|
88
|
-
|
89
|
-
# Poll the file and see if we're done yet
|
90
|
-
while wait_thr.alive?
|
91
|
-
sleep(0.5) # it's not critical for this to be real-time
|
92
|
-
next unless File.exist?(progress_log_file) # it might take longer for it to be created
|
93
|
-
|
94
|
-
progress_content = File.read(progress_log_file).split("\r").last
|
95
|
-
|
96
|
-
# Print out the progress for the CLI
|
97
|
-
if progress
|
98
|
-
print "\r#{progress_content}%"
|
99
|
-
$stdout.flush
|
100
|
-
end
|
101
|
-
|
102
|
-
# Call back the block for other processes that might be interested
|
103
|
-
matched = progress_content.match(/^\s*(\d+)/)
|
104
|
-
next unless matched && matched.length == 2
|
105
|
-
percent = matched[1].to_i
|
106
|
-
progress_block.call(percent) if progress_block
|
107
|
-
end
|
108
|
-
|
109
|
-
# as we're not making use of the block-based syntax
|
110
|
-
# we need to manually close those
|
111
|
-
stdin.close
|
112
|
-
stdout.close
|
113
|
-
stderr.close
|
114
|
-
|
83
|
+
wait_thr = poll_file(command_string: command_string, progress_log_file: progress_log_file, progress: progress, progress_block: progress_block)
|
115
84
|
return wait_thr.value.success? if wait_thr.value.success?
|
116
85
|
end
|
117
86
|
false
|
@@ -119,6 +88,41 @@ module XcodeInstall
|
|
119
88
|
FileUtils.rm_f(COOKIES_PATH)
|
120
89
|
FileUtils.rm_f(progress_log_file)
|
121
90
|
end
|
91
|
+
|
92
|
+
def poll_file(command_string:, progress_log_file:, progress: nil, progress_block: nil)
|
93
|
+
# Non-blocking call of Open3
|
94
|
+
# We're not using the block based syntax, as the bacon testing
|
95
|
+
# library doesn't seem to support writing tests for it
|
96
|
+
stdin, stdout, stderr, wait_thr = Open3.popen3(command_string)
|
97
|
+
|
98
|
+
# Poll the file and see if we're done yet
|
99
|
+
while wait_thr.alive?
|
100
|
+
sleep(0.5) # it's not critical for this to be real-time
|
101
|
+
next unless File.exist?(progress_log_file) # it might take longer for it to be created
|
102
|
+
|
103
|
+
progress_content = File.read(progress_log_file).split("\r").last || ''
|
104
|
+
|
105
|
+
# Print out the progress for the CLI
|
106
|
+
if progress
|
107
|
+
print "\r#{progress_content}%"
|
108
|
+
$stdout.flush
|
109
|
+
end
|
110
|
+
|
111
|
+
# Call back the block for other processes that might be interested
|
112
|
+
matched = progress_content.match(/^\s*(\d+)/)
|
113
|
+
next unless matched && matched.length == 2
|
114
|
+
percent = matched[1].to_i
|
115
|
+
progress_block.call(percent) if progress_block
|
116
|
+
end
|
117
|
+
|
118
|
+
# as we're not making use of the block-based syntax
|
119
|
+
# we need to manually close those
|
120
|
+
stdin.close
|
121
|
+
stdout.close
|
122
|
+
stderr.close
|
123
|
+
|
124
|
+
wait_thr
|
125
|
+
end
|
122
126
|
end
|
123
127
|
|
124
128
|
# rubocop:disable Metrics/ClassLength
|
@@ -24,7 +24,7 @@ module XcodeInstall
|
|
24
24
|
def initialize(argv)
|
25
25
|
@installer = Installer.new
|
26
26
|
@version = argv.shift_argument
|
27
|
-
@version ||= File.read('.xcode-version') if File.exist?('.xcode-version')
|
27
|
+
@version ||= File.read('.xcode-version').strip if File.exist?('.xcode-version')
|
28
28
|
@url = argv.option('url')
|
29
29
|
@force = argv.flag?('force', false)
|
30
30
|
@should_clean = argv.flag?('clean', true)
|
data/xcode-install.gemspec
CHANGED
@@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
|
|
27
27
|
# contains spaceship, which is used for auth and dev portal interactions
|
28
28
|
spec.add_dependency 'fastlane', '>= 2.1.0', '< 3.0.0'
|
29
29
|
|
30
|
-
spec.add_development_dependency 'bundler', '
|
30
|
+
spec.add_development_dependency 'bundler', '>= 2.0.0', '< 3.0.0'
|
31
31
|
spec.add_development_dependency 'rake', '>= 12.3.3'
|
32
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcode-install
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boris Bügling
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: claide
|
@@ -54,16 +54,22 @@ dependencies:
|
|
54
54
|
name: bundler
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
|
-
- - "
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 2.0.0
|
60
|
+
- - "<"
|
58
61
|
- !ruby/object:Gem::Version
|
59
|
-
version:
|
62
|
+
version: 3.0.0
|
60
63
|
type: :development
|
61
64
|
prerelease: false
|
62
65
|
version_requirements: !ruby/object:Gem::Requirement
|
63
66
|
requirements:
|
64
|
-
- - "
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 2.0.0
|
70
|
+
- - "<"
|
65
71
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
72
|
+
version: 3.0.0
|
67
73
|
- !ruby/object:Gem::Dependency
|
68
74
|
name: rake
|
69
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,7 +93,6 @@ executables:
|
|
87
93
|
extensions: []
|
88
94
|
extra_rdoc_files: []
|
89
95
|
files:
|
90
|
-
- ".circleci/config.yml"
|
91
96
|
- ".gitattributes"
|
92
97
|
- ".github/workflows/ci.yml"
|
93
98
|
- ".gitignore"
|
@@ -97,6 +102,7 @@ files:
|
|
97
102
|
- LICENSE
|
98
103
|
- README.md
|
99
104
|
- Rakefile
|
105
|
+
- XCODE_VERSION.md
|
100
106
|
- bin/xcversion
|
101
107
|
- "bin/\U0001F389"
|
102
108
|
- lib/xcode/install.rb
|
@@ -145,7 +151,7 @@ homepage: https://github.com/neonichu/xcode-install
|
|
145
151
|
licenses:
|
146
152
|
- MIT
|
147
153
|
metadata: {}
|
148
|
-
post_install_message:
|
154
|
+
post_install_message:
|
149
155
|
rdoc_options: []
|
150
156
|
require_paths:
|
151
157
|
- lib
|
@@ -161,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
167
|
version: '0'
|
162
168
|
requirements: []
|
163
169
|
rubygems_version: 3.1.4
|
164
|
-
signing_key:
|
170
|
+
signing_key:
|
165
171
|
specification_version: 4
|
166
172
|
summary: Xcode installation manager.
|
167
173
|
test_files:
|
data/.circleci/config.yml
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
version: 2
|
2
|
-
|
3
|
-
jobs:
|
4
|
-
build:
|
5
|
-
macos:
|
6
|
-
xcode: "9.4.1"
|
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
|