class Fastlane::Actions::GetIpaInfoPlistValueAction

Public Class Methods

authors() click to toggle source
# File fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb, line 58
def self.authors
  ["johnboiles"]
end
available_options() click to toggle source
# 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",
                                 default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
                                 default_value_dynamic: true)
  ]
end
category() click to toggle source
# File fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb, line 76
def self.category
  :project
end
description() click to toggle source

@!group Documentation

# 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
details() click to toggle source
# 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_code() click to toggle source
# File fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb, line 66
def self.example_code
  [
    'get_ipa_info_plist_value(ipa: "path.ipa", key: "KEY_YOU_READ")'
  ]
end
is_supported?(platform) click to toggle source
# File fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb, line 62
def self.is_supported?(platform)
  [:ios, :mac].include?(platform)
end
output() click to toggle source
# File fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb, line 48
def self.output
  [
    ['GET_IPA_INFO_PLIST_VALUE_CUSTOM_VALUE', 'The value of the last plist file that was parsed']
  ]
end
return_type() click to toggle source
# File fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb, line 72
def self.return_type
  :string
end
return_value() click to toggle source
# File fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb, line 54
def self.return_value
  "Returns the value in the .ipa's Info.plist corresponding to the passed in Key"
end
run(params) click to toggle source
# 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