Class: AppRepo::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/apprepo/options.rb

Overview

Provides available options for the commands generator

Class Method Summary collapse

Class Method Details

.available_optionsObject

rubocop:disable Metrics/AbcSize



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/apprepo/options.rb', line 7

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :ipa,
                                 short_option: '-i',
                                 optional: true,
                                 env_name: 'APPREPO_IPA_PATH',
                                 description: 'Path to your ipa file',
                                 default_value: Dir['*.ipa'].first,
                                 verify_block: proc do |value|
                                   UI.user_error!("Could not find ipa file at path '#{value}'") unless File.exist?(value)
                                   UI.user_error!("'#{value}' doesn't seem to be an ipa file") unless value.end_with?('.ipa')
                                 end),
    FastlaneCore::ConfigItem.new(key: :app_identifier,
                                 short_option: '-b',
                                 optional: false,
                                 env_name: 'APPREPO_APP_ID',
                                 description: 'Your bundle identifier',
                                 default_value: ''),
    FastlaneCore::ConfigItem.new(key: :app_code,
                                 short_option: '-c',
                                 optional: true,
                                 env_name: 'APPREPO_APPCODE',
                                 description: 'APPCODE value for apprepo'),
    FastlaneCore::ConfigItem.new(key: :repo_url,
                                 short_option: '-r',
                                 optional: false,
                                 env_name: 'APPREPO_URL',
                                 description: 'URL of your Apprepo server'),
    FastlaneCore::ConfigItem.new(key: :repo_user,
                                 short_option: '-u',
                                 optional: false,
                                 env_name: 'APPREPO_USER',
                                 description: 'USER of your Apprepo server'),
    FastlaneCore::ConfigItem.new(key: :repo_password,
                                 short_option: '-p',
                                 optional: true,
                                 env_name: 'APPREPO_PASSWORD',
                                 description: 'PASSWORD for your Apprepo server (not for production)',
                                 conflicting_options: [:repo_key],
                                 conflict_block: proc do |value|
                                   UI.user_error!("You can't use 'password' and '#{value.key}' options in one run.")
                                 end),
    FastlaneCore::ConfigItem.new(key: :repo_key,
                                 short_option: '-k',
                                 optional: false,
                                 env_name: 'APPREPO_KEY',
                                 description: 'RSA key for your Apprepo server',
                                 conflicting_options: [:repo_password],
                                 conflict_block: proc do |value|
                                   UI.user_error!("You can't use 'repo_key' and '#{value.key}' options in one run.")
                                 end),
    FastlaneCore::ConfigItem.new(key: :repo_description,
                                 short_option: '-d',
                                 optional: true,
                                 description: 'Long detailed description for your Apprepo server',
                                 default_value: ''),
    FastlaneCore::ConfigItem.new(key: :repo_summary,
                                 short_option: '-s',
                                 optional: true,
                                 description: 'Short description for your Apprepo server',
                                 default_value: ''),
    FastlaneCore::ConfigItem.new(key: :manifest_path,
                                 short_option: '-m',
                                 description: 'Path to the folder containing the metadata files',
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :repo_title,
                                 short_option: '-a',
                                 description: 'Title of the app',
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :appcode,
                                 short_option: '-o',
                                 description: 'Name of the app on AppRepo',
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :skip_binary_upload,
                                 description: 'Skip uploading an ipa or to AppRepo',
                                 is_string: false,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :app_version,
                                 short_option: '-z',
                                 description: 'The version that should be edited or created',
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :skip_manifest,
                                 description: "Don't upload the metadata (e.g. title, description), this will still upload screenshots",
                                 is_string: false,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :notify,
                                 description: 'Notify AppRepo users on update',
                                 is_string: false,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :build_number,
                                 short_option: '-n',
                                 description: 'If set the given build number (already uploaded to iTC) will be used instead of the current built one',
                                 optional: true,
                                 conflicting_options: [:ipa],
                                 conflict_block: proc do |value|
                                   UI.user_error!("You can't use 'build_number' and '#{value.key}' options in one run.")
                                 end),

    # App Metadata
    # Non Localised
    FastlaneCore::ConfigItem.new(key: :app_icon,
                                 description: 'Metadata: The path to the app icon',
                                 optional: true,
                                 short_option: '-l',
                                 verify_block: proc do |value|
                                   UI.user_error!("Could not find png file at path '#{value}'") unless File.exist?(value)
                                   UI.user_error!("'#{value}' doesn't seem to be a png file") unless value.end_with?('.png')
                                 end)
  ]
end