class Fastlane::Actions::ExtractCertificateAction

Constants

PROVISIONS

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/xamarin_build/actions/extract_certificate.rb, line 78
def self.authors
  ['punksta']
end
available_options() click to toggle source
# File lib/fastlane/plugin/xamarin_build/actions/extract_certificate.rb, line 37
def self.available_options
  [
    FastlaneCore::ConfigItem.new(
      key: :provision_path,
      env_name: 'FL_EXTRACT_CERTIFICATE_PR_PATH',
      description: 'Path to provision profile',
      is_string: true,
      optional: true,
      verify_block: proc do |path|
                      check_profile(path)
                    end
    ),

    FastlaneCore::ConfigItem.new(
      key: :uuid,
      env_name: 'FL_EXTRACT_CERTIFICATE_UUID',
      description: 'UUID of provision profile in default dir',
      is_string: true,
      optional: true,
      verify_block: proc do |uuid|
        provision_path = default_path(uuid)
        check_profile(provision_path)
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :log_certificate,
      env_name: 'FL_EXTRACT_CERTIFICATE_LOG',
      description: 'Logging extracting certificate',
      optional: true,
      default_value: true,
      is_string: false
    )
  ]
end
check_profile(file) click to toggle source
# File lib/fastlane/plugin/xamarin_build/actions/extract_certificate.rb, line 27
def self.check_profile(file)
  UI.user_error!('Empty input') if file.nil?
  UI.user_error!("#{file} does not exist") unless File.exist? file
  UI.user_error!("#{file} is not a file") unless File.file? file
end
default_path(uuid) click to toggle source
# File lib/fastlane/plugin/xamarin_build/actions/extract_certificate.rb, line 33
def self.default_path(uuid)
  File.join PROVISIONS, "#{uuid}.mobileprovision"
end
description() click to toggle source
# File lib/fastlane/plugin/xamarin_build/actions/extract_certificate.rb, line 18
def self.description
  'Extract certificate public key from provision profile'
end
details() click to toggle source
# File lib/fastlane/plugin/xamarin_build/actions/extract_certificate.rb, line 22
def self.details
  'You can use it to get info about signing certificate' \
    'like certificate name and id'
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/xamarin_build/actions/extract_certificate.rb, line 82
def self.is_supported?(platform)
  [:ios, :mac].include?(platform)
end
return_value() click to toggle source
# File lib/fastlane/plugin/xamarin_build/actions/extract_certificate.rb, line 73
def self.return_value
  'Returns OpenSSL::X509::Certificate object representing' \
    'signing certificate from provision profile'
end
run(params) click to toggle source
# File lib/fastlane/plugin/xamarin_build/actions/extract_certificate.rb, line 11
def self.run(params)
  path = params[:provision_path]
  path = default_path(params[:uuid]) if path.nil?
  check_profile(path)
  return ProvisionUtil::get_cert_from_provision(path)
end