Skip to content

Commit

Permalink
Merge pull request fastlane-community#28 from lonnyantunes/add_report…
Browse files Browse the repository at this point in the history
…_local_generation

To generate a local report by running the 'run' method from the Xcov::Manager
  • Loading branch information
Josh Holtz authored Apr 26, 2020
2 parents af07f13 + d8155b4 commit d72d527
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion danger-xcov.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 9 additions & 3 deletions lib/danger_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion lib/version.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d72d527

Please sign in to comment.