fastlane 2.65.0.beta.20171117010003 → 2.65.0.beta.20171118010003

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: b3f1000437744b280338989d702a4fafa53e147e
4
- data.tar.gz: 9085b4a1fee66150b1be4ff314e0bf76037886b2
3
+ metadata.gz: 787f3b4ef5ff27786c4d6028c038bab3e9f5d73b
4
+ data.tar.gz: a7a489a49ebb8033c682479ed587c85a78864fe3
5
5
  SHA512:
6
- metadata.gz: d580ed322ab4823771259be7c7f09b2af8d1cef4d6a07457d500029e8e3759cb77b3d39c69d101b57b542179112662cc27e179d2f044ebe7490f1c8aaa0198e0
7
- data.tar.gz: 4b059e9289914e0eb8516d773134073e77fd27bccd45fd848e87fb00230715ae4db881fa13d32a3075670580c5faf89ff944ef76d9d6301446f90debfa8f3a75
6
+ metadata.gz: 78bb309c12f3aabb9d57ff90512c3bbd510c657731b8c02243dc64db5d44541670d0dd8378f67be17c6b590998d38c93b110e5174cce188ad40f0558fe9d3e6b
7
+ data.tar.gz: 35048fe0d1a63c22d5a10b337ec20a32701843cc885dd2be33bc30059d113b039644ad77575a6fad10d71e5ae2620f8a67ce424ab2c1be417fba1ce95cd9ed8d
@@ -47,6 +47,9 @@ module Fastlane
47
47
  UI.message(message.join(" "))
48
48
 
49
49
  # Loop through all app versions and download their dSYM
50
+ # This will need to change with the new build trains endpoints
51
+ # can use app.build_trains(platform: platform).versions to check for the right version
52
+ # then iterate through the builds
50
53
  app.all_build_train_numbers(platform: platform).each do |train_number|
51
54
  if version && version != train_number
52
55
  next
@@ -185,8 +185,23 @@ module Fastlane
185
185
  "versionName" => "1.0.0",
186
186
  # ...
187
187
  }
188
+ )
189
+ ```
190
+
191
+ You can use this to automatically [sign and zipalign](https://developer.android.com/studio/publish/app-signing.html) your app:
192
+ ```ruby
193
+ gradle(
194
+ task: "assemble",
195
+ build_type: "Release",
196
+ print_command: false,
197
+ properties: {
198
+ "android.injected.signing.store.file" => "keystore.jks",
199
+ "android.injected.signing.store.password" => "store_password",
200
+ "android.injected.signing.key.alias" => "key_alias",
201
+ "android.injected.signing.key.password" => "key_password",
202
+ }
188
203
  )',
189
- '# If you need to pass sensitive information through the `gradle` action, and don"t want the generated command to be printed before it is run, you can suppress that:
204
+ '# If you need to pass sensitive information through the `gradle` action, and don\'t want the generated command to be printed before it is run, you can suppress that:
190
205
  gradle(
191
206
  # ...
192
207
  print_command: false
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.65.0.beta.20171117010003'.freeze
2
+ VERSION = '2.65.0.beta.20171118010003'.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
@@ -1,6 +1,7 @@
1
1
  require 'spaceship/globals'
2
2
  require 'spaceship/base'
3
3
  require 'spaceship/client'
4
+ require 'spaceship/provider'
4
5
  require 'spaceship/launcher'
5
6
 
6
7
  # Dev Portal
@@ -33,6 +33,10 @@ module Spaceship
33
33
 
34
34
  attr_accessor :csrf_tokens
35
35
 
36
+ attr_accessor :provider
37
+
38
+ attr_accessor :available_providers
39
+
36
40
  # Base class for errors that want to present their message as
37
41
  # preferred error info for fastlane error handling. See:
38
42
  # fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb
@@ -489,11 +493,19 @@ module Spaceship
489
493
  # Get the `itctx` from the new (22nd May 2017) API endpoint "olympus"
490
494
  def fetch_olympus_session
491
495
  response = request(:get, "https://olympus.itunes.apple.com/v1/session")
492
- if response.body
493
- user_map = response.body["user"]
496
+ body = response.body
497
+ if body
498
+ body = JSON.parse(body) if body.kind_of?(String)
499
+ user_map = body["user"]
494
500
  if user_map
495
501
  self.user_email = user_map["emailAddress"]
496
502
  end
503
+
504
+ provider = body["provider"]
505
+ self.provider = Spaceship::Provider.new(provider_hash: provider)
506
+ self.available_providers = body["availableProviders"].map do |provider_hash|
507
+ Spaceship::Provider.new(provider_hash: provider_hash)
508
+ end
497
509
  end
498
510
  end
499
511
 
@@ -0,0 +1,13 @@
1
+ module Spaceship
2
+ class Provider
3
+ attr_accessor :provider_id
4
+ attr_accessor :name
5
+ attr_accessor :content_types
6
+
7
+ def initialize(provider_hash: nil)
8
+ self.provider_id = provider_hash['providerId']
9
+ self.name = provider_hash['name']
10
+ self.content_types = provider_hash['contentTypes']
11
+ end
12
+ end
13
+ end
@@ -45,6 +45,13 @@ module Spaceship::TestFlight
45
45
 
46
46
  attr_accessor :upload_date
47
47
 
48
+ attr_accessor :dsym_url
49
+ attr_accessor :build_sdk
50
+ attr_accessor :include_symbols
51
+ attr_accessor :number_of_asset_packs
52
+ attr_accessor :contains_odr
53
+ attr_accessor :file_name
54
+
48
55
  attr_mapping({
49
56
  'appAdamId' => :app_id,
50
57
  'providerId' => :provider_id,
@@ -61,7 +68,13 @@ module Spaceship::TestFlight
61
68
  'crashCount' => :crash_count,
62
69
  'didNotify' => :did_notify,
63
70
  'uploadDate' => :upload_date,
64
- 'id' => :id
71
+ 'id' => :id,
72
+ 'dSYMUrl' => :dsym_url,
73
+ 'buildSdk' => :build_sdk,
74
+ 'includesSymbols' => :include_symbols,
75
+ 'numberOfAssetPacks' => :number_of_asset_packs,
76
+ 'containsODR' => :contains_odr,
77
+ 'fileName' => :file_name
65
78
  })
66
79
 
67
80
  BUILD_STATES = {
@@ -86,7 +99,7 @@ module Spaceship::TestFlight
86
99
  trains.values.flatten
87
100
  end
88
101
 
89
- def self.builds_for_train(app_id: nil, platform: nil, train_version: nil, retry_count: 0)
102
+ def self.builds_for_train(app_id: nil, platform: nil, train_version: nil, retry_count: 3)
90
103
  builds_data = client.get_builds_for_train(app_id: app_id, platform: platform, train_version: train_version, retry_count: retry_count)
91
104
  builds_data.map { |data| self.new(data) }
92
105
  end
@@ -9,9 +9,10 @@ module Spaceship::TestFlight
9
9
  #
10
10
  # See `Spaceship::TestFlight::Build#reload`
11
11
 
12
- def self.all(app_id: nil, platform: nil, retry_count: 0)
12
+ def self.all(app_id: nil, platform: nil, retry_count: 3)
13
13
  data = client.get_build_trains(app_id: app_id, platform: platform)
14
14
  trains = {}
15
+
15
16
  data.each do |train_version|
16
17
  builds_data = client.get_builds_for_train(app_id: app_id, platform: platform, train_version: train_version, retry_count: retry_count)
17
18
  trains[train_version] = builds_data.map { |attrs| Build.new(attrs) }
@@ -32,5 +33,9 @@ module Spaceship::TestFlight
32
33
  def values
33
34
  @trains.values
34
35
  end
36
+
37
+ def versions
38
+ @trains.keys
39
+ end
35
40
  end
36
41
  end
@@ -24,10 +24,11 @@ module Spaceship::TestFlight
24
24
  assert_required_params(__method__, binding)
25
25
 
26
26
  response = request(:get, "providers/#{team_id}/apps/#{app_id}/platforms/#{platform}/trains")
27
+
27
28
  handle_response(response)
28
29
  end
29
30
 
30
- def get_builds_for_train(app_id: nil, platform: "ios", train_version: nil, retry_count: 0)
31
+ def get_builds_for_train(app_id: nil, platform: "ios", train_version: nil, retry_count: 3)
31
32
  assert_required_params(__method__, binding)
32
33
  with_retry(retry_count) do
33
34
  response = request(:get, "providers/#{team_id}/apps/#{app_id}/platforms/#{platform}/trains/#{train_version}/builds", nil, {}, true)
@@ -105,6 +106,44 @@ module Spaceship::TestFlight
105
106
  handle_response(response)
106
107
  end
107
108
 
109
+ # Returns a list of available testing groups
110
+ # e.g.
111
+ # {"b6f65dbd-c845-4d91-bc39-0b661d608970" => "Boarding",
112
+ # "70402368-9deb-409f-9a26-bb3f215dfee3" => "Automatic"}
113
+ def groups(app_id)
114
+ return @cached_groups if @cached_groups
115
+
116
+ r = request(:get, "/testflight/v2/providers/#{self.provider.provider_id}/apps/#{app_id}/groups")
117
+ @cached_groups = parse_response(r, 'data')
118
+ end
119
+
120
+ #####################################################
121
+ # @!group Testers
122
+ #####################################################
123
+ def testers(tester)
124
+ url = tester.url[:index]
125
+ r = request(:get, url)
126
+ parse_response(r, 'data')['users']
127
+ end
128
+
129
+ def testers_by_app(tester, app_id, group_id: nil)
130
+ if group_id.nil?
131
+ group_ids = groups(app_id).map do |group|
132
+ group['id']
133
+ end
134
+ end
135
+ group_ids ||= [group_id]
136
+ testers = []
137
+
138
+ group_ids.each do |json_group_id|
139
+ url = tester.url(app_id, self.provider.provider_id, json_group_id)[:index_by_app]
140
+ r = request(:get, url)
141
+ testers += parse_response(r, 'data')['users']
142
+ end
143
+
144
+ testers
145
+ end
146
+
108
147
  ##
109
148
  # @!group Testers API
110
149
  ##
@@ -164,18 +203,19 @@ module Spaceship::TestFlight
164
203
  handle_response(response)
165
204
  end
166
205
 
167
- def put_tester_to_group(app_id: nil, tester_id: nil, group_id: nil)
206
+ def post_tester_to_group(app_id: nil, email: nil, first_name: nil, last_name: nil, group_id: nil)
168
207
  assert_required_params(__method__, binding)
169
208
 
170
209
  # Then we can add the tester to the group that allows the app to test
171
210
  # This is easy enough, we already have all this data. We don't need any response from the previous request
172
- url = "providers/#{team_id}/apps/#{app_id}/groups/#{group_id}/testers/#{tester_id}"
173
- response = request(:put) do |req|
211
+ url = "providers/#{team_id}/apps/#{app_id}/groups/#{group_id}/testers"
212
+ response = request(:post) do |req|
174
213
  req.url url
175
- req.body = {
176
- "groupId" => group_id,
177
- "testerId" => tester_id
178
- }.to_json
214
+ req.body = [{
215
+ "email" => email,
216
+ "firstName" => first_name,
217
+ "lastName" => last_name
218
+ }].to_json
179
219
  req.headers['Content-Type'] = 'application/json'
180
220
  end
181
221
  handle_response(response)
@@ -229,6 +269,8 @@ module Spaceship::TestFlight
229
269
 
230
270
  raise UnexpectedResponse, response.body['error'] if response.body['error']
231
271
 
272
+ raise UnexpectedResponse, "Temporary iTunes Connect error: #{response.body}" if response.body['statusCode'] == 'ERROR'
273
+
232
274
  return response.body['data'] if response.body['data']
233
275
 
234
276
  return response.body
@@ -4,6 +4,9 @@ module Spaceship::TestFlight
4
4
  attr_accessor :name
5
5
  attr_accessor :is_default_external_group
6
6
  attr_accessor :is_internal_group
7
+ attr_accessor :provider_id
8
+ attr_accessor :is_active
9
+ attr_accessor :created
7
10
 
8
11
  attr_accessor :app_id
9
12
 
@@ -12,7 +15,10 @@ module Spaceship::TestFlight
12
15
  'name' => :name,
13
16
  'isInternalGroup' => :is_internal_group,
14
17
  'appAdamId' => :app_id,
15
- 'isDefaultExternalGroup' => :is_default_external_group
18
+ 'isDefaultExternalGroup' => :is_default_external_group,
19
+ 'providerId' => :provider_id,
20
+ 'active' => :is_active,
21
+ 'created' => :created
16
22
  })
17
23
 
18
24
  def self.all(app_id: nil)
@@ -48,12 +54,16 @@ module Spaceship::TestFlight
48
54
  def add_tester!(tester)
49
55
  # This post request creates an account-level tester and then makes it available to the app, or just makes
50
56
  # it available to the app if it already exists
51
- tester_data = client.create_app_level_tester(app_id: self.app_id,
52
- first_name: tester.first_name,
53
- last_name: tester.last_name,
54
- email: tester.email)
57
+ client.create_app_level_tester(app_id: self.app_id,
58
+ first_name: tester.first_name,
59
+ last_name: tester.last_name,
60
+ email: tester.email)
55
61
  # This put request adds the tester to the group
56
- client.put_tester_to_group(group_id: self.id, tester_id: tester_data['id'], app_id: self.app_id)
62
+ client.post_tester_to_group(group_id: self.id,
63
+ email: tester.email,
64
+ first_name: tester.first_name,
65
+ last_name: tester.last_name,
66
+ app_id: self.app_id)
57
67
  end
58
68
 
59
69
  def remove_tester!(tester)
@@ -84,6 +94,10 @@ module Spaceship::TestFlight
84
94
  is_internal_group
85
95
  end
86
96
 
97
+ def active?
98
+ is_active
99
+ end
100
+
87
101
  def self.perform_for_groups_in_app(app: nil, groups: nil, &block)
88
102
  if groups.nil?
89
103
  default_external_group = app.default_external_group
@@ -261,15 +261,13 @@ module Spaceship
261
261
  # TestFlight: A reference to all the build trains
262
262
  # @return [Hash] a hash, the version number and platform being the key
263
263
  def build_trains(platform: nil)
264
- Tunes::BuildTrain.all(self, self.apple_id, platform: platform)
264
+ TestFlight::BuildTrains.all(app_id: self.apple_id, platform: platform)
265
265
  end
266
266
 
267
267
  # The numbers of all build trains that were uploaded
268
268
  # @return [Array] An array of train version numbers
269
269
  def all_build_train_numbers(platform: nil)
270
- client.all_build_trains(app_id: self.apple_id, platform: platform).fetch("trains").collect do |current|
271
- current["versionString"]
272
- end
270
+ return self.build_trains.versions
273
271
  end
274
272
 
275
273
  # Receive the build details for a specific build
@@ -277,46 +275,21 @@ module Spaceship
277
275
  # which might happen if you don't use TestFlight
278
276
  # This is used to receive dSYM files from Apple
279
277
  def all_builds_for_train(train: nil, platform: nil)
280
- client.all_builds_for_train(app_id: self.apple_id, train: train, platform: platform).fetch("items", []).collect do |attrs|
281
- attrs[:apple_id] = self.apple_id
282
- Tunes::Build.factory(attrs)
283
- end
284
- end
285
-
286
- # @return [Array]A list of binaries which are in the invalid state
287
- def all_invalid_builds(platform: nil)
288
- builds = []
289
-
290
- self.build_trains(platform: platform).values.each do |train|
291
- builds.concat(train.invalid_builds)
292
- end
293
-
294
- return builds
278
+ return TestFlight::Build.builds_for_train(app_id: self.apple_id, platform: platform, train_version: train)
295
279
  end
296
280
 
297
281
  # @return [Array] This will return an array of *all* processing builds
298
282
  # this include pre-processing or standard processing
299
283
  def all_processing_builds(platform: nil)
300
- builds = []
301
-
302
- self.build_trains(platform: platform).each do |version_number, train|
303
- builds.concat(train.processing_builds)
304
- end
305
-
306
- return builds
284
+ return TestFlight::Build.all_processing_builds(app_id: self.apple_id, platform: platform)
307
285
  end
308
286
 
309
287
  # Get all builds that are already processed for all build trains
310
288
  # You can either use the return value (array) or pass a block
311
289
  def builds(platform: nil)
312
- all_builds = []
313
- self.build_trains(platform: platform).each do |version_number, train|
314
- train.builds.each do |build|
315
- yield(build) if block_given?
316
- all_builds << build unless block_given?
317
- end
318
- end
319
- all_builds
290
+ all = TestFlight::Build.all(app_id: self.apple_id, platform: platform)
291
+ return all unless block_given?
292
+ all.each { |build| yield(build) }
320
293
  end
321
294
 
322
295
  #####################################################
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.20171117010003
4
+ version: 2.65.0.beta.20171118010003
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-17 00:00:00.000000000 Z
18
+ date: 2017-11-18 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: slack-notifier
@@ -1427,6 +1427,7 @@ files:
1427
1427
  - spaceship/lib/spaceship/portal/spaceship.rb
1428
1428
  - spaceship/lib/spaceship/portal/ui/select_team.rb
1429
1429
  - spaceship/lib/spaceship/portal/website_push.rb
1430
+ - spaceship/lib/spaceship/provider.rb
1430
1431
  - spaceship/lib/spaceship/spaceauth_runner.rb
1431
1432
  - spaceship/lib/spaceship/test_flight.rb
1432
1433
  - spaceship/lib/spaceship/test_flight/app_test_info.rb