class Fastlane::Actions::UploadSymbolsToAppmetricaAction
Public Class Methods
available_options()
click to toggle source
# File lib/fastlane/plugin/appmetrica/actions/upload_symbols_to_appmetrica.rb, line 80 def self.available_options [ FastlaneCore::ConfigItem.new(key: :binary_path, description: "The path to 'helper' binary in AppMetrica framework", optional: true, type: String), FastlaneCore::ConfigItem.new(key: :post_api_key, env_name: "APPMETRICA_POST_API_KEY", description: "Post API key. This mandatory parameter is "\ "used to upload dSYMs to AppMetrica", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :package_output_path, description: "The path where temporary archives are stored. "\ "If not specified, default system's temporary directory used instead", optional: true, type: String), FastlaneCore::ConfigItem.new(key: :verbose, description: "Verbose mode. Displays additional information", optional: true, type: String), FastlaneCore::ConfigItem.new(key: :files, description: "An optional list of dSYM files or directories that "\ "contain these files to upload. If not specified, "\ "the local working directory used by default", optional: true, type: Array) ] end
description()
click to toggle source
@!group Documentation
# File lib/fastlane/plugin/appmetrica/actions/upload_symbols_to_appmetrica.rb, line 68 def self.description "Upload dSYM symbolication files to AppMetrica" end
details()
click to toggle source
# File lib/fastlane/plugin/appmetrica/actions/upload_symbols_to_appmetrica.rb, line 76 def self.details "This plugin allows uploading dSYM symbolication files to AppMetrica. It should be applied if you use Bitcode" end
find_binary(params)
click to toggle source
# File lib/fastlane/plugin/appmetrica/actions/upload_symbols_to_appmetrica.rb, line 47 def self.find_binary(params) params[:binary_path] ||= Dir["./Pods/**/helper"].last unless params[:binary_path] UI.user_error!("Failed to find 'helper' binary. Install YandexMobileMetrica 3.8.0 pod or higher. "\ "You may specify the location of the binary by using the binary_path option") end params[:binary_path] = File.expand_path(params[:binary_path]).shellescape cli_version = Gem::Version.new(`#{params[:binary_path]} --version`.strip) unless Gem::Requirement.new(Fastlane::Appmetrica::CLI_VERSION) =~ cli_version UI.user_error!("Your 'helper' is outdatedcd, please upgrade to at least version "\ "#{Fastlane::Appmetrica::CLI_VERSION} and start again!") end end
is_supported?(platform)
click to toggle source
# File lib/fastlane/plugin/appmetrica/actions/upload_symbols_to_appmetrica.rb, line 110 def self.is_supported?(platform) [:ios, :mac].include?(platform) end
process_file(file_path, temp_dir)
click to toggle source
# File lib/fastlane/plugin/appmetrica/actions/upload_symbols_to_appmetrica.rb, line 37 def self.process_file(file_path, temp_dir) if File.extname(file_path) == ".zip" output_path = File.join(temp_dir, SecureRandom.uuid) Dir.mkdir(output_path) Actions.sh("unzip -o #{file_path.shellescape} -d #{output_path.shellescape} 2>/dev/null") return output_path end return File.absolute_path(file_path) end
run(params)
click to toggle source
# File lib/fastlane/plugin/appmetrica/actions/upload_symbols_to_appmetrica.rb, line 6 def self.run(params) find_binary(params) Dir.mktmpdir do |temp_dir| self.run_helper(temp_dir, params) end end
run_helper(temp_dir, params)
click to toggle source
# File lib/fastlane/plugin/appmetrica/actions/upload_symbols_to_appmetrica.rb, line 14 def self.run_helper(temp_dir, params) unless params[:package_output_path].nil? package_output_path = File.absolute_path(params[:package_output_path]) end files = [] files += params[:files] if params[:files] files << Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH] if Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH] files += Actions.lane_context[SharedValues::DSYM_PATHS] if Actions.lane_context[SharedValues::DSYM_PATHS] files = files.map do |file| self.process_file(file, temp_dir) unless file.nil? end cmd = [params[:binary_path], "--post-api-key=#{params[:post_api_key]}"] cmd << "--verbose" if params[:verbose] cmd << "--package-output-path=#{package_output_path.shellescape}" unless package_output_path.nil? cmd += files unless files.nil? UI.message("Starting helper") Actions.sh(cmd) end