Class: AzureFormatter

Inherits:
XCPretty::Simple
  • Object
show all
Defined in:
lib/xcpretty_azure_formatter.rb

Overview

xcpretty formatter for Azure Pipelines

Instance Method Summary collapse

Instance Method Details

#_log_issue(type, message, file) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/xcpretty_azure_formatter.rb', line 37

def _log_issue(type, message, file)
  log_params = "type=#{type}"
  unless file.nil?
    file_parts = file.split(":")
    log_params += ";sourcepath=#{file_parts[0]}"
    log_params += ";linenumber=#{file_parts[1]}" if file_parts.length >= 2
    log_params += ";columnnumber=#{file_parts[2]}" if file_parts.length >= 3
    log_params += ";"
  end
  "##vso[task.logissue #{log_params}]#{message}"
end

#format_compile_error(_file, file_path, reason, _line, _cursor) ⇒ Object



21
22
23
# File 'lib/xcpretty_azure_formatter.rb', line 21

def format_compile_error(_file, file_path, reason, _line, _cursor)
  _log_issue("error", reason, file_path)
end

#format_compile_warning(_file_name, file_path, reason, _line, _cursor) ⇒ Object



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

def format_compile_warning(_file_name, file_path, reason, _line, _cursor)
  _log_issue("warning", reason, file_path)
end

#format_duplicate_symbols(message, _file_paths) ⇒ Object



33
34
35
# File 'lib/xcpretty_azure_formatter.rb', line 33

def format_duplicate_symbols(message, _file_paths)
  _log_issue("error", message, nil)
end

#format_error(message) ⇒ Object



17
18
19
# File 'lib/xcpretty_azure_formatter.rb', line 17

def format_error(message)
  _log_issue("error", message, nil)
end

#format_file_missing_error(reason, file_path) ⇒ Object



25
26
27
# File 'lib/xcpretty_azure_formatter.rb', line 25

def format_file_missing_error(reason, file_path)
  _log_issue("error", reason, file_path)
end

#format_ld_warning(message) ⇒ Object



5
6
7
# File 'lib/xcpretty_azure_formatter.rb', line 5

def format_ld_warning(message)
  _log_issue("warning", message, nil)
end

#format_undefined_symbols(message, _symbol, _reference) ⇒ Object



29
30
31
# File 'lib/xcpretty_azure_formatter.rb', line 29

def format_undefined_symbols(message, _symbol, _reference)
  _log_issue("error", message, nil)
end

#format_warning(message) ⇒ Object



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

def format_warning(message)
  _log_issue("warning", message, nil)
end