Class: Fastlane::Actions::SetPodKeyAction

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

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, details, method_missing, other_action, output, return_value, sh, step_text

Class Method Details

.authorObject



18
19
20
# File 'lib/fastlane/actions/set_pod_key.rb', line 18

def self.author
  "marcelofabri"
end

.available_optionsObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/fastlane/actions/set_pod_key.rb', line 30

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :use_bundle_exec,
                                 env_name: "FL_SET_POD_KEY_USE_BUNDLE_EXEC",
                                 description: "Use bundle exec when there is a Gemfile presented",
                                 is_string: false,
                                 default_value: true),
    FastlaneCore::ConfigItem.new(key: :key,
                                 env_name: "FL_SET_POD_KEY_ITEM_KEY",
                                 description: "The key to be saved with cocoapods-keys",
                                 is_string: true,
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :value,
                                 env_name: "FL_SET_POD_KEY_ITEM_VALUE",
                                 description: "The value to be saved with cocoapods-keys",
                                 is_string: true,
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :project,
                                 env_name: "FL_SET_POD_KEY_PROJECT",
                                 description: "The project name",
                                 is_string: true,
                                 optional: true)
  ]
end

.descriptionObject



26
27
28
# File 'lib/fastlane/actions/set_pod_key.rb', line 26

def self.description
  "Sets a value for a key with cocoapods-keys"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/fastlane/actions/set_pod_key.rb', line 55

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

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/fastlane/actions/set_pod_key.rb', line 4

def self.run(params)
  Actions.verify_gem!('cocoapods-keys')
  cmd = []

  cmd << ['bundle exec'] if File.exist?('Gemfile') && params[:use_bundle_exec]
  cmd << ['pod keys set']

  cmd << ["\"#{params[:key].shellescape}\""]
  cmd << ["\"#{params[:value].shellescape}\""]
  cmd << ["\"#{params[:project].shellescape}\""] if params[:project]

  Actions.sh(cmd.join(' '))
end