fastlane 2.126.0.beta.20190616200045 → 2.126.0.beta.20190617200114

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: bf65da45eb0c23435ac2be3d68775851e6356b52
4
- data.tar.gz: 5122d1e20b42fb9476f839b43459591054f05142
3
+ metadata.gz: eccba11a51b1f8bc129b1bc0c78ca0bd65f6b92f
4
+ data.tar.gz: ba18bf6c703836eaebe985ac3e4bea001c94ccab
5
5
  SHA512:
6
- metadata.gz: f8f92b38b8406fa43124d42211f63617cd5b595707043987fb4c315ee378d90a1e41c38775294cee82d4d2e626d4844fefda2a13a8015c1b6505a48c1aeda73f
7
- data.tar.gz: dec4da2271ed4743b57e8476f5f826f61664454622aa3a974f5d88d693f11159e222cf828a16bf81c34888770eed2f7f34ae8155b892c26571ccdc998efdfb87
6
+ metadata.gz: 80f5a0affed6278cb9dc0eb22534a4524634abbc6800da5b0849df34d8f5710f2a9497a035eec21e43feec0594d3ee2506019d1589d03b93ad0bb3308b5c67ba
7
+ data.tar.gz: a915231c378eee871930f7fbb1353d0fa9b17613ec2a375cae7f403637487fc504e77bb6a08dac0e4618c982bd1464dba1df5f9ae7a8d6e5e91404520b4fb6b3
@@ -324,6 +324,10 @@ module Deliver
324
324
  optional: true,
325
325
  is_string: false,
326
326
  type: Hash),
327
+ FastlaneCore::ConfigItem.new(key: :app_review_attachment_file,
328
+ description: "Metadata: Path to the app review attachment file",
329
+ optional: true,
330
+ is_string: true),
327
331
  # Localised
328
332
  FastlaneCore::ConfigItem.new(key: :description,
329
333
  description: "Metadata: The localised app description",
@@ -132,6 +132,8 @@ module Deliver
132
132
  set_app_rating(v, options)
133
133
  v.ratings_reset = options[:reset_ratings] unless options[:reset_ratings].nil?
134
134
 
135
+ set_review_attachment_file(v, options)
136
+
135
137
  Helper.show_loading_indicator("Uploading metadata to App Store Connect")
136
138
  v.save!
137
139
  Helper.hide_loading_indicator
@@ -367,6 +369,11 @@ module Deliver
367
369
  v.review_user_needed = (v.review_demo_user.to_s.chomp + v.review_demo_password.to_s.chomp).length > 0
368
370
  end
369
371
 
372
+ def set_review_attachment_file(v, options)
373
+ return unless options[:app_review_attachment_file]
374
+ v.upload_review_attachment!(options[:app_review_attachment_file])
375
+ end
376
+
370
377
  def set_app_rating(v, options)
371
378
  return unless options[:app_rating_config_path]
372
379
 
@@ -237,6 +237,15 @@ app_review_information(
237
237
 
238
238
  You can also provide these values by creating files in a `metadata/review_information/` directory. The file names must match the pattern `<key>.txt` (e.g. `first_name.txt`, `notes.txt` etc.). The contents of each file will be used as the value for the matching key. Values provided in the `Deliverfile` or `Fastfile` will be take priority over values from these files.
239
239
 
240
+ ##### app_review_attachment_file
241
+ You can provide additional information to the app review team as a file attachment. As of this writing, Apple supports following file attachment formats: .pdf, .doc, .docx, .rtf, .pages, .xls, .xlsx, .numbers, .zip, .rar, .plist, .crash, .jpg, .png, .mp4, or .avi.
242
+
243
+ Provide an empty string (i.e. "", not null) to remove the existing attachment file (if any) from the review information being edited.
244
+
245
+ ```ruby-skip-tests
246
+ app_review_attachment_file: "./readme.txt"
247
+ ```
248
+
240
249
  ##### submission_information
241
250
  Must be a hash. This is used as the last step for the deployment process, where you define if you use third party content or use encryption. [A list of available options](https://github.com/fastlane/fastlane/blob/master/spaceship/lib/spaceship/tunes/app_submission.rb).
242
251
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.126.0.beta.20190616200045'.freeze
2
+ VERSION = '2.126.0.beta.20190617200114'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  MINIMUM_XCODE_RELEASE = "7.0".freeze
5
5
  RUBOCOP_REQUIREMENT = '0.49.1'.freeze
@@ -46,6 +46,10 @@ module Spaceship
46
46
  upload_file(app_version: app_version, upload_file: upload_file, path: '/upload/image', content_provider_id: content_provider_id, sso_token: sso_token_for_image, du_validation_rule_set: screenshot_picture_type(device, nil))
47
47
  end
48
48
 
49
+ def upload_app_review_attachment(app_version, upload_file, content_provider_id, sso_token_for_attachment)
50
+ upload_file(app_version: app_version, upload_file: upload_file, path: '/upload/app-resolution-file', content_provider_id: content_provider_id, sso_token: sso_token_for_attachment)
51
+ end
52
+
49
53
  def get_picture_type(upload_file)
50
54
  resolution = Utilities.resolution(upload_file.file_path)
51
55
  result = device_resolution_map.find do |key, resolutions|
@@ -8,14 +8,32 @@ module Spaceship
8
8
  # Supports all formats required by DU-UTC right now (video, images and json)
9
9
  # @param path (String) the path to the file
10
10
  def content_type(path)
11
- path = path.downcase
12
- return 'image/jpeg' if path.end_with?('.jpg')
13
- return 'image/jpeg' if path.end_with?('.jpeg')
14
- return 'image/png' if path.end_with?('.png')
15
- return 'application/json' if path.end_with?('.geojson')
16
- return 'video/quicktime' if path.end_with?('.mov')
17
- return 'video/mp4' if path.end_with?('.m4v')
18
- return 'video/mp4' if path.end_with?('.mp4')
11
+ supported_file_types = {
12
+ '.jpg' => 'image/jpeg',
13
+ '.jpeg' => 'image/jpeg',
14
+ '.png' => 'image/png',
15
+ '.geojson' => 'application/json',
16
+ '.mov' => 'video/quicktime',
17
+ '.m4v' => 'video/mp4',
18
+ '.mp4' => 'video/mp4',
19
+ '.txt' => 'text/plain',
20
+ '.pdf' => 'application/pdf',
21
+ '.doc' => 'application/msword',
22
+ '.docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
23
+ '.rtf' => 'application/rtf',
24
+ '.pages' => 'application/x-iwork-pages-sffpages',
25
+ '.xls' => 'application/vnd.ms-excel',
26
+ '.xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
27
+ '.numbers' => 'application/x-iwork-numbers-sffnumbers',
28
+ '.rar' => 'application/x-rar-compressed',
29
+ '.plist' => 'application/xml',
30
+ '.crash' => 'text/x-apport',
31
+ '.avi' => 'video/x-msvideo',
32
+ '.zip' => 'application/zip'
33
+ }
34
+
35
+ extension = File.extname(path.downcase)
36
+ return supported_file_types[extension] if supported_file_types[extension]
19
37
  raise "Unknown content-type for file #{path}"
20
38
  end
21
39
 
@@ -0,0 +1,49 @@
1
+ require_relative 'tunes_base'
2
+
3
+ module Spaceship
4
+ module Tunes
5
+ # Represents an image hosted on App Store Connect. Used for app store review attachment file.
6
+ class AppReviewAttachment < TunesBase
7
+ HOST_URL = "https://iosapps-ssl.itunes.apple.com/itunes-assets"
8
+
9
+ attr_accessor :asset_token
10
+
11
+ attr_accessor :original_file_name
12
+
13
+ attr_accessor :url
14
+
15
+ attr_accessor :type_of_file
16
+
17
+ attr_mapping(
18
+ 'assetToken' => :asset_token,
19
+ 'fileType' => :type_of_file,
20
+ 'url' => :url,
21
+ 'name' => :original_file_name
22
+ )
23
+
24
+ def reset!(attrs = {})
25
+ update_raw_data!(
26
+ {
27
+ asset_token: nil,
28
+ type_of_file: nil,
29
+ url: nil,
30
+ original_file_name: nil
31
+ }.merge(attrs)
32
+ )
33
+ end
34
+
35
+ def setup
36
+ # Since September 2015 we don't get the url any more, so we have to manually build it
37
+ self.url = "#{HOST_URL}/#{self.asset_token}"
38
+ end
39
+
40
+ private
41
+
42
+ def update_raw_data!(hash)
43
+ hash.each do |k, v|
44
+ self.send("#{k}=", v)
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -1,3 +1,4 @@
1
+
1
2
  require_relative 'tunes_client'
2
3
  require_relative 'app_trailer'
3
4
  require_relative 'app_screenshot'
@@ -8,6 +9,7 @@ require_relative 'language_item'
8
9
  require_relative 'transit_app_file'
9
10
  require_relative 'build'
10
11
  require_relative 'app_status'
12
+ require_relative 'app_review_attachment'
11
13
 
12
14
  module Spaceship
13
15
  module Tunes
@@ -79,6 +81,9 @@ module Spaceship
79
81
  # @return (Integer) a unqiue ID for this version generated by App Store Connect
80
82
  attr_accessor :version_id
81
83
 
84
+ # @return (Spaceship::Tunes::AppReviewAttachment) the structure containing information about the review attachment file
85
+ attr_accessor :review_attachment_file
86
+
82
87
  ####
83
88
  # GeoJson
84
89
  ####
@@ -417,6 +422,7 @@ module Spaceship
417
422
 
418
423
  setup_large_app_icon
419
424
  setup_watch_app_icon
425
+ setup_review_attachment_file if supports_review_attachment_file?
420
426
  setup_transit_app_file if supports_app_transit?
421
427
  setup_screenshots
422
428
  setup_trailers
@@ -435,6 +441,17 @@ module Spaceship
435
441
  }
436
442
  end
437
443
 
444
+ # This method will generate the required keys/values
445
+ # for App Store Connect to validate the review attachment file
446
+ def generate_review_attachment_file(review_attachment_data, review_attachment_file)
447
+ {
448
+ assetToken: review_attachment_data["token"],
449
+ name: File.basename(review_attachment_file),
450
+ fileType: Utilities.content_type(review_attachment_file),
451
+ url: nil
452
+ }
453
+ end
454
+
438
455
  # Uploads or removes the large icon
439
456
  # @param icon_path (String): The path to the icon. Use nil to remove it
440
457
  def upload_large_icon!(icon_path)
@@ -609,6 +626,34 @@ module Spaceship
609
626
  setup_trailers
610
627
  end
611
628
 
629
+ # Uploads, app review attachments
630
+ #
631
+ # while submitting for review, ITC allow developers to attach file.
632
+ #
633
+ # Following list can be found at https://appstoreconnect.apple.com
634
+ # on iOS app edit version, above the attachment label/button there is
635
+ # a question mark if it is press the a dialog is shown which has the list.
636
+ #
637
+ # File types allowed by Apple are: pdf, doc, docx, rtf, pages, xls, xlsx, numbers
638
+ # zip, rar, plist, crash, jpg, png, mp4 or avi.
639
+ #
640
+ #
641
+ # @param review_attachment_path (String): The path to the attachment file.
642
+ def upload_review_attachment!(review_attachment_path)
643
+ raise 'cannot upload review attachment for live edition.' if self.is_live?
644
+
645
+ if !review_attachment_path || review_attachment_path.size < 1
646
+ @review_attachment_file.reset!
647
+ return
648
+ end
649
+
650
+ raise "cannot find file: #{review_attachment_path}." unless File.exist?(review_attachment_path)
651
+
652
+ review_attachment_file = UploadFile.from_path(review_attachment_path)
653
+ review_attachment_data = client.upload_app_review_attachment(self, review_attachment_file)
654
+ raw_data["appReviewInfo"]["attachmentFiles"]["value"] = generate_review_attachment_file(review_attachment_data, review_attachment_path)
655
+ end
656
+
612
657
  # Prefill name, keywords, etc...
613
658
  def unfold_languages
614
659
  {
@@ -672,6 +717,16 @@ module Spaceship
672
717
  @watch_app_icon = Tunes::AppImage.factory(watch_app_icon) if watch_app_icon
673
718
  end
674
719
 
720
+ def setup_review_attachment_file
721
+ review_attachment_file = raw_data["appReviewInfo"]["attachmentFiles"]["value"]
722
+ @review_attachment_file = nil
723
+ @review_attachment_file = Tunes::AppReviewAttachment.factory(review_attachment_file)
724
+ end
725
+
726
+ def supports_review_attachment_file?
727
+ raw_data["appReviewInfo"]["attachmentFiles"] && raw_data["appReviewInfo"]["attachmentFiles"]["value"]
728
+ end
729
+
675
730
  def supports_app_transit?
676
731
  raw_data["transitAppFile"] != nil
677
732
  end
@@ -873,6 +873,21 @@ module Spaceship
873
873
  du_client.upload_trailer_preview(app_version, upload_trailer_preview, content_provider_id, sso_token_for_image, device)
874
874
  end
875
875
 
876
+ #####################################################
877
+ # @!review attachment file
878
+ #####################################################
879
+ # Uploads a attachment file
880
+ # @param app_version (AppVersion): The version of your app(must be edit version)
881
+ # @param upload_attachment_file (file): File to upload
882
+ # @return [JSON] the response
883
+ def upload_app_review_attachment(app_version, upload_attachment_file)
884
+ raise "app_version is required" unless app_version
885
+ raise "app_version must be live version" if app_version.is_live?
886
+ raise "upload_attachment_file is required" unless upload_attachment_file
887
+
888
+ du_client.upload_app_review_attachment(app_version, upload_attachment_file, content_provider_id, sso_token_for_image)
889
+ end
890
+
876
891
  # Fetches the App Version Reference information from ITC
877
892
  # @return [AppVersionRef] the response
878
893
  def ref_data
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.126.0.beta.20190616200045
4
+ version: 2.126.0.beta.20190617200114
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Liebowitz
@@ -27,7 +27,7 @@ authors:
27
27
  autorequire:
28
28
  bindir: bin
29
29
  cert_chain: []
30
- date: 2019-06-16 00:00:00.000000000 Z
30
+ date: 2019-06-17 00:00:00.000000000 Z
31
31
  dependencies:
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: slack-notifier
@@ -1657,6 +1657,7 @@ files:
1657
1657
  - spaceship/lib/spaceship/tunes/app_image.rb
1658
1658
  - spaceship/lib/spaceship/tunes/app_ratings.rb
1659
1659
  - spaceship/lib/spaceship/tunes/app_review.rb
1660
+ - spaceship/lib/spaceship/tunes/app_review_attachment.rb
1660
1661
  - spaceship/lib/spaceship/tunes/app_screenshot.rb
1661
1662
  - spaceship/lib/spaceship/tunes/app_status.rb
1662
1663
  - spaceship/lib/spaceship/tunes/app_submission.rb
@@ -1725,24 +1726,24 @@ metadata:
1725
1726
  post_install_message:
1726
1727
  rdoc_options: []
1727
1728
  require_paths:
1728
- - supply/lib
1729
- - match/lib
1729
+ - frameit/lib
1730
1730
  - snapshot/lib
1731
- - credentials_manager/lib
1731
+ - supply/lib
1732
+ - gym/lib
1732
1733
  - produce/lib
1733
- - pilot/lib
1734
- - frameit/lib
1734
+ - spaceship/lib
1735
+ - scan/lib
1735
1736
  - deliver/lib
1736
- - fastlane/lib
1737
+ - cert/lib
1737
1738
  - fastlane_core/lib
1738
- - sigh/lib
1739
- - gym/lib
1740
- - pem/lib
1739
+ - pilot/lib
1740
+ - credentials_manager/lib
1741
1741
  - precheck/lib
1742
- - cert/lib
1742
+ - sigh/lib
1743
1743
  - screengrab/lib
1744
- - spaceship/lib
1745
- - scan/lib
1744
+ - match/lib
1745
+ - fastlane/lib
1746
+ - pem/lib
1746
1747
  required_ruby_version: !ruby/object:Gem::Requirement
1747
1748
  requirements:
1748
1749
  - - ">="