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
43
44
45
46
47
48
49
50
51
52
# 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|warning): (.*)$/ # xcode 4.3.2
    if $5 == 'error'
      notify_build_error($1, $2, $3, $6)
    else
      notify_build_warning($1, $2, $3, $6)
    end
  when /^(.*):(\d+):(\d+): (error|warning): (.*)$/ # xcode < 4.3.2
    if $4 == 'error'
      notify_build_error($1, $2, $3, $5)
    else
      notify_build_warning($1, $2, $3, $5)
    end
  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)


54
55
56
# File 'lib/xcode_build/translations/building.rb', line 54

def building?
  @building
end