Class: Fastlane::MatchImport::APNSFileOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/match_import/apns_file_options.rb

Class Method Summary collapse

Class Method Details

.available_optionsObject



14
15
16
17
18
19
20
21
22
# File 'lib/fastlane/plugin/match_import/apns_file_options.rb', line 14

def self.available_options
  all = Fastlane::MatchImport::Options.available_options

  exclude_options.each do |key|
    (i = all.find_index { |item| item.key == key }) && all.delete_at(i)
  end

  return all + custom_options
end

.custom_optionsObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fastlane/plugin/match_import/apns_file_options.rb', line 24

def self.custom_options
  source_path_index = Fastlane::MatchImport::CustomFileOptions.available_options.find_index { |item| item.key == :source_path }
  source_path = Fastlane::MatchImport::CustomFileOptions.available_options[source_path_index] if source_path_index
  source_path_array = source_path.nil? ? [] : [source_path]

  [
    FastlaneCore::ConfigItem.new(key: :cert_file_name,
                               env_name: "MATCH_IMPORT_CERT_FILENAME",
                               description: "Certificare .cer to import",
                               optional: false),
    FastlaneCore::ConfigItem.new(key: :p12_file_name,
                               env_name: "MATCH_IMPORT_P12_FILENAME",
                               description: "Private key .p12 to import. Should have empty password for correct export to keychain",
                               optional: false)
  ] + source_path_array
end

.exclude_optionsObject



7
8
9
10
11
12
# File 'lib/fastlane/plugin/match_import/apns_file_options.rb', line 7

def self.exclude_options
  # [:keychain_name, :keychain_password]
  # Don't know how to exclude unused options and don't get error like:
  # Could not find option 'type' in the list of available options
  []
end