Class: Fastlane::Actions::SetPodKeyAction

Inherits:
Fastlane::Action show all
Defined in:
fastlane/lib/fastlane/actions/set_pod_key.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, 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



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

def self.author
  "marcelofabri"
end

.available_optionsObject



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

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",
                                 type: Boolean,
                                 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",
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :value,
                                 env_name: "FL_SET_POD_KEY_ITEM_VALUE",
                                 description: "The value to be saved with cocoapods-keys",
                                 sensitive: true,
                                 code_gen_sensitive: true,
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :project,
                                 env_name: "FL_SET_POD_KEY_PROJECT",
                                 description: "The project name",
                                 optional: true)
  ]
end

.categoryObject



72
73
74
# File 'fastlane/lib/fastlane/actions/set_pod_key.rb', line 72

def self.category
  :project
end

.descriptionObject



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

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

.detailsObject



30
31
32
# File 'fastlane/lib/fastlane/actions/set_pod_key.rb', line 30

def self.details
  "Adds a key to [cocoapods-keys](https://github.com/orta/cocoapods-keys)"
end

.example_codeObject



62
63
64
65
66
67
68
69
70
# File 'fastlane/lib/fastlane/actions/set_pod_key.rb', line 62

def self.example_code
  [
    'set_pod_key(
      key: "APIToken",
      value: "1234",
      project: "MyProject"
    )'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



58
59
60
# File 'fastlane/lib/fastlane/actions/set_pod_key.rb', line 58

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 'fastlane/lib/fastlane/actions/set_pod_key.rb', line 4

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

  cmd << ['bundle exec'] if params[:use_bundle_exec] && shell_out_should_use_bundle_exec?
  cmd << ['pod keys set']

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

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