Class: XcodebuildCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-binary-cache/pod-rome/xcodebuild_command.rb

Overview

rubocop:disable Metrics/ClassLength

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ XcodebuildCommand

Returns a new instance of XcodebuildCommand.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/cocoapods-binary-cache/pod-rome/xcodebuild_command.rb', line 4

def initialize(options)
  @options = options
  case options[:target].platform.name
  when :ios
    @options[:device] = "iphoneos"
    @options[:simulator] = "iphonesimulator"
  when :tvos
    @options[:device] = "appletvos"
    @options[:simulator] = "appletvsimulator"
  when :watchos
    @options[:device] = "watchos"
    @options[:simulator] = "watchsimulator"
  end
  @build_args = make_up_build_args(options[:args] || {})
end

Instance Method Details

#runObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/cocoapods-binary-cache/pod-rome/xcodebuild_command.rb', line 20

def run
  build_for_sdk(simulator) if build_types.include?(:simulator)
  build_for_sdk(device) if build_types.include?(:device)

  case build_types
  when [:simulator]
    collect_output(Dir[target_products_dir_of(simulator) + "/*"])
  when [:device]
    collect_output(Dir[target_products_dir_of(device) + "/*"])
  else
    # When merging contents of `simulator` & `device`, prefer contents of `device` over `simulator`
    # https://github.com/grab/cocoapods-binary-cache/issues/25
    collect_output(Dir[target_products_dir_of(device) + "/*"])
    create_universal_framework
  end
end