Class: Fastlane::Actions::XcovAction

Inherits:
Fastlane::Action show all
Defined in:
fastlane/lib/fastlane/actions/xcov.rb

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, deprecated_notes, lane_context, method_missing, other_action, output, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorObject



22
23
24
# File 'fastlane/lib/fastlane/actions/xcov.rb', line 22

def self.author
  "nakiostudio"
end

.available_optionsObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'fastlane/lib/fastlane/actions/xcov.rb', line 26

def self.available_options
  return [] unless Helper.mac?

  # We call Gem::Specification.find_by_name in many more places than this, but for right now
  # this is the only place we're having trouble. If there are other reports about RubyGems
  # 2.6.2 causing problems, we may need to move this code and require it someplace better,
  # like fastlane_core
  require 'fastlane/core_ext/bundler_monkey_patch'

  begin
    Gem::Specification.find_by_name('xcov')
  rescue Gem::LoadError
    # Catched missing gem exception and returned empty array
    # to avoid unused_options_spec failure
    return []
  end

  require 'xcov'
  Xcov::Options.available_options
end

.categoryObject



61
62
63
# File 'fastlane/lib/fastlane/actions/xcov.rb', line 61

def self.category
  :testing
end

.descriptionObject



11
12
13
# File 'fastlane/lib/fastlane/actions/xcov.rb', line 11

def self.description
  "Nice code coverage reports without hassle"
end

.detailsObject



15
16
17
18
19
20
# File 'fastlane/lib/fastlane/actions/xcov.rb', line 15

def self.details
  [
    "Create nice code coverage reports and post coverage summaries on Slack *(xcov gem is required)*.",
    "More information: [https://github.com/nakiostudio/xcov](https://github.com/nakiostudio/xcov)."
  ].join("\n")
end

.example_codeObject



51
52
53
54
55
56
57
58
59
# File 'fastlane/lib/fastlane/actions/xcov.rb', line 51

def self.example_code
  [
    'xcov(
      workspace: "YourWorkspace.xcworkspace",
      scheme: "YourScheme",
      output_directory: "xcov_output"
    )'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



47
48
49
# File 'fastlane/lib/fastlane/actions/xcov.rb', line 47

def self.is_supported?(platform)
  [:ios, :mac].include?(platform)
end

.run(values) ⇒ Object



4
5
6
7
8
9
# File 'fastlane/lib/fastlane/actions/xcov.rb', line 4

def self.run(values)
  Actions.verify_gem!('xcov')
  require 'xcov'

  Xcov::Manager.new(values).run
end