Class: Deliver::Options

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

Class Method Summary collapse

Class Method Details

.available_optionsObject



6
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/deliver/options.rb', line 6

def self.available_options
  user = CredentialsManager::AppfileConfig.try_fetch_value(:itunes_connect_id)
  user ||= CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)

  [
    FastlaneCore::ConfigItem.new(key: :username,
                                 short_option: "-u",
                                 env_name: "DELIVER_USERNAME",
                                 description: "Your Apple ID Username",
                                 default_value: user),
    FastlaneCore::ConfigItem.new(key: :app_identifier,
                                 short_option: "-a",
                                 env_name: "DELIVER_APP_IDENTIFIER",
                                 description: "The bundle identifier of your app",
                                 optional: true,
                                 default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)),
    FastlaneCore::ConfigItem.new(key: :app,
                                 short_option: "-p",
                                 env_name: "DELIVER_APP_ID",
                                 description: "The app ID of the app you want to use/modify",
                                 is_string: false), # don't add any verification here, as it's used to store a spaceship ref
    FastlaneCore::ConfigItem.new(key: :ipa,
                                 short_option: "-i",
                                 optional: true,
                                 env_name: "DELIVER_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 '#{File.expand_path(value)}'") unless File.exist?(value)
                                   UI.user_error!("'#{value}' doesn't seem to be an ipa file") unless value.end_with?(".ipa")
                                 end,
                                 conflicting_options: [:pkg],
                                 conflict_block: proc do |value|
                                   UI.user_error!("You can't use 'ipa' and '#{value.key}' options in one run.")
                                 end),
    FastlaneCore::ConfigItem.new(key: :pkg,
                                 short_option: "-c",
                                 optional: true,
                                 env_name: "DELIVER_PKG_PATH",
                                 description: "Path to your pkg file",
                                 default_value: Dir["*.pkg"].first,
                                 verify_block: proc do |value|
                                   UI.user_error!("Could not find pkg file at path '#{File.expand_path(value)}'") unless File.exist?(value)
                                   UI.user_error!("'#{value}' doesn't seem to be a pkg file") unless value.end_with?(".pkg")
                                 end,
                                 conflicting_options: [:ipa],
                                 conflict_block: proc do |value|
                                   UI.user_error!("You can't use 'pkg' and '#{value.key}' options in one run.")
                                 end),
    FastlaneCore::ConfigItem.new(key: :platform,
                                 short_option: "-j",
                                 env_name: "DELIVER_PLATFORM",
                                 description: "The platform to use (optional)",
                                 optional: true,
                                 default_value: "ios",
                                 verify_block: proc do |value|
                                   UI.user_error!("The platform can only be ios, appletvos, or osx") unless %('ios', 'appletvos', 'osx').include? value
                                 end),
    FastlaneCore::ConfigItem.new(key: :metadata_path,
                                 short_option: '-m',
                                 description: "Path to the folder containing the metadata files",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :screenshots_path,
                                 short_option: '-w',
                                 description: "Path to the folder containing the screenshots",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :skip_binary_upload,
                                 description: "Skip uploading an ipa or pkg to iTunes Connect",
                                 is_string: false,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :skip_screenshots,
                                 description: "Don't upload the screenshots",
                                 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_metadata,
                                 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: :force,
                                 short_option: "-f",
                                 description: "Skip the HTML report file verification",
                                 is_string: false,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :submit_for_review,
                                 env_name: "DELIVER_SUBMIT_FOR_REVIEW",
                                 description: "Submit the new version for Review after uploading everything",
                                 is_string: false,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :automatic_release,
                                 description: "Should the app be automatically released once it's approved?",
                                 is_string: false,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :price_tier,
                                 short_option: "-r",
                                 description: "The price tier of this application",
                                 is_string: false,
                                 optional: true),
    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, :pkg],
                                 conflict_block: proc do |value|
                                   UI.user_error!("You can't use 'build_number' and '#{value.key}' options in one run.")
                                 end),
    FastlaneCore::ConfigItem.new(key: :app_rating_config_path,
                                 short_option: "-g",
                                 description: "Path to the app rating's config",
                                 is_string: true,
                                 optional: true,
                                 verify_block: proc do |value|
                                   UI.user_error!("Could not find config file at path '#{File.expand_path(value)}'") unless File.exist?(value)
                                   UI.user_error!("'#{value}' doesn't seem to be a JSON file") unless value.end_with?(".json")
                                 end),
    FastlaneCore::ConfigItem.new(key: :submission_information,
                                 short_option: "-b",
                                 description: "Extra information for the submission (e.g. third party content)",
                                 is_string: false,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :team_id,
                                 short_option: "-k",
                                 env_name: "DELIVER_TEAM_ID",
                                 description: "The ID of your iTunes Connect team if you're in multiple teams",
                                 optional: true,
                                 is_string: false, # as we also allow integers, which we convert to strings anyway
                                 default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_id),
                                 verify_block: proc do |value|
                                   ENV["FASTLANE_ITC_TEAM_ID"] = value.to_s
                                 end),
    FastlaneCore::ConfigItem.new(key: :team_name,
                                 short_option: "-e",
                                 env_name: "DELIVER_TEAM_NAME",
                                 description: "The name of your iTunes Connect team if you're in multiple teams",
                                 optional: true,
                                 default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_name),
                                 verify_block: proc do |value|
                                   ENV["FASTLANE_ITC_TEAM_NAME"] = value.to_s
                                 end),
    FastlaneCore::ConfigItem.new(key: :dev_portal_team_id,
                                 short_option: "-s",
                                 env_name: "DELIVER_DEV_PORTAL_TEAM_ID",
                                 description: "The short ID of your Developer Portal team, if you're in multiple teams. Different from your iTC team ID!",
                                 optional: true,
                                 is_string: true,
                                 default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_id),
                                 verify_block: proc do |value|
                                   ENV["FASTLANE_TEAM_ID"] = value.to_s
                                 end),
    FastlaneCore::ConfigItem.new(key: :dev_portal_team_name,
                                 short_option: "-y",
                                 env_name: "DELIVER_DEV_PORTAL_TEAM_NAME",
                                 description: "The name of your Developer Portal team if you're in multiple teams",
                                 optional: true,
                                 default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_name),
                                 verify_block: proc do |value|
                                   ENV["FASTLANE_TEAM_NAME"] = value.to_s
                                 end),
    FastlaneCore::ConfigItem.new(key: :itc_provider,
                                 env_name: "DELIVER_ITC_PROVIDER",
                                 description: "The provider short name to be used with the iTMSTransporter to identify your team",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :overwrite_screenshots,
                                 env_name: "DELIVER_OVERWRITE_SCREENSHOTS",
                                 description: "Clear all previously uploaded screenshots before uploading the new ones",
                                 is_string: false,
                                 default_value: false),

    # 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 '#{File.expand_path(value)}'") unless File.exist?(value)
                                   UI.user_error!("'#{value}' doesn't seem to be a png file") unless value.end_with?(".png")
                                 end),
    FastlaneCore::ConfigItem.new(key: :apple_watch_app_icon,
                                 description: "Metadata: The path to the Apple Watch app icon",
                                 optional: true,
                                 short_option: "-q",
                                 verify_block: proc do |value|
                                   UI.user_error!("Could not find png file at path '#{File.expand_path(value)}'") unless File.exist?(value)
                                   UI.user_error!("'#{value}' doesn't seem to be a png file") unless value.end_with?(".png")
                                 end),
    FastlaneCore::ConfigItem.new(key: :copyright,
                                 description: "Metadata: The copyright notice",
                                 optional: true,
                                 is_string: true),
    FastlaneCore::ConfigItem.new(key: :primary_category,
                                 description: "Metadata: The english name of the primary category(e.g. `Business`, `Books`)",
                                 optional: true,
                                 is_string: true),
    FastlaneCore::ConfigItem.new(key: :secondary_category,
                                 description: "Metadata: The english name of the secondary category(e.g. `Business`, `Books`)",
                                 optional: true,
                                 is_string: true),
    FastlaneCore::ConfigItem.new(key: :primary_first_sub_category,
                                 description: "Metadata: The english name of the primary first sub category(e.g. `Educational`, `Puzzle`)",
                                 optional: true,
                                 is_string: true),
    FastlaneCore::ConfigItem.new(key: :primary_second_sub_category,
                                 description: "Metadata: The english name of the primary second sub category(e.g. `Educational`, `Puzzle`)",
                                 optional: true,
                                 is_string: true),
    FastlaneCore::ConfigItem.new(key: :secondary_first_sub_category,
                                 description: "Metadata: The english name of the secondary first sub category(e.g. `Educational`, `Puzzle`)",
                                 optional: true,
                                 is_string: true),
    FastlaneCore::ConfigItem.new(key: :secondary_second_sub_category,
                                 description: "Metadata: The english name of the secondary second sub category(e.g. `Educational`, `Puzzle`)",
                                 optional: true,
                                 is_string: true),
    FastlaneCore::ConfigItem.new(key: :app_review_information,
                                 description: "Metadata: A hash containing the review information",
                                 optional: true,
                                 is_string: false),
    # Localised
    FastlaneCore::ConfigItem.new(key: :description,
                                 description: "Metadata: The localised app description",
                                 optional: true,
                                 is_string: false),
    FastlaneCore::ConfigItem.new(key: :name,
                                 description: "Metadata: The localised app name",
                                 optional: true,
                                 is_string: false),
    FastlaneCore::ConfigItem.new(key: :keywords,
                                 description: "Metadata: An array of localised keywords",
                                 optional: true,
                                 is_string: false,
                                 verify_block: proc do |value|
                                   UI.user_error!(":keywords must be a Hash, with the language being the key") unless value.kind_of?(Hash)
                                   value.each do |language, keywords|
                                     # Auto-convert array to string
                                     keywords = keywords.join(", ") if keywords.kind_of?(Array)
                                     value[language] = keywords

                                     UI.user_error!(":keywords must be a hash with all values being strings") unless keywords.kind_of?(String)
                                   end
                                 end),
    FastlaneCore::ConfigItem.new(key: :release_notes,
                                 description: "Metadata: Localised release notes for this version",
                                 optional: true,
                                 is_string: false),
    FastlaneCore::ConfigItem.new(key: :privacy_url,
                                 description: "Metadata: Localised privacy url",
                                 optional: true,
                                 is_string: false),
    FastlaneCore::ConfigItem.new(key: :support_url,
                                 description: "Metadata: Localised support url",
                                 optional: true,
                                 is_string: false),
    FastlaneCore::ConfigItem.new(key: :marketing_url,
                                 description: "Metadata: Localised marketing url",
                                 optional: true,
                                 is_string: false)
  ]
end