Class: PmdTester::SummaryReportBuilder

Inherits:
Object
  • Object
show all
Includes:
PmdTester, LiquidRenderer, ProjectHasher
Defined in:
lib/pmdtester/builders/summary_report_builder.rb

Overview

Building summary report to show the details about projects and pmd branchs

Constant Summary collapse

REPORT_DIR =
'target/reports/diff'
BASE_CONFIG_NAME =
'base_config.xml'
PATCH_CONFIG_NAME =
'patch_config.xml'

Constants included from PmdTester

BASE, PATCH, PR_NUM_ENV_VAR, VERSION

Instance Method Summary collapse

Methods included from ProjectHasher

#change_type, #configerror_to_hash, #configerrors_to_h, #error_to_hash, #errors_to_h, #link_template, #report_diff_to_h, #sanitize_stacktrace, #violations_to_hash

Methods included from PmdTester

#logger, logger

Methods included from LiquidRenderer

#copy_resource, #render_and_write, #render_liquid, #write_file

Instance Method Details

#write_all_projects(projects, base_details, patch_details) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/pmdtester/builders/summary_report_builder.rb', line 14

def write_all_projects(projects, base_details, patch_details)
  projects.each do |project|
    process_project(project, "#{REPORT_DIR}/#{project.name}")
  end
  logger.info 'Built all difference reports successfully!'

  FileUtils.mkdir_p(REPORT_DIR)
  write_structure(REPORT_DIR)
  copy_configs(REPORT_DIR, base_details, patch_details)
  write_index(REPORT_DIR, base_details, patch_details, projects)
  logger.info "Built summary report successfully in #{REPORT_DIR}!"
end