unlimit 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/Gemfile.lock +4 -4
- data/bin/unlimit +22 -1
- data/bin/unlimit-xcode +22 -1
- data/lib/unlimit.rb +198 -210
- data/lib/unlimit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64910bcea88748af831ed1b221261baddfba9a2c221e59a2db147cf221328495
|
4
|
+
data.tar.gz: 22e80f08ff8d80ae3b88a1b2ab57ec07c84605c483a86822fce296247da63406
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c36b20fa8716eabc1106726862e8c37db39fd027d0d2091c6e7ae5ffae07182a5f4ed97e37b56cac9eb64a775a7c24c9d46d46761700179820a8b3ee109fbc6d
|
7
|
+
data.tar.gz: 860f86c273318e15a92ff0ad7ba8174a7ffa217b0851f210cc9dcbc082047034cc6867e80ed7b6202065c34689b93c0e1a223f8e0ca4ba3f59ff7e3e72ea8d7a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [0.0.7](https://github.com/biocross/unlimit/releases/tag/0.0.7)
|
4
|
+
Released on 2019-08-26.
|
5
|
+
|
6
|
+
#### Fixed
|
7
|
+
- Fixed issues when running Unlimit without bundler
|
8
|
+
- Fixed issues when detecting personal teams without email addresses
|
9
|
+
|
10
|
+
## 0.0.6
|
11
|
+
Released on 2019-08-26.
|
12
|
+
|
13
|
+
#### Fixed
|
14
|
+
- Fixes a crash when running Unlimit without bundler.
|
15
|
+
|
3
16
|
## [0.0.5](https://github.com/biocross/unlimit/releases/tag/0.0.5)
|
4
17
|
Released on 2019-08-25.
|
5
18
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
unlimit (0.0.
|
4
|
+
unlimit (0.0.7)
|
5
5
|
configure_extensions
|
6
6
|
fastlane (>= 2.116.0)
|
7
7
|
highline
|
@@ -12,7 +12,7 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
CFPropertyList (3.0.
|
15
|
+
CFPropertyList (3.0.1)
|
16
16
|
activesupport (4.2.11.1)
|
17
17
|
i18n (~> 0.7)
|
18
18
|
minitest (~> 5.1)
|
@@ -93,9 +93,9 @@ GEM
|
|
93
93
|
representable (~> 3.0)
|
94
94
|
retriable (>= 2.0, < 4.0)
|
95
95
|
signet (~> 0.9)
|
96
|
-
google-cloud-core (1.3.
|
96
|
+
google-cloud-core (1.3.1)
|
97
97
|
google-cloud-env (~> 1.0)
|
98
|
-
google-cloud-env (1.2.
|
98
|
+
google-cloud-env (1.2.1)
|
99
99
|
faraday (~> 0.11)
|
100
100
|
google-cloud-storage (1.16.0)
|
101
101
|
digest-crc (~> 0.4)
|
data/bin/unlimit
CHANGED
@@ -3,10 +3,29 @@
|
|
3
3
|
|
4
4
|
require 'unlimit'
|
5
5
|
require 'optparse'
|
6
|
+
require 'sentry-raven'
|
7
|
+
|
8
|
+
def using_bundler
|
9
|
+
%w[BUNDLE_BIN_PATH BUNDLE_GEMFILE].each do |current|
|
10
|
+
return true if ENV.key?(current)
|
11
|
+
end
|
12
|
+
false
|
13
|
+
end
|
6
14
|
|
7
15
|
unlimiter = Unlimit::CLI.new
|
8
16
|
options = {}
|
9
17
|
|
18
|
+
Raven.configure do |config|
|
19
|
+
config.silence_ready = true
|
20
|
+
config.logger = Raven::Logger.new(nil)
|
21
|
+
config.dsn = 'https://bcd26f187d56482ca4fd1b6732103e87:7f5c3421630b4f50804525bfdfa25d6d@sentry.io/1541037'
|
22
|
+
end
|
23
|
+
|
24
|
+
Raven.tags_context(
|
25
|
+
bundler: using_bundler,
|
26
|
+
unlimit_version: Unlimit::VERSION
|
27
|
+
)
|
28
|
+
|
10
29
|
OptionParser.new do |opt|
|
11
30
|
opt.on('--project XCODEPROJ') { |o| options['project_path'] = o }
|
12
31
|
opt.on('--plist INFO_PLIST') { |o| options['plist_path'] = o }
|
@@ -17,4 +36,6 @@ OptionParser.new do |opt|
|
|
17
36
|
opt.on('--version') { unlimiter.showVersion }
|
18
37
|
end.parse!
|
19
38
|
|
20
|
-
|
39
|
+
Raven.capture do
|
40
|
+
unlimiter.start(options, using_bundler, Raven)
|
41
|
+
end
|
data/bin/unlimit-xcode
CHANGED
@@ -3,10 +3,29 @@
|
|
3
3
|
|
4
4
|
require 'unlimit'
|
5
5
|
require 'optparse'
|
6
|
+
require 'sentry-raven'
|
7
|
+
|
8
|
+
def using_bundler
|
9
|
+
%w[BUNDLE_BIN_PATH BUNDLE_GEMFILE].each do |current|
|
10
|
+
return true if ENV.key?(current)
|
11
|
+
end
|
12
|
+
false
|
13
|
+
end
|
6
14
|
|
7
15
|
unlimiter = Unlimit::CLI.new
|
8
16
|
options = {}
|
9
17
|
|
18
|
+
Raven.configure do |config|
|
19
|
+
config.silence_ready = true
|
20
|
+
config.logger = Raven::Logger.new(nil)
|
21
|
+
config.dsn = 'https://bcd26f187d56482ca4fd1b6732103e87:7f5c3421630b4f50804525bfdfa25d6d@sentry.io/1541037'
|
22
|
+
end
|
23
|
+
|
24
|
+
Raven.tags_context(
|
25
|
+
bundler: using_bundler,
|
26
|
+
unlimit_version: Unlimit::VERSION
|
27
|
+
)
|
28
|
+
|
10
29
|
OptionParser.new do |opt|
|
11
30
|
opt.on('--project XCODEPROJ') { |o| options['project_path'] = o }
|
12
31
|
opt.on('--plist INFO_PLIST') { |o| options['plist_path'] = o }
|
@@ -17,4 +36,6 @@ OptionParser.new do |opt|
|
|
17
36
|
opt.on('--version') { unlimiter.showVersion }
|
18
37
|
end.parse!
|
19
38
|
|
20
|
-
|
39
|
+
Raven.capture do
|
40
|
+
unlimiter.start(options, using_bundler, Raven)
|
41
|
+
end
|
data/lib/unlimit.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'unlimit/version'
|
4
|
-
require 'sentry-raven'
|
5
4
|
require 'xcodeproj'
|
6
5
|
require 'securerandom'
|
7
6
|
require 'json'
|
@@ -38,256 +37,245 @@ module Unlimit
|
|
38
37
|
abort
|
39
38
|
end
|
40
39
|
|
41
|
-
def start(options)
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
40
|
+
def start(options, using_bundler, raven)
|
41
|
+
puts Divider
|
42
|
+
puts " unlimit 🚀📲 (#{Unlimit::VERSION}) "
|
43
|
+
puts ' Switching your project to Personal Team! '.yellow
|
44
|
+
puts Divider
|
47
45
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
if xcode_project_files.count == 1 || options.key?(ProjectPathKey)
|
76
|
-
project_path = if options.key?(ProjectPathKey)
|
77
|
-
options[ProjectPathKey]
|
78
|
-
else
|
79
|
-
xcode_project_files.first
|
80
|
-
end
|
81
|
-
|
82
|
-
unless File.directory?(project_path)
|
83
|
-
abort("Project not found at #{project_path}".red)
|
84
|
-
end
|
85
|
-
putsWithOverrides('project', project_path, ProjectPathKey)
|
86
|
-
else
|
87
|
-
abort('Please specify the .xcodeproj project file to use with the --project option like --project MyProject.xcodeproj'.red)
|
46
|
+
xcode_project_files = Dir.glob('*.xcodeproj')
|
47
|
+
project_path = ''
|
48
|
+
plist_path = ''
|
49
|
+
target_name = ''
|
50
|
+
personal_team_id = ''
|
51
|
+
uses_app_groups = false
|
52
|
+
app_group_name = ''
|
53
|
+
entitlements_file = ''
|
54
|
+
project_configuration_file = ''
|
55
|
+
extensions = []
|
56
|
+
target = nil
|
57
|
+
session_uuid = SecureRandom.uuid
|
58
|
+
fastlane_command = using_bundler ? 'bundle exec fastlane' : 'fastlane'
|
59
|
+
|
60
|
+
cli = HighLine.new
|
61
|
+
raven.capture_message('Begin', level: 'info')
|
62
|
+
|
63
|
+
# Check for a valid xcode_project
|
64
|
+
if xcode_project_files.count == 1 || options.key?(ProjectPathKey)
|
65
|
+
project_path = if options.key?(ProjectPathKey)
|
66
|
+
options[ProjectPathKey]
|
67
|
+
else
|
68
|
+
xcode_project_files.first
|
69
|
+
end
|
70
|
+
|
71
|
+
unless File.directory?(project_path)
|
72
|
+
abort("Project not found at #{project_path}".red)
|
88
73
|
end
|
74
|
+
putsWithOverrides('project', project_path, ProjectPathKey)
|
75
|
+
else
|
76
|
+
abort('Please specify the .xcodeproj project file to use with the --project option like --project MyProject.xcodeproj'.red)
|
77
|
+
end
|
89
78
|
|
90
|
-
|
79
|
+
project = Xcodeproj::Project.open(project_path)
|
91
80
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
81
|
+
if options.key?(TargetNameKey)
|
82
|
+
target_name = options[TargetNameKey]
|
83
|
+
target = project.targets.find { |t| t.name == target_name }
|
84
|
+
abort "Couldn't find the target '#{target_name}' in '#{project_path}'" if target.nil?
|
85
|
+
puts "Using target #{target_name}"
|
86
|
+
else
|
87
|
+
project.targets.each do |current_target|
|
88
|
+
next unless current_target.product_type == ProductTypeApplicationTarget
|
100
89
|
|
101
|
-
|
102
|
-
|
103
|
-
|
90
|
+
target = current_target
|
91
|
+
target_name = current_target.name
|
92
|
+
putsWithOverrides('target', target_name, TargetNameKey)
|
104
93
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
94
|
+
# Remove Fabric Script build phase to stop the annoying "new app" email
|
95
|
+
unless options.key?(KeepFabricKey)
|
96
|
+
current_target.build_phases.each do |build_phase|
|
97
|
+
next unless build_phase.is_a?(Xcodeproj::Project::Object::PBXShellScriptBuildPhase) && build_phase.shell_script.include?('/Fabric/run')
|
109
98
|
|
110
|
-
|
111
|
-
end
|
99
|
+
build_phase.shell_script = '#' + build_phase.shell_script
|
112
100
|
end
|
113
|
-
break
|
114
101
|
end
|
102
|
+
break
|
115
103
|
end
|
104
|
+
end
|
116
105
|
|
117
|
-
|
118
|
-
|
106
|
+
if options.key?(PlistPathKey)
|
107
|
+
plist_path = options[PlistPathKey]
|
119
108
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
109
|
+
unless File.file?(plist_path)
|
110
|
+
abort("Info.plist file not found at path: #{plist_path}".red)
|
111
|
+
end
|
112
|
+
puts "Using Info.plist at path #{plist_path}.".green
|
113
|
+
else
|
114
|
+
if target.build_configurations.count.positive?
|
115
|
+
build_settings = target.build_configurations.first.build_settings
|
116
|
+
plist_path = build_settings[InfoPlistBuildSettingKey]
|
117
|
+
putsWithOverrides('Info.plist', plist_path, PlistPathKey)
|
118
|
+
end
|
130
119
|
|
131
|
-
|
132
|
-
|
133
|
-
end
|
120
|
+
if plist_path.nil? || plist_path.empty?
|
121
|
+
abort('Please specify the path to your main target\'s Info.plist file with the --plist option like --plist MyProject-Info.plist'.red)
|
134
122
|
end
|
123
|
+
end
|
135
124
|
|
136
|
-
|
137
|
-
|
125
|
+
if options.key?(ProjectConfigurationFileKey)
|
126
|
+
project_configuration_file = options[ProjectConfigurationFileKey]
|
138
127
|
|
139
|
-
|
140
|
-
|
141
|
-
end
|
142
|
-
puts "Using YAML Configuration at path #{project_configuration_file}.".green
|
143
|
-
else
|
144
|
-
project_configuration_file = DefaultProjectConfigurationFilePath
|
145
|
-
putsWithOverrides('YAML Configuration', project_configuration_file, ProjectConfigurationFileKey)
|
128
|
+
unless File.file?(project_configuration_file)
|
129
|
+
abort("YAML Configuration file not found at path: #{project_configuration_file}".red)
|
146
130
|
end
|
131
|
+
puts "Using YAML Configuration at path #{project_configuration_file}.".green
|
132
|
+
else
|
133
|
+
project_configuration_file = DefaultProjectConfigurationFilePath
|
134
|
+
putsWithOverrides('YAML Configuration', project_configuration_file, ProjectConfigurationFileKey) if File.file?(project_configuration_file)
|
135
|
+
end
|
147
136
|
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
end
|
137
|
+
project.targets.each do |target|
|
138
|
+
if target.product_type.include? 'app-extension'
|
139
|
+
extensions.push(target.name)
|
152
140
|
end
|
141
|
+
end
|
153
142
|
|
154
|
-
|
155
|
-
|
156
|
-
|
143
|
+
if options.key?(TeamIDKey)
|
144
|
+
personal_team_id = options[TeamIDKey]
|
145
|
+
putsWithOverrides('Team ID', personal_team_id, TeamIDKey)
|
146
|
+
else
|
147
|
+
valid_codesigning_identities, stderr, status = Open3.capture3('security find-identity -p codesigning -v')
|
148
|
+
personal_teams = valid_codesigning_identities.scan(/\"(.+Developer.+)\"/i)
|
149
|
+
if personal_teams.size == 1
|
150
|
+
personal_team_name = personal_teams.first.strip
|
151
|
+
personal_team_id, stderr, status = Open3.capture3("security find-certificate -c #{personal_team_name} -p | openssl x509 -text | grep -o OU=[^,]* | grep -v Apple | sed s/OU=//g")
|
152
|
+
personal_team_id = personal_team_id.strip
|
157
153
|
else
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
selected_team = ''
|
171
|
-
codesigning_options = valid_codesigning_identities.split("\n")
|
172
|
-
codesigning_options = codesigning_options.select { |line| line.include?(')') }
|
173
|
-
codesigning_options = codesigning_options.map { |identity| identity.scan(/\d+\) (.+)/).first.first }
|
174
|
-
cli.choose do |menu|
|
175
|
-
menu.prompt = 'Select one by entering the number: '
|
176
|
-
codesigning_options.each do |identity|
|
177
|
-
menu.choice(identity) { cli.say(identity); selected_team = identity }
|
178
|
-
end
|
154
|
+
puts "\nYou have quite a few developer identities on your machine. unlimit is unable to decide which one to use 😅".yellow
|
155
|
+
puts 'If you know the Team ID to use, pass it with the --teamid flag like --teamid 6A2T6455Y3'.yellow
|
156
|
+
puts "\nFor now, choose one from the list below: (Your personal team most likely contains your email or full name)".yellow
|
157
|
+
puts 'Which codesigning identity should unlimit use?'.green
|
158
|
+
selected_team = ''
|
159
|
+
codesigning_options = valid_codesigning_identities.split("\n")
|
160
|
+
codesigning_options = codesigning_options.select { |line| line.include?(')') }
|
161
|
+
codesigning_options = codesigning_options.map { |identity| identity.scan(/\d+\) (.+)/).first.first }
|
162
|
+
cli.choose do |menu|
|
163
|
+
menu.prompt = 'Select one by entering the number: '
|
164
|
+
codesigning_options.each do |identity|
|
165
|
+
menu.choice(identity) { selected_team = identity }
|
179
166
|
end
|
180
|
-
|
181
|
-
personal_team = selected_team.scan(/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i)
|
182
|
-
personal_team_name = personal_team.first.strip
|
183
|
-
personal_team_id, stderr, status = Open3.capture3("security find-certificate -c #{personal_team_name} -p | openssl x509 -text | grep -o OU=[^,]* | grep -v Apple | sed s/OU=//g")
|
184
|
-
personal_team_id = personal_team_id.strip
|
185
|
-
putsWithOverrides("Team ID (from: #{personal_team_name})", personal_team_id, TeamIDKey)
|
186
167
|
end
|
168
|
+
|
169
|
+
personal_team = selected_team.scan(/:(.+)\(.+\)\"/i)
|
170
|
+
personal_team_name = personal_team.first.first.strip
|
171
|
+
personal_team_id, stderr, status = Open3.capture3("security find-certificate -c \"#{personal_team_name}\" -p | openssl x509 -text | grep -o OU=[^,]* | grep -v Apple | sed s/OU=//g")
|
172
|
+
personal_team_id = personal_team_id.strip
|
187
173
|
end
|
174
|
+
putsWithOverrides("Team ID (from: #{personal_team_name})", personal_team_id, TeamIDKey)
|
175
|
+
end
|
188
176
|
|
189
|
-
|
177
|
+
puts "#{Divider}\n"
|
190
178
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
179
|
+
# Turn off capabilities that require entitlements
|
180
|
+
puts 'Turning OFF all Capabilities'.red
|
181
|
+
project.root_object.attributes.each do |value|
|
182
|
+
next unless value[0] == 'TargetAttributes'
|
195
183
|
|
196
|
-
|
197
|
-
|
198
|
-
|
184
|
+
hash = value[1]
|
185
|
+
hash.each do |_key, val|
|
186
|
+
next unless val.key?('SystemCapabilities')
|
199
187
|
|
200
|
-
|
201
|
-
|
202
|
-
|
188
|
+
capabilities = val['SystemCapabilities']
|
189
|
+
capabilities.each do |key, val|
|
190
|
+
next unless val.key?('enabled')
|
203
191
|
|
204
|
-
|
205
|
-
|
206
|
-
|
192
|
+
if key.include?('com.apple.ApplicationGroups.iOS')
|
193
|
+
uses_app_groups = true
|
194
|
+
end
|
207
195
|
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
end
|
196
|
+
unless CapabilitiesWhitelist.include?(key)
|
197
|
+
puts ' Turning OFF ' + key
|
198
|
+
capabilities[key]['enabled'] = '0'
|
212
199
|
end
|
213
200
|
end
|
214
201
|
end
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
202
|
+
end
|
203
|
+
project.save
|
204
|
+
|
205
|
+
# Remove Entitlements
|
206
|
+
puts 'Clearing entitlements...'.red
|
207
|
+
Dir.glob('**/*.entitlements').each do |source_file|
|
208
|
+
entitlements_plist = uses_app_groups ? { "com.apple.security.application-groups": '' }.to_plist : {}.to_plist
|
209
|
+
entitlements_file = source_file if uses_app_groups
|
210
|
+
File.open(source_file, 'w') { |file| file.puts entitlements_plist }
|
211
|
+
end
|
224
212
|
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
end
|
213
|
+
# Remove Capability Keys from Plist
|
214
|
+
puts 'Removing capabilities from Info.plist...'.red
|
215
|
+
info_plist = Plist.parse_xml(plist_path)
|
216
|
+
info_plist.delete('UIBackgroundModes')
|
217
|
+
File.open(plist_path, 'w') { |file| file.puts info_plist.to_plist }
|
218
|
+
|
219
|
+
# Change Bundle Identifier
|
220
|
+
puts 'Changing bundle identifier...'.red
|
221
|
+
bundle_identifier = "com.unlimit.#{session_uuid}"
|
222
|
+
system("#{FastlaneEnvironmentVariables} #{fastlane_command} run update_app_identifier plist_path:#{plist_path} app_identifier:#{bundle_identifier}")
|
223
|
+
|
224
|
+
if uses_app_groups # Create a temporary fastfile, and set the app group identifiers
|
225
|
+
app_group_name = "group.#{bundle_identifier}"
|
226
|
+
fastfile = "lane :set_app_group do
|
227
|
+
update_app_group_identifiers(entitlements_file: \"#{entitlements_file}\", app_group_identifiers: ['#{app_group_name}'])
|
228
|
+
end"
|
229
|
+
|
230
|
+
existing_fastfile = ''
|
231
|
+
if File.file?(FastFilePath)
|
232
|
+
File.open('./fastlane/Fastfile', 'r') do |file|
|
233
|
+
existing_fastfile = file.read
|
247
234
|
end
|
248
|
-
File.open(FastFilePath, 'w') do |file|
|
249
|
-
file.write(fastfile)
|
250
|
-
end
|
251
|
-
system("#{FastlaneEnvironmentVariables} bundle exec fastlane set_app_group")
|
252
|
-
existingFastfile.empty? ? File.delete(FastFilePath) : File.open('./fastlane/Fastfile', 'w') { |file| file.write(existingFastfile) }
|
253
235
|
end
|
236
|
+
File.open(FastFilePath, 'w') do |file|
|
237
|
+
file.write(fastfile)
|
238
|
+
end
|
239
|
+
system("#{FastlaneEnvironmentVariables} #{fastlane_command} fastlane set_app_group")
|
240
|
+
existing_fastfile.empty? ? File.delete(FastFilePath) : File.open('./fastlane/Fastfile', 'w') { |file| file.write(existing_fastfile) }
|
241
|
+
end
|
254
242
|
|
255
|
-
|
256
|
-
|
243
|
+
puts 'Enabling Automatic Code Signing...'.red
|
244
|
+
system("#{FastlaneEnvironmentVariables} #{fastlane_command} fastlane run automatic_code_signing use_automatic_signing:true targets:#{target_name}")
|
257
245
|
|
258
|
-
|
259
|
-
|
246
|
+
puts 'Switching to Personal Team...'.red
|
247
|
+
system("#{FastlaneEnvironmentVariables} #{fastlane_command} fastlane run update_project_team teamid:\"#{personal_team_id}\" targets:#{target_name}")
|
260
248
|
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
249
|
+
# Remove App Extensions
|
250
|
+
unless extensions.empty?
|
251
|
+
app_extensions = extensions.join(', ')
|
252
|
+
puts "Removing App Extensions: #{app_extensions}".red
|
253
|
+
system("#{'bundle exec' if using_bundler} configure_extensions remove #{project_path} #{target_name} #{app_extensions}")
|
254
|
+
end
|
267
255
|
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
end
|
278
|
-
puts "Running: #{script}".green
|
279
|
-
output, stderr, status = Open3.capture3(script)
|
280
|
-
puts output unless output.empty?
|
281
|
-
puts stderr unless stderr.empty?
|
282
|
-
puts "Done with Status: #{status}"
|
256
|
+
if File.file?(project_configuration_file)
|
257
|
+
puts "Running Custom Scripts from #{project_configuration_file}".red
|
258
|
+
local_configuration = YAML.load_file(project_configuration_file)
|
259
|
+
unless local_configuration['custom_scripts'].empty?
|
260
|
+
environment_variables = { 'UNLIMIT_PROJECT_PATH' => project_path, 'UNLIMIT_TARGET_NAME' => target_name, 'UNLIMIT_PLIST_PATH' => plist_path, 'UNLIMIT_TEAM_ID' => personal_team_id, 'UNLIMIT_APP_BUNDLE_ID' => bundle_identifier, 'UNLIMIT_APP_GROUP_NAME' => app_group_name }
|
261
|
+
local_configuration['custom_scripts'].each do |script|
|
262
|
+
script = script.to_s
|
263
|
+
environment_variables.each do |key, variable|
|
264
|
+
script.gsub!(key.to_s, variable.to_s)
|
283
265
|
end
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
266
|
+
puts "Running: #{script}".green
|
267
|
+
output, stderr, status = Open3.capture3(script)
|
268
|
+
puts output unless output.empty?
|
269
|
+
puts stderr unless stderr.empty?
|
270
|
+
puts "Done with Status: #{status}"
|
271
|
+
end
|
272
|
+
end
|
290
273
|
end
|
291
|
-
|
274
|
+
|
275
|
+
raven.capture_message('Finished', level: 'info')
|
276
|
+
puts "\n#{Divider}"
|
277
|
+
puts 'You\'re good to go! Just connect your device and hit run!'.green
|
278
|
+
puts Divider
|
279
|
+
end
|
292
280
|
end
|
293
281
|
end
|
data/lib/unlimit/version.rb
CHANGED