xcjobs 0.9.0 → 0.10.0
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 +4 -4
- data/lib/xcjobs/version.rb +1 -1
- data/lib/xcjobs/xcodebuild.rb +2 -46
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e33883b220f3d3c4181143f2a382cef8e4f854b
|
4
|
+
data.tar.gz: a218b3ea76f15f76f458ad384d76d3ac3c5fd47a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5c3af5e066d24e6fefb12df3349181b733e912112154a8ef2c5803a06a5475708460121839f9562bcc077fa4379972952f02e136f09fb5e0bd7e79638b4cf52
|
7
|
+
data.tar.gz: 9372bcd4e97f0cd2596b47afa8c53fa00dd7cd5e527749725a60eaad1762d06462d83160feb7db23262e330a14c7cdbf8950996bca83dcade734e8e4c6163b0f
|
data/lib/xcjobs/version.rb
CHANGED
data/lib/xcjobs/xcodebuild.rb
CHANGED
@@ -22,6 +22,7 @@ module XCJobs
|
|
22
22
|
attr_accessor :build_dir
|
23
23
|
attr_accessor :coverage
|
24
24
|
attr_accessor :formatter
|
25
|
+
attr_accessor :hide_shell_script_environment
|
25
26
|
|
26
27
|
attr_reader :destinations
|
27
28
|
attr_reader :provisioning_profile_name
|
@@ -148,6 +149,7 @@ module XCJobs
|
|
148
149
|
opts.concat(['-configuration', configuration]) if configuration
|
149
150
|
opts.concat(['-enableCodeCoverage', 'YES']) if coverage_enabled
|
150
151
|
opts.concat(['-derivedDataPath', build_dir]) if build_dir
|
152
|
+
opts.concat(['-hideShellScriptEnvironment']) if hide_shell_script_environment
|
151
153
|
|
152
154
|
@destinations.each do |destination|
|
153
155
|
opts.concat(['-destination', destination])
|
@@ -187,48 +189,6 @@ module XCJobs
|
|
187
189
|
|
188
190
|
private
|
189
191
|
|
190
|
-
def show_coverage_report(profdata_path, target_path)
|
191
|
-
cmd = ['xcrun', 'llvm-cov', 'report']
|
192
|
-
opts = ['-instr-profile', profdata_path, target_path, '-use-color=0']
|
193
|
-
sh *(cmd + opts)
|
194
|
-
end
|
195
|
-
|
196
|
-
def build_coverage_report(profdata_path, target_path)
|
197
|
-
gcov_file = {}
|
198
|
-
source_path = ''
|
199
|
-
|
200
|
-
cmd = ['xcrun', 'llvm-cov', 'show']
|
201
|
-
opts = ['-instr-profile', profdata_path, target_path, '-use-color=0']
|
202
|
-
|
203
|
-
sh *(cmd + opts)
|
204
|
-
end
|
205
|
-
|
206
|
-
def coverage_report(options)
|
207
|
-
settings = build_settings(options)
|
208
|
-
|
209
|
-
targetSettings = settings.select { |key, _| settings[key]['PRODUCT_TYPE'] != 'com.apple.product-type.bundle.unit-test' }
|
210
|
-
targetSettings.each do |target, settings|
|
211
|
-
objroot = settings['OBJROOT']
|
212
|
-
|
213
|
-
product_type = settings['PRODUCT_TYPE']
|
214
|
-
if product_type == 'com.apple.product-type.framework' || product_type == 'com.apple.product-type.application'
|
215
|
-
if sdk.start_with?('iphone') && settings['ONLY_ACTIVE_ARCH'] == 'NO'
|
216
|
-
executable_name = settings['EXECUTABLE_NAME']
|
217
|
-
else
|
218
|
-
executable_name = product_type == 'com.apple.product-type.application' ? settings['EXECUTABLE_PATH'] : settings['EXECUTABLE_NAME']
|
219
|
-
end
|
220
|
-
target_path = Dir.glob(File.join(objroot, '/**/' +executable_name)).select { |f| File.stat(f).file? }.first
|
221
|
-
elsif
|
222
|
-
raise %[Product type (PRODUCT_TYPE) '#{product_type}' is unsupported.]
|
223
|
-
end
|
224
|
-
|
225
|
-
profdata_path = Dir.glob(File.join(objroot, '/**/Coverage.profdata')).first
|
226
|
-
|
227
|
-
show_coverage_report(profdata_path, target_path)
|
228
|
-
build_coverage_report(profdata_path, target_path)
|
229
|
-
end
|
230
|
-
end
|
231
|
-
|
232
192
|
def build_settings(options)
|
233
193
|
out, status = Open3.capture2(*(['xcodebuild', 'test'] + options + ['-showBuildSettings']))
|
234
194
|
|
@@ -255,10 +215,6 @@ module XCJobs
|
|
255
215
|
add_build_setting('GCC_SYMBOLS_PRIVATE_EXTERN', 'NO')
|
256
216
|
|
257
217
|
run(['xcodebuild', command] + options)
|
258
|
-
|
259
|
-
if coverage_enabled
|
260
|
-
coverage_report(options)
|
261
|
-
end
|
262
218
|
end
|
263
219
|
end
|
264
220
|
|