deliver 0.11.1.beta → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2239fd5bba34fcb6740d557e361cc46cff1b3dc9
4
- data.tar.gz: 79bfbbb21f2a6661f100219071e97982af26127e
3
+ metadata.gz: 8afb0b10b73ef864caba0f7e22f3a179bfefe4b3
4
+ data.tar.gz: 3df6b0d6a8e7795b3ab5987ebba891e42d756480
5
5
  SHA512:
6
- metadata.gz: c63951ad37598e81d9345d18010f2ac30a8a8877c41827d25bcef8f001008d95ec097ce1bc84ae22d84d84f92691a91601f3be918321fe8106df84ed0667e62e
7
- data.tar.gz: 326323368895b94511146c459a7eed97dfd31bfa89c3ee7f57e577aa8d9a4a07d9b5b4f970abce7ac5c7236e0765f235fee4464655a0e6f41728a055d2c4774d
6
+ metadata.gz: 6a793c043a3c32fa93b92c58f4b3141a298571a17398a930c251d4d3797acb68e9ee2310dddce740a05ac9c0769e1f45256dd86e84771f225b223f246e9f58eb
7
+ data.tar.gz: 1e74130e251d1a42bce10b81fedf1d40b684896c4d5ad2cd9f53da48b90f82e6d07f143e39b7a1748f8dab4387ace3c3b49aea9cc83d1105f3e5e91f9a66b74b
@@ -67,6 +67,7 @@
67
67
  margin-left: 25px;
68
68
  margin-right: 25px;
69
69
  margin-top: 22px;
70
+ font-weight: 300;
70
71
  }
71
72
 
72
73
  #app-screenshots {
@@ -145,7 +145,14 @@ module Deliver
145
145
  # as keys.
146
146
  # @raise (AppMetadataParameterError) Is thrown when don't pass a correct hash with correct language codes.
147
147
  def update_changelog(hash)
148
- update_metadata_key(:version_whats_new, hash)
148
+ # check if we're allowed to do that
149
+ if FastlaneCore::ItunesSearchApi.fetch(@app.apple_id)
150
+ # App is already in the store
151
+ update_metadata_key(:version_whats_new, hash)
152
+ else
153
+ # App is not in the store, skipping changelog for now
154
+ Helper.log.info "It seems like this it the initial release of your app, which can't contain a changelog. Skipping the changelog for now.".yellow
155
+ end
149
156
  end
150
157
 
151
158
  # Updates the Marketing URL
@@ -105,7 +105,6 @@ module Deliver
105
105
 
106
106
  def set_screenshots_for_each_language(hash, use_framed = false)
107
107
  raise AppMetadataParameterError.new("Parameter needs to be an hash, containg strings with the new description") unless hash.kind_of?Hash
108
-
109
108
  hash.each do |language, current_path|
110
109
  resulting_path = "#{current_path}/**/*.{png,jpg,jpeg}"
111
110
 
@@ -122,7 +121,8 @@ module Deliver
122
121
  # When frameit is enabled, we only want to upload the framed screenshots
123
122
  if use_framed
124
123
  # Except for Watch screenshots, they are okay without _framed
125
- if AppScreenshot.new(path).screen_size != AppScreenshot::ScreenSize::IOS_APPLE_WATCH
124
+ is_apple_watch = ((AppScreenshot.new(path).screen_size == AppScreenshot::ScreenSize::IOS_APPLE_WATCH) rescue false)
125
+ unless is_apple_watch
126
126
  next unless path.include?"_framed."
127
127
  end
128
128
  else
@@ -26,29 +26,23 @@ module Deliver
26
26
 
27
27
  def run
28
28
  begin
29
+ pre_load_default_values
30
+
29
31
  unless metadata_only?
30
32
  run_unit_tests
31
- fetch_app_key_information
32
33
  fetch_information_from_ipa_file
33
-
34
- @app_version ||= get_latest_version
35
- verify_ipa_file
36
- else
37
- fetch_app_key_information
38
- @app_identifier ||= ask("App Identifier (e.g. com.krausefx.app): ")
39
- @app_version ||= get_latest_version || ask("Which version number should be updated? ")
40
34
  end
41
- create_app
42
35
 
43
- Helper.log.info("Got all information needed to deploy a new update ('#{@app_version}') for app '#{@app_identifier}'")
36
+ Helper.log.info("Got all information needed to deploy a new update ('#{app_version}') for app '#{app_identifier}'")
44
37
 
45
38
  verify_app_on_itunesconnect unless metadata_only?
46
39
 
47
- if ready_for_sale?
48
- raise "Cannot update metadata of apps 'Ready for Sale'. You can dupe: http://www.openradar.appspot.com/18263306".red
49
- end
50
40
 
51
41
  if is_beta_build?
42
+ if ready_for_sale?
43
+ raise "Cannot update metadata of apps 'Ready for Sale'. You can dupe: http://www.openradar.appspot.com/18263306".red
44
+ end
45
+
52
46
  Helper.log.info "Beta builds don't upload new metadata to iTunesConnet".yellow
53
47
  else
54
48
  upload_metadata
@@ -76,6 +70,48 @@ module Deliver
76
70
  trigger_metadata_upload
77
71
  end
78
72
 
73
+ #####################################################
74
+ # @!group Getters
75
+ #####################################################
76
+
77
+ def app
78
+ return @app if @app
79
+
80
+ @app = Deliver::App.new(app_identifier: app_identifier,
81
+ apple_id: @deploy_information[Deliverer::ValKey::APPLE_ID]) # apple_id can be nil, will be fetched automatically
82
+ end
83
+
84
+ def app_version
85
+ return @app_version if @app_version
86
+
87
+ if Helper.is_test?
88
+ raise "No App Version given"
89
+ end
90
+
91
+ @app_version ||= ask("Which version number should be updated? ")
92
+ end
93
+
94
+ def app_identifier
95
+ return @app_identifier if @app_identifier
96
+
97
+ if Helper.is_test?
98
+ raise "No App Identifier given"
99
+ end
100
+
101
+ Helper.log.info "No App Identifier found. Pass one using `app_identifier` in your Deliverfile".yellow
102
+ @app_identifier = ask("App Identifier (e.g. com.krausefx.app): ")
103
+ end
104
+
105
+ # Preloads default values from the given hashes + Appfile
106
+ def pre_load_default_values
107
+ @app_identifier ||= @deploy_information[Deliverer::ValKey::APP_IDENTIFIER]
108
+ @app_identifier ||= (CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) rescue nil)
109
+
110
+ @app_version ||= @deploy_information[Deliverer::ValKey::APP_VERSION]
111
+ @app_version ||= (FastlaneCore::ItunesSearchApi.fetch_by_identifier(app_identifier)['version'] rescue nil)
112
+ @app_version ||= (app.get_live_version rescue nil)
113
+ end
114
+
79
115
  #####################################################
80
116
  # @!group What kind of release
81
117
  #####################################################
@@ -125,23 +161,6 @@ module Deliver
125
161
  end
126
162
  end
127
163
 
128
- # Tries to fetch app version and app identifier from Deliverfile
129
- def fetch_app_key_information
130
- @app_version = @deploy_information[Deliverer::ValKey::APP_VERSION]
131
- @app_identifier = @deploy_information[Deliverer::ValKey::APP_IDENTIFIER]
132
- fetch_app_identifier_from_app_file
133
- end
134
-
135
- # returns the latest app version from iTunes Connect
136
- def get_latest_version
137
- return nil if Helper.is_test?
138
-
139
- data = itc.get_app_information(Deliver::App.new(app_identifier: @app_identifier))
140
- return (data['version']['value'] rescue nil)
141
- rescue
142
- return nil
143
- end
144
-
145
164
  def fetch_information_from_ipa_file
146
165
  used_ipa_file = ENV["IPA_OUTPUT_PATH"]# if (ENV["IPA_OUTPUT_PATH"] and File.exists?(ENV["IPA_OUTPUT_PATH"]))
147
166
 
@@ -183,31 +202,17 @@ module Deliver
183
202
 
184
203
  # We are able to fetch some metadata directly from the ipa file
185
204
  # If they were also given in the Deliverfile, we will compare the values
186
- @app_identifier = verify_app_identifier(@app_identifier)
187
- @app_version = verify_app_version(@app_version)
205
+ # Overwrite the cached value if there is any
206
+ load_app_identifier_from_ipa
207
+ load_app_version_from_ipa
188
208
  end
189
209
  end
190
210
 
191
- def fetch_app_identifier_from_app_file
192
- @app_identifier ||= (CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) rescue nil)
193
- end
194
-
195
- def verify_ipa_file
196
- fetch_app_identifier_from_app_file unless @app_identifier
197
- raise Deliverfile::Deliverfile::DeliverfileDSLError.new(Deliverfile::Deliverfile::MISSING_APP_IDENTIFIER_MESSAGE.red) unless @app_identifier
198
- raise Deliverfile::Deliverfile::DeliverfileDSLError.new(Deliverfile::Deliverfile::MISSING_VERSION_NUMBER_MESSAGE.red) unless @app_version
199
- end
200
-
201
- def create_app
202
- @app = Deliver::App.new(app_identifier: @app_identifier,
203
- apple_id: @deploy_information[Deliverer::ValKey::APPLE_ID])
204
- end
205
-
206
211
  def verify_app_on_itunesconnect
207
212
  if (@ipa and is_release_build?) or !@ipa
208
213
  # This is a real release, which should also upload the ipa file onto production
209
- @app.create_new_version!(@app_version) unless Helper.is_test?
210
- @app.metadata.verify_version(@app_version) if @ipa
214
+ app.create_new_version!(app_version) unless Helper.is_test?
215
+ app.metadata.verify_version(app_version) if @ipa
211
216
  end
212
217
  end
213
218
 
@@ -267,17 +272,17 @@ module Deliver
267
272
  end
268
273
 
269
274
  def set_app_metadata
270
- @app.metadata.update_title(@deploy_information[Deliverer::ValKey::TITLE]) if @deploy_information[Deliverer::ValKey::TITLE]
271
- @app.metadata.update_description(@deploy_information[Deliverer::ValKey::DESCRIPTION]) if @deploy_information[Deliverer::ValKey::DESCRIPTION]
275
+ app.metadata.update_title(@deploy_information[Deliverer::ValKey::TITLE]) if @deploy_information[Deliverer::ValKey::TITLE]
276
+ app.metadata.update_description(@deploy_information[Deliverer::ValKey::DESCRIPTION]) if @deploy_information[Deliverer::ValKey::DESCRIPTION]
272
277
 
273
- @app.metadata.update_support_url(@deploy_information[Deliverer::ValKey::SUPPORT_URL]) if @deploy_information[Deliverer::ValKey::SUPPORT_URL]
274
- @app.metadata.update_changelog(@deploy_information[Deliverer::ValKey::CHANGELOG]) if @deploy_information[Deliverer::ValKey::CHANGELOG]
275
- @app.metadata.update_marketing_url(@deploy_information[Deliverer::ValKey::MARKETING_URL]) if @deploy_information[Deliverer::ValKey::MARKETING_URL]
276
- @app.metadata.update_privacy_url(@deploy_information[Deliverer::ValKey::PRIVACY_URL]) if @deploy_information[Deliverer::ValKey::PRIVACY_URL]
278
+ app.metadata.update_support_url(@deploy_information[Deliverer::ValKey::SUPPORT_URL]) if @deploy_information[Deliverer::ValKey::SUPPORT_URL]
279
+ app.metadata.update_changelog(@deploy_information[Deliverer::ValKey::CHANGELOG]) if @deploy_information[Deliverer::ValKey::CHANGELOG]
280
+ app.metadata.update_marketing_url(@deploy_information[Deliverer::ValKey::MARKETING_URL]) if @deploy_information[Deliverer::ValKey::MARKETING_URL]
281
+ app.metadata.update_privacy_url(@deploy_information[Deliverer::ValKey::PRIVACY_URL]) if @deploy_information[Deliverer::ValKey::PRIVACY_URL]
277
282
 
278
- @app.metadata.update_keywords(@deploy_information[Deliverer::ValKey::KEYWORDS]) if @deploy_information[Deliverer::ValKey::KEYWORDS]
283
+ app.metadata.update_keywords(@deploy_information[Deliverer::ValKey::KEYWORDS]) if @deploy_information[Deliverer::ValKey::KEYWORDS]
279
284
 
280
- @app.metadata.update_price_tier(@deploy_information[Deliverer::ValKey::PRICE_TIER]) if @deploy_information[Deliverer::ValKey::PRICE_TIER]
285
+ app.metadata.update_price_tier(@deploy_information[Deliverer::ValKey::PRICE_TIER]) if @deploy_information[Deliverer::ValKey::PRICE_TIER]
281
286
  end
282
287
 
283
288
  def screenshots_path
@@ -298,7 +303,7 @@ module Deliver
298
303
  screens_path = screenshots_path
299
304
  if screens_path
300
305
  # Not using Snapfile. Not a good user.
301
- if not @app.metadata.set_all_screenshots_from_path(screens_path, use_framed_screenshots?)
306
+ if not app.metadata.set_all_screenshots_from_path(screens_path, use_framed_screenshots?)
302
307
  # This path does not contain folders for each language
303
308
  if screens_path.kind_of?String
304
309
  if @deploy_information[Deliverer::ValKey::DEFAULT_LANGUAGE]
@@ -309,7 +314,7 @@ module Deliver
309
314
  screens_path = nil
310
315
  end
311
316
  end
312
- @app.metadata.set_screenshots_for_each_language(screens_path, use_framed_screenshots?) if screens_path
317
+ app.metadata.set_screenshots_for_each_language(screens_path, use_framed_screenshots?) if screens_path
313
318
  end
314
319
  end
315
320
  end
@@ -348,7 +353,7 @@ module Deliver
348
353
  end
349
354
 
350
355
  def trigger_metadata_upload
351
- result = @app.metadata.upload!
356
+ result = app.metadata.upload!
352
357
  raise "Error uploading app metadata".red unless result == true
353
358
  end
354
359
 
@@ -358,28 +363,28 @@ module Deliver
358
363
 
359
364
  def additional_itc_information
360
365
  # e.g. rating or copyright
361
- itc.set_copyright!(@app, @deploy_information[Deliverer::ValKey::COPYRIGHT]) if @deploy_information[Deliverer::ValKey::COPYRIGHT]
362
- itc.set_app_review_information!(@app, @deploy_information[Deliverer::ValKey::APP_REVIEW_INFORMATION]) if @deploy_information[Deliverer::ValKey::APP_REVIEW_INFORMATION]
363
- itc.set_release_after_approval!(@app, @deploy_information[Deliverer::ValKey::AUTOMATIC_RELEASE]) if @deploy_information[Deliverer::ValKey::AUTOMATIC_RELEASE] != nil
366
+ itc.set_copyright!(app, @deploy_information[Deliverer::ValKey::COPYRIGHT]) if @deploy_information[Deliverer::ValKey::COPYRIGHT]
367
+ itc.set_app_review_information!(app, @deploy_information[Deliverer::ValKey::APP_REVIEW_INFORMATION]) if @deploy_information[Deliverer::ValKey::APP_REVIEW_INFORMATION]
368
+ itc.set_release_after_approval!(app, @deploy_information[Deliverer::ValKey::AUTOMATIC_RELEASE]) if @deploy_information[Deliverer::ValKey::AUTOMATIC_RELEASE] != nil
364
369
 
365
370
  # Categories
366
371
  primary = @deploy_information[Deliverer::ValKey::PRIMARY_CATEGORY]
367
372
  secondary = @deploy_information[Deliverer::ValKey::SECONDARY_CATEGORY]
368
- itc.set_categories!(@app, primary, secondary) if (primary or secondary)
373
+ itc.set_categories!(app, primary, secondary) if (primary or secondary)
369
374
 
370
375
  # App Rating
371
- itc.set_app_rating!(@app, @deploy_information[Deliverer::ValKey::RATINGS_CONFIG_PATH]) if @deploy_information[Deliverer::ValKey::RATINGS_CONFIG_PATH]
376
+ itc.set_app_rating!(app, @deploy_information[Deliverer::ValKey::RATINGS_CONFIG_PATH]) if @deploy_information[Deliverer::ValKey::RATINGS_CONFIG_PATH]
372
377
 
373
378
  # App Icon
374
- itc.upload_app_icon!(@app, @deploy_information[Deliverer::ValKey::APP_ICON]) if @deploy_information[Deliverer::ValKey::APP_ICON]
379
+ itc.upload_app_icon!(app, @deploy_information[Deliverer::ValKey::APP_ICON]) if @deploy_information[Deliverer::ValKey::APP_ICON]
375
380
 
376
381
  # Apple Watch App Icon
377
- itc.upload_apple_watch_app_icon!(@app, @deploy_information[Deliverer::ValKey::APPLE_WATCH_APP_ICON]) if @deploy_information[Deliverer::ValKey::APPLE_WATCH_APP_ICON]
382
+ itc.upload_apple_watch_app_icon!(app, @deploy_information[Deliverer::ValKey::APPLE_WATCH_APP_ICON]) if @deploy_information[Deliverer::ValKey::APPLE_WATCH_APP_ICON]
378
383
  end
379
384
 
380
385
  def trigger_ipa_upload
381
386
  if @ipa
382
- @ipa.app = @app # we now have the resulting app
387
+ @ipa.app = app # we now have the resulting app
383
388
  result = @ipa.upload! # Important: this will also actually deploy the app on iTunesConnect
384
389
  raise "Error uploading ipa file".red unless result == true
385
390
  else
@@ -411,8 +416,8 @@ module Deliver
411
416
  def hash_for_callback(error = nil)
412
417
  {
413
418
  error: error,
414
- app_version: @app_version,
415
- app_identifier: @app_identifier,
419
+ app_version: (app_version rescue nil),
420
+ app_identifier: (app_identifier rescue nil),
416
421
  skipped_deploy: skip_deployment?,
417
422
  is_release_build: is_release_build?,
418
423
  is_beta_build: is_beta_build?,
@@ -420,26 +425,24 @@ module Deliver
420
425
  }
421
426
  end
422
427
 
423
- def verify_app_identifier(app_identifier)
428
+ def load_app_identifier_from_ipa
429
+ @app_identifier ||= @ipa.fetch_app_identifier # to not ask the user if there is no identifier there yet
430
+
424
431
  if app_identifier
425
432
  if @ipa.fetch_app_identifier and app_identifier != @ipa.fetch_app_identifier
426
433
  raise Deliver::Deliverfile::Deliverfile::DeliverfileDSLError.new("App Identifier of IPA does not match with the given one ('#{app_identifier}' != '#{@ipa.fetch_app_identifier}')".red)
427
434
  end
428
- else
429
- app_identifier = @ipa.fetch_app_identifier
430
435
  end
431
- return app_identifier
432
436
  end
433
437
 
434
- def verify_app_version(app_version)
438
+ def load_app_version_from_ipa
439
+ @app_version ||= @ipa.fetch_app_version # to not ask the user if there is no version there yet
440
+
435
441
  if app_version
436
442
  if @ipa.fetch_app_version and app_version != @ipa.fetch_app_version
437
443
  raise Deliver::Deliverfile::Deliverfile::DeliverfileDSLError.new("App Version of IPA does not match with the given one (#{app_version} != #{@ipa.fetch_app_version})".red)
438
444
  end
439
- else
440
- app_version = @ipa.fetch_app_version
441
445
  end
442
- return app_version
443
446
  end
444
447
  end
445
448
  end
@@ -94,6 +94,15 @@ module Deliver
94
94
  else
95
95
  Helper.log.info "deliver will **not** submit the app for Review or for TestFlight distribution".yellow
96
96
  Helper.log.info "If you want to distribute the binary, don't define `skip_deploy` ".yellow
97
+
98
+ if ENV["DELIVER_WHAT_TO_TEST"] or ENV["DELIVER_BETA_DESCRIPTION"] or ENV["DELIVER_BETA_FEEDBACK_EMAIL"]
99
+ Helper.log.warn "---------------------------------------------------".yellow
100
+ Helper.log.warn "You provided beta version metadata, but used the ".yellow
101
+ Helper.log.warn "`skip_deploy` option when running deliver.".yellow
102
+ Helper.log.warn "You have to remove `skip_deploy` to set a changelog".yellow
103
+ Helper.log.warn "for TestFlight builds".yellow
104
+ Helper.log.warn "---------------------------------------------------".yellow
105
+ end
97
106
  end
98
107
  return true
99
108
  end
@@ -44,16 +44,7 @@ module Deliver
44
44
  begin
45
45
  verify_app(app)
46
46
 
47
- open_app_page(app)
48
-
49
- begin
50
- version_number = wait_for_elements("input[ng-model='versionInfo.version.value']").first.value
51
- version_number ||= first(".status.ready").text.split(" ").first
52
- return version_number
53
- rescue
54
- Helper.log.debug "Could not fetch version number of the live version for app #{app}."
55
- return nil
56
- end
47
+ return (get_app_information(app)['version']['value'] rescue nil)
57
48
  rescue => ex
58
49
  error_occured(ex)
59
50
  end
@@ -1,3 +1,3 @@
1
1
  module Deliver
2
- VERSION = "0.11.1.beta"
2
+ VERSION = "0.11.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deliver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1.beta
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-19 00:00:00.000000000 Z
11
+ date: 2015-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core
@@ -193,7 +193,7 @@ dependencies:
193
193
  - !ruby/object:Gem::Version
194
194
  version: 1.19.0
195
195
  - !ruby/object:Gem::Dependency
196
- name: codeclimate-test-reporter
196
+ name: coveralls
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - '>='
@@ -267,9 +267,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
267
267
  version: 2.0.0
268
268
  required_rubygems_version: !ruby/object:Gem::Requirement
269
269
  requirements:
270
- - - '>'
270
+ - - '>='
271
271
  - !ruby/object:Gem::Version
272
- version: 1.3.1
272
+ version: '0'
273
273
  requirements: []
274
274
  rubyforge_project:
275
275
  rubygems_version: 2.2.2