xcjobs 0.4.3 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c119a3dce6b0ec128d006c306ca9f58fd5937fc0
4
- data.tar.gz: 0d76bda17df5c2f0fe063b5e80d803c0c1947924
3
+ metadata.gz: 1eb63c93a78d7fdc076af6cd7fefa3608e6fe196
4
+ data.tar.gz: 1dbfcba0c866410ce9c1e0c74ac7c0dc875bb883
5
5
  SHA512:
6
- metadata.gz: 31180c4018cd1e16c8341c1b072222e6205cee78b48f2ecd087252de469aabd1d593459e26bfcb1bf951ba65aa21687a472720396c017c0074a862c4d9778f96
7
- data.tar.gz: 8fd39e7034b671ccb810c183f2b0c94002277a51b9a1a29a7594b661a93cdc304658b9b05dd577a875f332dc8a173a6e89027cf4bbc09618bd0ae8389d094be3
6
+ metadata.gz: 59da10ad0d509a80a03ddf4cf9ad7c5aa291af7d84935d3d55dfa0a2b1bc61fc15d3398f390308e5ee3469fcf44722b62e24c97280e911a3e09dd18bd7efd9c1
7
+ data.tar.gz: 57e7e7165061fa0da650bc9dd01166598becefc127e570ca473163bd5c9769c46dcd6615be7db075fb00b7107ecc2a4b5151b414408b748a335e21505b92fba2
@@ -1,3 +1,3 @@
1
1
  module XCJobs
2
- VERSION = "0.4.3"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -10,6 +10,7 @@ module XCJobs
10
10
  include Rake::DSL if defined?(Rake::DSL)
11
11
 
12
12
  attr_accessor :name
13
+ attr_accessor :description
13
14
  attr_accessor :project
14
15
  attr_accessor :target
15
16
  attr_accessor :workspace
@@ -146,6 +147,7 @@ module XCJobs
146
147
  class Test < Xcodebuild
147
148
  def initialize(name = :test)
148
149
  super
150
+ @description = 'test application'
149
151
  yield self if block_given?
150
152
  define
151
153
  end
@@ -209,25 +211,27 @@ module XCJobs
209
211
  def coverage_report(options)
210
212
  settings = build_settings(options)
211
213
 
214
+ xcode_version = `xcodebuild -version`.split("\n").first.scan(/\d+/).join('.')
215
+
212
216
  targetSettings = settings.select { |key, _| settings[key]['PRODUCT_TYPE'] != 'com.apple.product-type.bundle.unit-test' }
213
217
  targetSettings.each do |target, settings|
218
+ objroot = settings['OBJROOT']
219
+
214
220
  product_type = settings['PRODUCT_TYPE']
215
221
  if product_type == 'com.apple.product-type.framework' || product_type == 'com.apple.product-type.application'
216
222
  if sdk.start_with?('iphone') && settings['ONLY_ACTIVE_ARCH'] == 'NO'
217
- target_dir = settings['OBJECT_FILE_DIR_normal'].gsub('Build/Intermediates', "Build/Intermediates/CodeCoverage/Intermediates")
218
223
  executable_name = settings['EXECUTABLE_NAME']
219
- target_path = File.join(File.join(target_dir, settings['CURRENT_ARCH']), executable_name)
224
+ target_path = Dir.glob(File.join(objroot, '/**/' +executable_name)).first
220
225
  else
221
- target_dir = (product_type == 'com.apple.product-type.application' ? settings['CONFIGURATION_BUILD_DIR'] : settings['CODESIGNING_FOLDER_PATH']).gsub('Build/Products', "Build/Intermediates/CodeCoverage/Products")
222
226
  executable_name = product_type == 'com.apple.product-type.application' ? settings['EXECUTABLE_PATH'] : settings['EXECUTABLE_NAME']
223
- target_path = File.join(target_dir, executable_name)
227
+ target_path = Dir.glob(File.join(objroot, '/**/' +executable_name)).select { |f| File.stat(f).file? }.first
224
228
  end
225
229
  elsif
226
230
  raise %[Product type (PRODUCT_TYPE) '#{product_type}' is unsupported.]
227
231
  end
228
232
 
229
- code_coverage_dir = settings['BUILD_DIR'].gsub('Build/Products', "Build/Intermediates/CodeCoverage")
230
- profdata_path = File.join(code_coverage_dir, 'Coverage.profdata')
233
+ puts target_path
234
+ profdata_path = Dir.glob(File.join(objroot, '/**/Coverage.profdata')).first
231
235
 
232
236
  show_coverage(profdata_path, target_path)
233
237
  generate_gcov_file(profdata_path, target_path)
@@ -255,7 +259,7 @@ module XCJobs
255
259
  raise 'test action requires specifying a scheme' unless scheme
256
260
  raise 'cannot specify both a scheme and targets' if scheme && target
257
261
 
258
- desc 'test application'
262
+ desc @description
259
263
  task @name do
260
264
  if sdk == 'iphonesimulator'
261
265
  add_build_setting('CODE_SIGN_IDENTITY', '""')
@@ -276,6 +280,7 @@ module XCJobs
276
280
  class Build < Xcodebuild
277
281
  def initialize(name = :build)
278
282
  super
283
+ @description = 'build application'
279
284
  yield self if block_given?
280
285
  define
281
286
  end
@@ -289,7 +294,7 @@ module XCJobs
289
294
  CLEAN.include(build_dir) if build_dir
290
295
  CLOBBER.include(build_dir) if build_dir
291
296
 
292
- desc 'build application'
297
+ desc @description
293
298
  task @name do
294
299
  add_build_setting('CONFIGURATION_TEMP_DIR', File.join(build_dir, 'temp')) if build_dir
295
300
  add_build_setting('CODE_SIGN_IDENTITY', signing_identity) if signing_identity
@@ -305,6 +310,7 @@ module XCJobs
305
310
 
306
311
  def initialize(name = :archive)
307
312
  super
313
+ @description = 'make xcarchive'
308
314
  yield self if block_given?
309
315
  define
310
316
  end
@@ -320,7 +326,7 @@ module XCJobs
320
326
  CLOBBER.include(build_dir)
321
327
  end
322
328
 
323
- desc 'make xcarchive'
329
+ desc @description
324
330
  namespace :build do
325
331
  task @name do
326
332
  add_build_setting('CONFIGURATION_TEMP_DIR', File.join(build_dir, 'temp')) if build_dir
@@ -363,6 +369,7 @@ module XCJobs
363
369
  def initialize(name = :export)
364
370
  super
365
371
  self.unsetenv_others = true
372
+ @description = 'export from an archive'
366
373
  @export_format = 'IPA'
367
374
  yield self if block_given?
368
375
  define
@@ -388,7 +395,7 @@ module XCJobs
388
395
  private
389
396
 
390
397
  def define
391
- desc 'export from an archive'
398
+ desc @description
392
399
  namespace :build do
393
400
  task name do
394
401
  run(['xcodebuild', '-exportArchive'] + options)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcjobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kishikawa katsumi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-10 00:00:00.000000000 Z
11
+ date: 2016-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler