Module: XcodeBuild::Translations::Building

Defined in:
lib/xcode_build/translations/building.rb

Instance Method Summary collapse

Instance Method Details

#attempt_to_translate(line) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/xcode_build/translations/building.rb', line 4

def attempt_to_translate(line)
  if line =~ /^\=\=\= BUILD/
    notify_build_started(line)
  end
  
  return unless building?
  
  if line =~ /^\*\* (BUILD|ARCHIVE) (\w+) \*\*/
    notify_build_ended($1, $2)
    return
  end

  if @beginning_build_step
    @beginning_build_step = false
    notify_build_step(line) unless line.strip.empty?
    return
  end

  if @beginning_error_report
    if line =~ /^\(\d+ failure(s?)\)/
      @beginning_error_report = false
    else
      notify_build_step_failed(line)
    end
  end

  case line
  when /^(.*):(\d+):(\d+): error: (.*)$/
    notify_build_error($1, $2, $3, $4)
  when /^\s+setenv (\w+) (.*)/
    notify_env_var($1, $2)
  when /^Command (.*) failed with exit code (\d+)/
    notify_build_step_command_failed($1, $2)
  when /^The following build commands failed:/
    @beginning_error_report = true
  when /^\n/
    @beginning_build_step = true
  end
end

#building?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/xcode_build/translations/building.rb', line 44

def building?
  @building
end