class Fastlane::Actions::AppInfoAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/app_info/actions/app_info_action.rb, line 37
def self.authors
  ["icyleaf <icyleaf.cn@gmail.com>"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/app_info/actions/app_info_action.rb, line 55
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :file,
                                 env_name: 'APP_INFO_FILE',
                                 description: 'Path to your ipa/apk file. Optional if you use the `gym`, `ipa` or `xcodebuild` action. ',
                                 default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] || Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH] || Dir['*.ipa'].last || Dir['*.apk'].last,
                                 optional: true,
                                 verify_block: proc do |value|
                                   raise "Couldn't find app file".red unless File.exist?(value)
                                 end),
    FastlaneCore::ConfigItem.new(key: :clean,
                                 env_name: 'APP_INFO_CLEAN',
                                 description: 'Clean cache files to reduce disk size',
                                 default_value: true,
                                 optional: true)
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/app_info/actions/app_info_action.rb, line 33
def self.description
  "Parse and dump mobile app(ipa/apk) metedata."
end
details() click to toggle source
# File lib/fastlane/plugin/app_info/actions/app_info_action.rb, line 41
def self.details
  "Teardown tool for mobile app(ipa/apk), analysis metedata like version, name, icon etc."
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/app_info/actions/app_info_action.rb, line 73
def self.is_supported?(platform)
  %i[ios android].include?(platform)
end
output() click to toggle source
# File lib/fastlane/plugin/app_info/actions/app_info_action.rb, line 49
def self.output
  [
    [SharedValues::APP_INFO.to_s, 'The JSON formated metadata of given app']
  ]
end
print_table(raw) click to toggle source
return_value() click to toggle source
# File lib/fastlane/plugin/app_info/actions/app_info_action.rb, line 45
def self.return_value
  "Returns a Hash formated metadata of given app"
end
run(params) click to toggle source
# File lib/fastlane/plugin/app_info/actions/app_info_action.rb, line 11
def self.run(params)
  file = params.fetch(:file)
  UI.user_error! 'You have to either pass an ipa or an apk file' unless file
  file = File.expand_path(file)
  app = ::AppInfo.parse(file)
  raw = Helper::AppInfoHelper.raw_data(app)

  UI.verbose "Raw params: #{raw}"
  print_table(raw)
  app.clear! if params.fetch(:clean)

  Helper::AppInfoHelper.store_sharedvalue(:APP_INFO, JSON.dump(raw))
  raw
end