Class: Fastlane::Actions::BuildLogInfoAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::BuildLogInfoAction
- Defined in:
- lib/fastlane/plugin/build_log_info/actions/build_log_info_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
68 69 70 |
# File 'lib/fastlane/plugin/build_log_info/actions/build_log_info_action.rb', line 68 def self. ["tarappo"] end |
.available_options ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/fastlane/plugin/build_log_info/actions/build_log_info_action.rb', line 79 def self. [ FastlaneCore::ConfigItem.new(key: :file_path, env_name: 'file_path', description: 'Path to result json file. ', default_value: Dir['./build/reports/*.json'].last, optional: true, verify_block: proc do |value| raise "Couldn't find file".red unless File.exist?(value) end) ] end |
.description ⇒ Object
64 65 66 |
# File 'lib/fastlane/plugin/build_log_info/actions/build_log_info_action.rb', line 64 def self.description "build log information" end |
.details ⇒ Object
75 76 77 |
# File 'lib/fastlane/plugin/build_log_info/actions/build_log_info_action.rb', line 75 def self.details "build log information" end |
.is_supported?(platform) ⇒ Boolean
92 93 94 |
# File 'lib/fastlane/plugin/build_log_info/actions/build_log_info_action.rb', line 92 def self.is_supported?(platform) [:ios].include?(platform) end |
.return_value ⇒ Object
72 73 |
# File 'lib/fastlane/plugin/build_log_info/actions/build_log_info_action.rb', line 72 def self.return_value end |
.run(params) ⇒ Object
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 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/fastlane/plugin/build_log_info/actions/build_log_info_action.rb', line 8 def self.run(params) begin path = params[:file_path] @json_data = JSON.parse(File.open(path).read) rescue => error UI.user_error!("JSON File Error:#{error.}") end all_keys = %w[warnings ld_warnings compile_warnings errors compile_errors file_missing_errors undefined_symbols_errors duplicate_symbols_errors tests_failures tests_summary_messages] # summary summary_rows = [] all_keys.each do |key| value = @json_data[key].size if value > 0 summary_rows << [key.to_s.red, value.to_s.red] else summary_rows << [key, value.to_s.green] end end # summary summary_table = Helper::BuildLogInfoHelper.summary_table( title: "Summary", headings: %w[Key Num], rows: summary_rows ) puts(summary_table) # detail all_keys.each do |key| rows = [] @json_data[key].each do |line| rows << [line["file_path"], line["reason"]] end title_num = @json_data[key].size # if num is 0 then do not display next if title_num == 0 # detail table summary_table = Helper::BuildLogInfoHelper.summary_table( title: "#{key} #{title_num}", headings: %w[FilePath Reason], rows: rows ) puts(summary_table) end end |