Class: Fastlane::Actions::AdLicenselintAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/ad_licenselint/actions/ad_licenselint_action.rb

Class Method Summary collapse

Class Method Details

.authorsObject



29
30
31
# File 'lib/fastlane/plugin/ad_licenselint/actions/ad_licenselint_action.rb', line 29

def self.authors
  ["Pierre Felgines"]
end

.available_optionsObject



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/fastlane/plugin/ad_licenselint/actions/ad_licenselint_action.rb', line 43

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :format,
                            env_name: "AD_LICENSE_LINT_FORMAT",
                         description: "The format of the output (#{ADLicenseLint::Constant::AVAILABLE_OPTIONS})",
                            optional: true,
                       default_value: ADLicenseLint::Constant::MARKDOWN_FORMAT_OPTION,
                                type: String),
    FastlaneCore::ConfigItem.new(key: :path,
                            env_name: "AD_LICENSE_LINT_PATH",
                         description: "The path of the directory that contains the Podfile",
                            optional: true,
                       default_value: ".",
                                type: String),
    FastlaneCore::ConfigItem.new(key: :all,
                            env_name: "AD_LICENSE_LINT_FORMAT",
                         description: "Display all the licenses",
                            optional: true,
                       default_value: false,
                           is_string: false),
    FastlaneCore::ConfigItem.new(key: :only,
                            env_name: "AD_LICENSE_LINT_FORMAT",
                         description: "Subset of pods",
                            optional: true,
                                type: Array),
  ]
end

.descriptionObject



25
26
27
# File 'lib/fastlane/plugin/ad_licenselint/actions/ad_licenselint_action.rb', line 25

def self.description
  "Lint the licenses for iOS projects"
end

.detailsObject



39
40
41
# File 'lib/fastlane/plugin/ad_licenselint/actions/ad_licenselint_action.rb', line 39

def self.details
  "Lint the licenses for iOS projects"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/fastlane/plugin/ad_licenselint/actions/ad_licenselint_action.rb', line 78

def self.is_supported?(platform)
  platform == :ios
end

.outputObject



71
72
73
74
75
76
# File 'lib/fastlane/plugin/ad_licenselint/actions/ad_licenselint_action.rb', line 71

def self.output
  [
    ['AD_LICENSE_LINT_REPORT', 'Hash representation of the report'],
    ['AD_LICENSE_LINT_SUMMARY', 'Formatted string of the result']
  ]
end

.return_valueObject



33
34
35
36
37
# File 'lib/fastlane/plugin/ad_licenselint/actions/ad_licenselint_action.rb', line 33

def self.return_value
  [
    "A string that displays licenses with warnings"
  ].join("\n")
end

.run(params) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/fastlane/plugin/ad_licenselint/actions/ad_licenselint_action.rb', line 13

def self.run(params)
  runner = ADLicenseLint::Runner.new({
    format: params[:format],
    path: params[:path],
    all: params[:all],
    only: params[:only]
  })
  report = runner.create_report
  Actions.lane_context[SharedValues::AD_LICENSE_LINT_REPORT] = report.to_hash
  Actions.lane_context[SharedValues::AD_LICENSE_LINT_SUMMARY] = runner.format(report)
end