Class: Fastlane::Actions::GetIpaInfoPlistValueAction

Inherits:
Fastlane::Action show all
Defined in:
fastlane/lib/fastlane/actions/get_ipa_info_plist_value.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, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorsObject


59
60
61
# File 'fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb', line 59

def self.authors
  ["johnboiles"]
end

.available_optionsObject


34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb', line 34

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :key,
                                 env_name: "FL_GET_IPA_INFO_PLIST_VALUE_KEY",
                                 description: "Name of parameter",
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :ipa,
                                 env_name: "FL_GET_IPA_INFO_PLIST_VALUE_IPA",
                                 description: "Path to IPA",
                                 is_string: true,
                                 default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
                                 default_value_dynamic: true)
  ]
end

.categoryObject


77
78
79
# File 'fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb', line 77

def self.category
  :project
end

.descriptionObject


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

def self.description
  "Returns a value from Info.plist inside a .ipa file"
end

.detailsObject


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

def self.details
  "This is useful for introspecting Info.plist files for `.ipa` files that have already been built."
end

.example_codeObject


67
68
69
70
71
# File 'fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb', line 67

def self.example_code
  [
    'get_ipa_info_plist_value(ipa: "path.ipa", key: "KEY_YOU_READ")'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:


63
64
65
# File 'fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb', line 63

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

.outputObject


49
50
51
52
53
# File 'fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb', line 49

def self.output
  [
    ['GET_IPA_INFO_PLIST_VALUE_CUSTOM_VALUE', 'The value of the last plist file that was parsed']
  ]
end

.return_typeObject


73
74
75
# File 'fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb', line 73

def self.return_type
  :string
end

.return_valueObject


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

def self.return_value
  "Returns the value in the .ipa's Info.plist corresponding to the passed in Key"
end

.run(params) ⇒ Object


8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb', line 8

def self.run(params)
  ipa = File.expand_path(params[:ipa])
  key = params[:key]
  plist = FastlaneCore::IpaFileAnalyser.fetch_info_plist_file(ipa)
  value = plist[key]

  Actions.lane_context[SharedValues::GET_IPA_INFO_PLIST_VALUE_CUSTOM_VALUE] = value

  return value
rescue => ex
  UI.error(ex)
  UI.error("Unable to find plist file at '#{ipa}'")
end