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



36
37
38
# File 'lib/xcode_build/reporting/build_reporting.rb', line 36

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



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

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



59
60
61
62
63
# File 'lib/xcode_build/reporting/build_reporting.rb', line 59

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

#build_succeeded(archive_or_build) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/xcode_build/reporting/build_reporting.rb', line 40

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

#build_warning_detected(params) ⇒ Object



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

def build_warning_detected(params)
  build.add_warning(params)
  notify :warning_detected
end