From d8155b45559f36c22fb0e7d1e2edd75a2dbf6735 Mon Sep 17 00:00:00 2001 From: Lonny Antunes Date: Thu, 5 Sep 2019 15:35:01 +0200 Subject: [PATCH] Added the ability to choose if a local report is generated or not --- danger-xcov.gemspec | 2 +- lib/danger_plugin.rb | 12 +++++++++--- lib/version.rb | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/danger-xcov.gemspec b/danger-xcov.gemspec index 5430f12..1b0cb3d 100644 --- a/danger-xcov.gemspec +++ b/danger-xcov.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.add_dependency 'danger', '>= 2.1' - spec.add_dependency 'xcov', '>= 1.1.2' + spec.add_dependency 'xcov', '>= 1.7.3' spec.add_development_dependency 'bundler', '~> 1.3' spec.add_development_dependency 'rake' end diff --git a/lib/danger_plugin.rb b/lib/danger_plugin.rb index 09b204e..8b8530c 100644 --- a/lib/danger_plugin.rb +++ b/lib/danger_plugin.rb @@ -58,10 +58,16 @@ def produce_report(*args) Xcov.ignore_handler = Xcov::IgnoreHandler.new # Init project - manager = Xcov::Manager.new(config) + report_json = nil + manager = Xcov::Manager.new(config) - # Parse .xccoverage - report_json = manager.parse_xccoverage + if Xcov.config[:html_report] || Xcov.config[:markdown_report] || Xcov.config[:json_report] + # Parse .xccoverage and create local report + report_json = manager.run + else + # Parse .xccoverage + report_json = manager.parse_xccoverage + end # Map and process report process_report(Xcov::Report.map(report_json)) diff --git a/lib/version.rb b/lib/version.rb index 253c0fd..f7c30dd 100644 --- a/lib/version.rb +++ b/lib/version.rb @@ -1,4 +1,4 @@ module DangerXcov - VERSION = "0.4.1" + VERSION = "0.5.0" DESCRIPTION = "Danger plugin to validate the code coverage of the files changed" end