Class: Fastlane::Actions::PodLibLintAction

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

Constant Summary

Constants inherited from Fastlane::Action

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

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, deprecated_notes, lane_context, method_missing, other_action, return_type, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorsObject



103
104
105
# File 'fastlane/lib/fastlane/actions/pod_lib_lint.rb', line 103

def self.authors
  ["thierryxing"]
end

.available_optionsObject



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'fastlane/lib/fastlane/actions/pod_lib_lint.rb', line 51

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :use_bundle_exec,
                                 description: "Use bundle exec when there is a Gemfile presented",
                                 is_string: false,
                                 default_value: true),
    FastlaneCore::ConfigItem.new(key: :verbose,
                                 description: "Allow output detail in console",
                                 optional: true,
                                 is_string: false),
    FastlaneCore::ConfigItem.new(key: :allow_warnings,
                                 description: "Allow warnings during pod lint",
                                 optional: true,
                                 is_string: false),
    FastlaneCore::ConfigItem.new(key: :sources,
                                 description: "The sources of repos you want the pod spec to lint with, separated by commas",
                                 optional: true,
                                 is_string: false,
                                 type: Array,
                                 verify_block: proc do |value|
                                   UI.user_error!("Sources must be an array.") unless value.kind_of?(Array)
                                 end),
    FastlaneCore::ConfigItem.new(key: :swift_version,
                                 description: "The SWIFT_VERSION that should be used to lint the spec. This takes precedence over a .swift-version file",
                                 optional: true,
                                 is_string: true),
    FastlaneCore::ConfigItem.new(key: :use_libraries,
                                 description: "Lint uses static libraries to install the spec",
                                 is_string: false,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :fail_fast,
                                 description: "Lint stops on the first failing platform or subspec",
                                 is_string: false,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :private,
                                 description: "Lint skips checks that apply only to public specs",
                                 is_string: false,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :quick,
                                 description: "Lint skips checks that would require to download and build the spec",
                                 is_string: false,
                                 default_value: false)
  ]
end

.categoryObject



123
124
125
# File 'fastlane/lib/fastlane/actions/pod_lib_lint.rb', line 123

def self.category
  :misc
end

.descriptionObject



43
44
45
# File 'fastlane/lib/fastlane/actions/pod_lib_lint.rb', line 43

def self.description
  "Pod lib lint"
end

.detailsObject



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

def self.details
  "Test the syntax of your Podfile by linting the pod against the files of its directory"
end

.example_codeObject



111
112
113
114
115
116
117
118
119
120
121
# File 'fastlane/lib/fastlane/actions/pod_lib_lint.rb', line 111

def self.example_code
  [
    'pod_lib_lint',
    '# Allow output detail in console
    pod_lib_lint(verbose: true)',
    '# Allow warnings during pod lint
    pod_lib_lint(allow_warnings: true)',
    '# If the podspec has a dependency on another private pod, then you will have to supply the sources
    pod_lib_lint(sources: ["https://github.com/username/Specs", "https://github.com/CocoaPods/Specs"])'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



107
108
109
# File 'fastlane/lib/fastlane/actions/pod_lib_lint.rb', line 107

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

.outputObject



96
97
# File 'fastlane/lib/fastlane/actions/pod_lib_lint.rb', line 96

def self.output
end

.return_valueObject



99
100
101
# File 'fastlane/lib/fastlane/actions/pod_lib_lint.rb', line 99

def self.return_value
  nil
end

.run(params) ⇒ Object



4
5
6
7
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
# File 'fastlane/lib/fastlane/actions/pod_lib_lint.rb', line 4

def self.run(params)
  command = []

  command << "bundle exec" if params[:use_bundle_exec] && shell_out_should_use_bundle_exec?

  command << "pod lib lint"

  if params[:verbose]
    command << "--verbose"
  end

  if params[:sources]
    sources = params[:sources].join(",")
    command << "--sources='#{sources}'"
  end

  if params[:swift_version]
    swift_version = params[:swift_version]
    command << "--swift-version=#{swift_version}"
  end

  if params[:allow_warnings]
    command << "--allow-warnings"
  end

  command << "--use-libraries" if params[:use_libraries]
  command << "--fail-fast" if params[:fail_fast]
  command << "--private" if params[:private]
  command << "--quick" if params[:quick]

  result = Actions.sh(command.join(' '))
  UI.success("Pod lib lint Successfully ⬆️ ")
  return result
end