Class: XCKnife::Runner

Inherits:
Object
  • Object
show all
Includes:
XCToolCmdHelper
Defined in:
lib/xcknife/runner.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from XCToolCmdHelper

#only_arguments, #only_arguments_for_a_partition_set, #xcodebuild_only_arguments, #xcodebuild_only_arguments_for_a_partition_set, #xcodebuild_skip_arguments, #xctool_only_arguments, #xctool_only_arguments_for_a_partition_set

Constructor Details

#initialize(args) ⇒ Runner

Returns a new instance of Runner.


15
16
17
18
19
20
21
22
23
24
25
# File 'lib/xcknife/runner.rb', line 15

def initialize(args)
  @abbreviated_output = false
  @xcodebuild_output = false
  @partitions = []
  @partition_names = []
  @worker_count = nil
  @historical_timings_file = nil
  @current_tests_file = nil
  @output_file_name = nil
  parse_arguments(args)
end

Instance Attribute Details

#parserObject (readonly)

Returns the value of attribute parser


13
14
15
# File 'lib/xcknife/runner.rb', line 13

def parser
  @parser
end

Class Method Details

.invokeObject


9
10
11
# File 'lib/xcknife/runner.rb', line 9

def self.invoke
  new(ARGV).run
end

Instance Method Details

#runObject


27
28
29
30
31
32
33
34
35
# File 'lib/xcknife/runner.rb', line 27

def run
  stream_parser = XCKnife::StreamParser.new(@worker_count, @partitions)
  result = stream_parser.compute_shards_for_file(@historical_timings_file, @current_tests_file)
  data = @abbreviated_output ? gen_abbreviated_output(result) : gen_full_output(result)
  write_output(data)
rescue XCKnife::XCKnifeError => e
  warn "Error: #{e}"
  exit 1
end