Module: XcodeBuild::Reporting::BuildReporting

Included in:
XcodeBuild::Reporter
Defined in:
lib/xcode_build/reporting/build_reporting.rb

Defined Under Namespace

Classes: Build

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



6
7
8
9
10
# File 'lib/xcode_build/reporting/build_reporting.rb', line 6

def self.included(klass)
  klass.instance_eval do
    attr_reader :build
  end
end

Instance Method Details

#build_env_variable_detected(key, value) ⇒ Object



31
32
33
# File 'lib/xcode_build/reporting/build_reporting.rb', line 31

def build_env_variable_detected(key, value)
  build.set_environment_variable(key, value)
end

#build_error_detected(params) ⇒ Object



27
28
29
# File 'lib/xcode_build/reporting/build_reporting.rb', line 27

def build_error_detected(params)
  build.last_step.add_error(params)
end

#build_failed(archive_or_build) ⇒ Object



48
49
50
51
52
# File 'lib/xcode_build/reporting/build_reporting.rb', line 48

def build_failed(archive_or_build)
  build.label = archive_or_build
  build.failure!
  build_finished
end

#build_started(params) ⇒ Object



12
13
14
15
# File 'lib/xcode_build/reporting/build_reporting.rb', line 12

def build_started(params)
  @build = Build.new(params)
  notify :build_started, build
end

#build_step(params) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/xcode_build/reporting/build_reporting.rb', line 17

def build_step(params)
  if build.last_step
    notify :build_step_finished, build.last_step
  end

  build.add_step(params)

  notify :build_step_started, build.last_step
end

#build_step_failed(params) ⇒ Object



54
55
56
57
58
# File 'lib/xcode_build/reporting/build_reporting.rb', line 54

def build_step_failed(params)
  if step = build.step_with_params(params)
    step.failed = true
  end
end

#build_succeeded(archive_or_build) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/xcode_build/reporting/build_reporting.rb', line 35

def build_succeeded(archive_or_build)
  build.label = archive_or_build
  
  # for some reason, archive reports a success even if there was an error
  if build.has_errors?
    build.failure!
  else
    build.success!
  end
  
  build_finished
end