fastlane 2.65.0.beta.20171110010003 → 2.65.0.beta.20171111010004

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: ab7e53e94f57acd454bc9c01442108ff81a7a626
4
- data.tar.gz: 942b6862bb8bbf52c7c4647679b94eaa60b00bfd
3
+ metadata.gz: cc309a3a6e156156ac2c7f5eb97992af2a4c5bfa
4
+ data.tar.gz: 96521fa1a163eb7cfe387974003cfcf6f2f3f5fc
5
5
  SHA512:
6
- metadata.gz: d6de51e352b2885e35a62b305ead0c50f668dfdb638f5fb5b799ab88bc0957a65cb21076d47396c4ba7fde2305d08cd807769356eddc98e0bf8aebc0d0c9e3ec
7
- data.tar.gz: 1700dd8e547ed4c38fb96e60d23008148274039d59b7a459061d267130102e9187e10535ad344f8876b0e0a1bc841fe738eb1379afaa46255afe09cdc4e41ec6
6
+ metadata.gz: f391a1d799434dce282c01171f7a9b959bab25f3908b8c855bbfb38a418ad987be55d38d8c0bf87b30b4d16ab4d0072c25247c357ae5f1b413c44b3ea47c9796
7
+ data.tar.gz: 50809f813761f17bd7f2f171896ab5ab0dfc37d72fa9c3c68db9ce1b4372b3e3836437d554082c87fa697f5d92e21a82e85eea7b183422c38a1b566b53bb28e5
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.65.0.beta.20171110010003'.freeze
2
+ VERSION = '2.65.0.beta.20171111010004'.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
@@ -19,7 +19,7 @@ module Spaceship
19
19
  end
20
20
 
21
21
  def upload_purchase_review_screenshot(app_id, upload_file, content_provider_id, sso_token_for_image)
22
- upload_file(app_id: app_id, upload_file: upload_file, path: '/upload/image', content_provider_id: content_provider_id, sso_token: sso_token_for_image, du_validation_rule_set: 'MZPFT.SortedScreenShot')
22
+ upload_file(app_id: app_id, upload_file: upload_file, path: '/upload/image', content_provider_id: content_provider_id, sso_token: sso_token_for_image, du_validation_rule_set: get_picture_type(upload_file))
23
23
  end
24
24
 
25
25
  def upload_large_icon(app_version, upload_file, content_provider_id, sso_token_for_image)
@@ -42,6 +42,16 @@ module Spaceship
42
42
  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))
43
43
  end
44
44
 
45
+ def get_picture_type(upload_file)
46
+ resolution = Utilities.resolution(upload_file.file_path)
47
+ result = device_resolution_map.find do |key, resolutions|
48
+ resolutions.include? resolution
49
+ end
50
+ raise "Unknown device for screen resolution #{resolution}" if result.nil?
51
+
52
+ picture_type_map[result[0]]
53
+ end
54
+
45
55
  private
46
56
 
47
57
  def upload_file(app_version: nil, upload_file: nil, path: nil, content_provider_id: nil, sso_token: nil, du_validation_rule_set: nil, app_id: nil)
@@ -113,6 +123,21 @@ module Spaceship
113
123
  }
114
124
  end
115
125
 
126
+ def device_resolution_map
127
+ # rubocop:enable Layout/ExtraSpacing
128
+ {
129
+ watch: [[312, 390]],
130
+ ipad: [[1024, 748], [1024, 768], [2048, 1496], [2048, 1536], [768, 1004], [768, 1024], [1536, 2008], [1536, 2048]],
131
+ ipadPro: [[2048, 2732], [2732, 2048]],
132
+ iphone6: [[750, 1334], [1334, 750]],
133
+ iphone6Plus: [[1242, 2208], [2208, 1242]],
134
+ iphone4: [[640, 1096], [640, 1136], [1136, 600], [1136, 640]],
135
+ iphone35: [[640, 960], [640, 920], [960, 600], [960, 640]],
136
+ appleTV: [[1920, 1080]],
137
+ desktop: [[1280, 800], [1440, 900], [2560, 1600], [2880, 1800]]
138
+ }
139
+ end
140
+
116
141
  def screenshot_picture_type(device, is_messages)
117
142
  map = is_messages ? messages_picture_type_map : picture_type_map
118
143
  device = device.to_sym
@@ -186,20 +186,7 @@ module Spaceship
186
186
  # Upload Screenshot
187
187
  upload_file = UploadFile.from_path @review_screenshot
188
188
  screenshot_data = client.upload_purchase_review_screenshot(application.apple_id, upload_file)
189
- new_screenshot = {
190
- "value" => {
191
- "assetToken" => screenshot_data["token"],
192
- "sortOrder" => 0,
193
- "type" => "SortedScreenShot",
194
- "originalFileName" => upload_file.file_name,
195
- "size" => screenshot_data["length"],
196
- "height" => screenshot_data["height"],
197
- "width" => screenshot_data["width"],
198
- "checksum" => screenshot_data["md5"]
199
- }
200
- }
201
-
202
- raw_data["versions"][0]["reviewScreenshot"] = new_screenshot
189
+ raw_data["versions"][0]["reviewScreenshot"] = screenshot_data
203
190
  end
204
191
  # Update the Purchase
205
192
  client.update_iap!(app_id: application.apple_id, purchase_id: self.purchase_id, data: raw_data)
@@ -662,9 +662,21 @@ module Spaceship
662
662
  # Uploads an In-App-Purchase Review screenshot
663
663
  # @param app_id (AppId): The id of the app
664
664
  # @param upload_image (UploadFile): The icon to upload
665
- # @return [JSON] the response
665
+ # @return [JSON] the screenshot data, ready to be added to an In-App-Purchase
666
666
  def upload_purchase_review_screenshot(app_id, upload_image)
667
- du_client.upload_purchase_review_screenshot(app_id, upload_image, content_provider_id, sso_token_for_image)
667
+ data = du_client.upload_purchase_review_screenshot(app_id, upload_image, content_provider_id, sso_token_for_image)
668
+ {
669
+ "value" => {
670
+ "assetToken" => data["token"],
671
+ "sortOrder" => 0,
672
+ "type" => du_client.get_picture_type(upload_image),
673
+ "originalFileName" => upload_image.file_name,
674
+ "size" => data["length"],
675
+ "height" => data["height"],
676
+ "width" => data["width"],
677
+ "checksum" => data["md5"]
678
+ }
679
+ }
668
680
  end
669
681
 
670
682
  # Uploads a screenshot
@@ -1148,20 +1160,7 @@ module Spaceship
1148
1160
  # Upload Screenshot:
1149
1161
  upload_file = UploadFile.from_path review_screenshot
1150
1162
  screenshot_data = upload_purchase_review_screenshot(app_id, upload_file)
1151
- new_screenshot = {
1152
- "value" => {
1153
- "assetToken" => screenshot_data["token"],
1154
- "sortOrder" => 0,
1155
- "type" => "SortedScreenShot",
1156
- "originalFileName" => upload_file.file_name,
1157
- "size" => screenshot_data["length"],
1158
- "height" => screenshot_data["height"],
1159
- "width" => screenshot_data["width"],
1160
- "checksum" => screenshot_data["md5"]
1161
- }
1162
- }
1163
-
1164
- data["versions"][0]["reviewScreenshot"] = new_screenshot
1163
+ data["versions"][0]["reviewScreenshot"] = screenshot_data
1165
1164
  end
1166
1165
 
1167
1166
  # Now send back the modified hash
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.65.0.beta.20171110010003
4
+ version: 2.65.0.beta.20171111010004
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2017-11-10 00:00:00.000000000 Z
18
+ date: 2017-11-11 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: slack-notifier