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 +4 -4
- data/lib/xcjobs/version.rb +1 -1
- data/lib/xcjobs/xcodebuild.rb +17 -10
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1eb63c93a78d7fdc076af6cd7fefa3608e6fe196
         | 
| 4 | 
            +
              data.tar.gz: 1dbfcba0c866410ce9c1e0c74ac7c0dc875bb883
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 59da10ad0d509a80a03ddf4cf9ad7c5aa291af7d84935d3d55dfa0a2b1bc61fc15d3398f390308e5ee3469fcf44722b62e24c97280e911a3e09dd18bd7efd9c1
         | 
| 7 | 
            +
              data.tar.gz: 57e7e7165061fa0da650bc9dd01166598becefc127e570ca473163bd5c9769c46dcd6615be7db075fb00b7107ecc2a4b5151b414408b748a335e21505b92fba2
         | 
    
        data/lib/xcjobs/version.rb
    CHANGED
    
    
    
        data/lib/xcjobs/xcodebuild.rb
    CHANGED
    
    | @@ -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 =  | 
| 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( | 
| 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 | 
            -
                     | 
| 230 | 
            -
                    profdata_path = File.join( | 
| 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  | 
| 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  | 
| 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  | 
| 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  | 
| 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 | 
            +
              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- | 
| 11 | 
            +
            date: 2016-09-19 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         |