fastlane 2.14.2 → 2.15.0.beta.20170213032052

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/cert/lib/cert/commands_generator.rb +1 -1
  3. data/cert/lib/cert/runner.rb +1 -1
  4. data/credentials_manager/lib/credentials_manager/appfile_config.rb +1 -1
  5. data/deliver/lib/deliver/commands_generator.rb +1 -1
  6. data/deliver/lib/deliver/runner.rb +2 -2
  7. data/deliver/lib/deliver/setup.rb +4 -2
  8. data/fastlane/lib/fastlane/actions/actions_helper.rb +1 -1
  9. data/fastlane/lib/fastlane/actions/add_extra_platforms.rb +45 -0
  10. data/fastlane/lib/fastlane/actions/changelog_from_git_commits.rb +13 -7
  11. data/fastlane/lib/fastlane/actions/crashlytics.rb +2 -2
  12. data/fastlane/lib/fastlane/actions/ensure_no_debug_code.rb +13 -1
  13. data/fastlane/lib/fastlane/actions/git_tag_exists.rb +1 -1
  14. data/fastlane/lib/fastlane/actions/hockey.rb +117 -14
  15. data/fastlane/lib/fastlane/actions/slack.rb +1 -1
  16. data/fastlane/lib/fastlane/cli_tools_distributor.rb +4 -0
  17. data/fastlane/lib/fastlane/commands_generator.rb +12 -12
  18. data/fastlane/lib/fastlane/documentation/docs_generator.rb +1 -1
  19. data/fastlane/lib/fastlane/environment_printer.rb +2 -2
  20. data/fastlane/lib/fastlane/fastlane_require.rb +1 -1
  21. data/fastlane/lib/fastlane/helper/git_helper.rb +22 -15
  22. data/fastlane/lib/fastlane/lane_manager.rb +2 -2
  23. data/fastlane/lib/fastlane/plugins/plugin_info_collector.rb +2 -2
  24. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +5 -5
  25. data/fastlane/lib/fastlane/runner.rb +12 -9
  26. data/fastlane/lib/fastlane/setup/crashlytics_beta_ui.rb +1 -4
  27. data/fastlane/lib/fastlane/supported_platforms.rb +17 -7
  28. data/fastlane/lib/fastlane/version.rb +1 -1
  29. data/fastlane_core/lib/fastlane_core.rb +1 -0
  30. data/fastlane_core/lib/fastlane_core/cert_checker.rb +3 -3
  31. data/fastlane_core/lib/fastlane_core/command_executor.rb +1 -1
  32. data/fastlane_core/lib/fastlane_core/configuration/commander_generator.rb +7 -3
  33. data/fastlane_core/lib/fastlane_core/device_manager.rb +43 -16
  34. data/fastlane_core/lib/fastlane_core/globals.rb +27 -0
  35. data/fastlane_core/lib/fastlane_core/ipa_upload_package_builder.rb +1 -1
  36. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +2 -4
  37. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +1 -1
  38. data/fastlane_core/lib/fastlane_core/pkg_upload_package_builder.rb +1 -1
  39. data/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb +4 -4
  40. data/fastlane_core/lib/fastlane_core/ui/github_issue_inspector_reporter.rb +1 -1
  41. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +22 -14
  42. data/fastlane_core/lib/fastlane_core/ui/interface.rb +5 -4
  43. data/frameit/README.md +4 -1
  44. data/frameit/lib/frameit/commands_generator.rb +1 -1
  45. data/frameit/lib/frameit/editor.rb +60 -13
  46. data/frameit/lib/frameit/runner.rb +1 -1
  47. data/gym/README.md +14 -0
  48. data/gym/lib/gym/commands_generator.rb +1 -1
  49. data/gym/lib/gym/error_handler.rb +2 -2
  50. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +1 -1
  51. data/gym/lib/gym/runner.rb +3 -3
  52. data/gym/lib/gym/xcodebuild_fixes/package_application_fix.rb +2 -2
  53. data/gym/lib/gym/xcodebuild_fixes/swift_fix.rb +1 -1
  54. data/match/lib/match/commands_generator.rb +1 -1
  55. data/match/lib/match/encrypt.rb +3 -3
  56. data/match/lib/match/git_helper.rb +8 -8
  57. data/match/lib/match/options.rb +1 -1
  58. data/match/lib/match/utils.rb +3 -3
  59. data/pem/lib/pem/commands_generator.rb +1 -1
  60. data/pilot/lib/pilot/commands_generator.rb +1 -1
  61. data/produce/README.md +1 -1
  62. data/produce/lib/produce/commands_generator.rb +2 -2
  63. data/scan/lib/scan/commands_generator.rb +1 -1
  64. data/scan/lib/scan/options.rb +6 -0
  65. data/scan/lib/scan/runner.rb +2 -2
  66. data/scan/lib/scan/test_command_generator.rb +1 -0
  67. data/screengrab/lib/screengrab/commands_generator.rb +1 -1
  68. data/sigh/lib/sigh/commands_generator.rb +3 -3
  69. data/sigh/lib/sigh/local_manage.rb +1 -1
  70. data/sigh/lib/sigh/resign.rb +1 -1
  71. data/sigh/lib/sigh/runner.rb +8 -3
  72. data/snapshot/README.md +3 -3
  73. data/snapshot/lib/snapshot/collector.rb +1 -1
  74. data/snapshot/lib/snapshot/commands_generator.rb +1 -1
  75. data/snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb +1 -1
  76. data/snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb +1 -1
  77. data/snapshot/lib/snapshot/reset_simulators.rb +2 -2
  78. data/snapshot/lib/snapshot/runner.rb +3 -3
  79. data/spaceship/lib/spaceship.rb +2 -0
  80. data/spaceship/lib/spaceship/base.rb +18 -0
  81. data/spaceship/lib/spaceship/client.rb +8 -5
  82. data/spaceship/lib/spaceship/globals.rb +12 -0
  83. data/spaceship/lib/spaceship/portal/app.rb +0 -6
  84. data/spaceship/lib/spaceship/portal/app_group.rb +0 -6
  85. data/spaceship/lib/spaceship/portal/device.rb +0 -6
  86. data/spaceship/lib/spaceship/portal/person.rb +0 -6
  87. data/spaceship/lib/spaceship/portal/portal.rb +1 -0
  88. data/spaceship/lib/spaceship/portal/portal_client.rb +37 -0
  89. data/spaceship/lib/spaceship/portal/spaceship.rb +9 -0
  90. data/spaceship/lib/spaceship/portal/website_push.rb +90 -0
  91. data/spaceship/lib/spaceship/tunes/app_image.rb +0 -6
  92. data/spaceship/lib/spaceship/tunes/app_ratings.rb +0 -9
  93. data/spaceship/lib/spaceship/tunes/app_screenshot.rb +0 -7
  94. data/spaceship/lib/spaceship/tunes/app_trailer.rb +0 -6
  95. data/spaceship/lib/spaceship/tunes/app_version.rb +1 -0
  96. data/spaceship/lib/spaceship/tunes/app_version_generated_promocodes.rb +0 -9
  97. data/spaceship/lib/spaceship/tunes/app_version_history.rb +0 -9
  98. data/spaceship/lib/spaceship/tunes/app_version_promocodes.rb +0 -9
  99. data/spaceship/lib/spaceship/tunes/app_version_ref.rb +0 -6
  100. data/spaceship/lib/spaceship/tunes/app_version_states_history.rb +0 -9
  101. data/spaceship/lib/spaceship/tunes/application.rb +0 -6
  102. data/spaceship/lib/spaceship/tunes/build.rb +0 -8
  103. data/spaceship/lib/spaceship/tunes/build_details.rb +0 -8
  104. data/spaceship/lib/spaceship/tunes/build_train.rb +0 -6
  105. data/spaceship/lib/spaceship/tunes/member.rb +0 -6
  106. data/spaceship/lib/spaceship/tunes/pricing_tier.rb +0 -9
  107. data/spaceship/lib/spaceship/tunes/recovery_device.rb +0 -6
  108. data/spaceship/lib/spaceship/tunes/territory.rb +0 -7
  109. data/spaceship/lib/spaceship/tunes/tester.rb +0 -6
  110. data/spaceship/lib/spaceship/tunes/transit_app_file.rb +0 -6
  111. data/spaceship/lib/spaceship/tunes/tunes_client.rb +2 -2
  112. data/spaceship/lib/spaceship/tunes/user_detail.rb +0 -6
  113. data/spaceship/lib/spaceship/tunes/version_set.rb +0 -11
  114. data/spaceship/lib/spaceship/two_step_client.rb +2 -2
  115. data/supply/lib/supply/commands_generator.rb +1 -1
  116. metadata +34 -17
@@ -158,6 +158,24 @@ module Spaceship
158
158
  super
159
159
  end
160
160
  end
161
+
162
+ ##
163
+ # The factory class-method. This should only be used or overridden in very specific use-cases
164
+ #
165
+ # The only time it makes sense to use or override this method is when we want a base class
166
+ # to return a sub-class based on attributes.
167
+ #
168
+ # Here, we define the method to be the same as `Spaceship::Base.new(attrs)`, be it should
169
+ # be used only by classes that override it.
170
+ #
171
+ # Example:
172
+ #
173
+ # Certificate.factory(attrs)
174
+ # #=> #<PushCertificate ... >
175
+ #
176
+ def factory(attrs)
177
+ self.new(attrs)
178
+ end
161
179
  end
162
180
 
163
181
  ##
@@ -79,8 +79,8 @@ module Spaceship
79
79
 
80
80
  [
81
81
  "Apple provided the following error info:",
82
- CGI.unescapeHTML(@error_info['resultString']),
83
- CGI.unescapeHTML(@error_info['userString'])
82
+ @error_info['resultString'],
83
+ @error_info['userString']
84
84
  ].compact.uniq # sometimes 'resultString' and 'userString' are the same value
85
85
  end
86
86
  end
@@ -395,7 +395,7 @@ module Spaceship
395
395
  rescue UnauthorizedAccessError => ex
396
396
  if @loggedin && !(tries -= 1).zero?
397
397
  msg = "Auth error received: '#{ex.message}'. Login in again then retrying after 3 seconds (remaining: #{tries})..."
398
- puts msg if $verbose
398
+ puts msg if Spaceship::Globals.verbose?
399
399
  logger.warn msg
400
400
 
401
401
  if self.class.spaceship_session_env.to_s.length > 0
@@ -438,15 +438,18 @@ module Spaceship
438
438
  if response.body
439
439
  # If we have an `expected_key`, select that from response.body Hash
440
440
  # Else, don't.
441
+
442
+ # the returned error message and info, is html encoded -> &quot;issued&quot; -> make this readable -> "issued"
443
+ response.body["userString"] = CGI.unescapeHTML(response.body["userString"]) if response.body["userString"]
444
+ response.body["resultString"] = CGI.unescapeHTML(response.body["resultString"]) if response.body["resultString"]
445
+
441
446
  content = expected_key ? response.body[expected_key] : response.body
442
447
  end
443
-
444
448
  if content.nil?
445
449
  # Check if the failure is due to missing permissions (iTunes Connect)
446
450
  if response.body && response.body["messages"] && response.body["messages"]["error"].include?("Forbidden")
447
451
  raise_insuffient_permission_error!
448
452
  end
449
-
450
453
  raise UnexpectedResponse, response.body
451
454
  elsif content.kind_of?(Hash) && (content["resultString"] || "").include?("NotAllowed")
452
455
  # example content when doing a Developer Portal action with not enough permission
@@ -0,0 +1,12 @@
1
+ module Spaceship
2
+ class Globals
3
+ # if spaceship is run with a FastlaneCore available respect the global state there
4
+ # otherwise fallback to $verbose
5
+ def self.verbose?
6
+ if Object.const_defined?("FastlaneCore")
7
+ return FastlaneCore::Globals.verbose?
8
+ end
9
+ return $verbose
10
+ end
11
+ end
12
+ end
@@ -68,12 +68,6 @@ module Spaceship
68
68
  )
69
69
 
70
70
  class << self
71
- # Create a new object based on a hash.
72
- # This is used to create a new object based on the server response.
73
- def factory(attrs)
74
- self.new(attrs)
75
- end
76
-
77
71
  # @param mac [Bool] Fetches Mac apps if true
78
72
  # @return (Array) Returns all apps available for this account
79
73
  def all(mac: false)
@@ -36,12 +36,6 @@ module Spaceship
36
36
  )
37
37
 
38
38
  class << self
39
- # Create a new object based on a hash.
40
- # This is used to create a new object based on the server response.
41
- def factory(attrs)
42
- self.new(attrs)
43
- end
44
-
45
39
  # @return (Array) Returns all app groups available for this account
46
40
  def all
47
41
  client.app_groups.map { |group| self.factory(group) }
@@ -52,12 +52,6 @@ module Spaceship
52
52
  })
53
53
 
54
54
  class << self
55
- # Create a new object based on a hash.
56
- # This is used to create a new object based on the server response.
57
- def factory(attrs)
58
- self.new(attrs)
59
- end
60
-
61
55
  # @param mac [Bool] Fetches Mac devices if true
62
56
  # @param include_disabled [Bool] Whether to include disable devices. false by default.
63
57
  # @return (Array) Returns all devices registered for this account
@@ -35,12 +35,6 @@ module Spaceship
35
35
  'teamMemberId' => :team_member_id
36
36
  )
37
37
 
38
- class << self
39
- def factory(attrs)
40
- self.new(attrs)
41
- end
42
- end
43
-
44
38
  def remove!
45
39
  client.team_remove_member!(team_member_id)
46
40
  end
@@ -1,5 +1,6 @@
1
1
  require 'spaceship/portal/portal_base'
2
2
  require 'spaceship/portal/app'
3
+ require 'spaceship/portal/website_push'
3
4
  require 'spaceship/portal/app_group'
4
5
  require 'spaceship/portal/app_service'
5
6
  require 'spaceship/portal/certificate'
@@ -199,6 +199,43 @@ module Spaceship
199
199
  parse_response(r, 'appId')
200
200
  end
201
201
 
202
+ #####################################################
203
+ # @!group Website Push
204
+ #####################################################
205
+
206
+ def website_push(mac: false)
207
+ paging do |page_number|
208
+ r = request(:post, "account/#{platform_slug(mac)}/identifiers/listWebsitePushIds.action", {
209
+ teamId: team_id,
210
+ pageNumber: page_number,
211
+ pageSize: page_size,
212
+ sort: 'name=asc'
213
+ })
214
+ parse_response(r, 'websitePushIdList')
215
+ end
216
+ end
217
+
218
+ def create_website_push!(name, bundle_id, mac: false)
219
+ ensure_csrf(Spaceship::WebsitePush)
220
+
221
+ r = request(:post, "account/#{platform_slug(mac)}/identifiers/addWebsitePushId.action", {
222
+ name: name,
223
+ identifier: bundle_id,
224
+ teamId: team_id
225
+ })
226
+ parse_response(r, 'websitePushId')
227
+ end
228
+
229
+ def delete_website_push!(website_id, mac: false)
230
+ ensure_csrf(Spaceship::WebsitePush)
231
+
232
+ r = request(:post, "account/#{platform_slug(mac)}/identifiers/deleteWebsitePushId.action", {
233
+ teamId: team_id,
234
+ websitePushId: website_id
235
+ })
236
+ parse_response(r)
237
+ end
238
+
202
239
  #####################################################
203
240
  # @!group App Groups
204
241
  #####################################################
@@ -44,6 +44,11 @@ module Spaceship
44
44
  Spaceship::App.set_client(@client)
45
45
  end
46
46
 
47
+ # @return (Class) Access the website pushes for the spaceship
48
+ def website_push
49
+ Spaceship::WebsitePush.set_client(@client)
50
+ end
51
+
47
52
  # @return (Class) Access the app groups for the spaceship
48
53
  def app_group
49
54
  Spaceship::AppGroup.set_client(@client)
@@ -85,6 +90,10 @@ module Spaceship
85
90
  Spaceship::Portal.app
86
91
  end
87
92
 
93
+ def website_push
94
+ Spaceship::Portal.website_push
95
+ end
96
+
88
97
  def app_group
89
98
  Spaceship::Portal.app_group
90
99
  end
@@ -0,0 +1,90 @@
1
+ module Spaceship
2
+ module Portal
3
+ # Represents an Website Push ID from the Developer Portal
4
+ class WebsitePush < PortalBase
5
+ # @return (String) The identifier of this website push, provided by the Dev Portal
6
+ # @example
7
+ # "RGAWZGXSAA"
8
+ attr_accessor :website_id
9
+
10
+ # @return (String) The name you provided for this website push
11
+ # @example
12
+ # "Spaceship"
13
+ attr_accessor :name
14
+
15
+ # @return (String) the supported platform of this website push
16
+ # @example
17
+ # "ios"
18
+ attr_accessor :platform
19
+
20
+ # Prefix provided by the Dev Portal
21
+ # @example
22
+ # "5A997XSHK2"
23
+ attr_accessor :prefix
24
+
25
+ # @return (String) The bundle_id (website identifier) of website push id
26
+ # @example
27
+ # "web.com.krausefx.app"
28
+ attr_accessor :bundle_id
29
+
30
+ # @return (String) Status of the website push
31
+ # @example
32
+ # "current"
33
+ attr_accessor :status
34
+
35
+ attr_mapping(
36
+ 'websitePushId' => :website_id,
37
+ 'name' => :name,
38
+ 'prefix' => :prefix,
39
+ 'identifier' => :bundle_id,
40
+ 'status' => :status
41
+ )
42
+
43
+ class << self
44
+ # Create a new object based on a hash.
45
+ # This is used to create a new object based on the server response.
46
+ def factory(attrs)
47
+ self.new(attrs)
48
+ end
49
+
50
+ # @param mac [Bool] Fetches Mac website push if true
51
+ # @return (Array) Returns all website push available for this account
52
+ def all(mac: false)
53
+ client.website_push(mac: mac).map { |website_push| self.factory(website_push) }
54
+ end
55
+
56
+ # Creates a new Website Push ID on the Apple Dev Portal
57
+ #
58
+ # @param bundle_id [String] the bundle id (website_push_identifier) of the website push
59
+ # @param name [String] the name of the Website Push
60
+ # @param mac [Bool] is this a Mac Website Push?
61
+ # @return (Website Push) The Website Push you just created
62
+ def create!(bundle_id: nil, name: nil, mac: false)
63
+ new_website_push = client.create_website_push!(name, bundle_id, mac: mac)
64
+ self.new(new_website_push)
65
+ end
66
+
67
+ # Find a specific Website Push ID based on the bundle_id
68
+ # @param mac [Bool] Searches Mac website pushes if true
69
+ # @return (Website Push) The website push you're looking for. This is nil if the website push can't be found.
70
+ def find(bundle_id, mac: false)
71
+ all(mac: mac).find do |website_push|
72
+ website_push.bundle_id == bundle_id
73
+ end
74
+ end
75
+ end
76
+
77
+ # Delete this Website Push ID.
78
+ # @return (Website Push) The website you just deleted
79
+ def delete!
80
+ client.delete_website_push!(website_id, mac: mac?)
81
+ self
82
+ end
83
+
84
+ # @return (Bool) Is this a Mac website push?
85
+ def mac?
86
+ platform == 'mac'
87
+ end
88
+ end
89
+ end
90
+ end
@@ -21,12 +21,6 @@ module Spaceship
21
21
  'originalFileName' => :original_file_name
22
22
  )
23
23
 
24
- class << self
25
- def factory(attrs)
26
- self.new(attrs)
27
- end
28
- end
29
-
30
24
  def reset!(attrs = {})
31
25
  update_raw_data!(
32
26
  {
@@ -85,15 +85,6 @@ module Spaceship
85
85
  'ratingFiveCount' => :five_star_rating_count
86
86
  })
87
87
 
88
- class << self
89
- # Create a new object based on a hash.
90
- # This is used to create a new object based on the server response.
91
- def factory(attrs)
92
- obj = self.new(attrs)
93
- return obj
94
- end
95
- end
96
-
97
88
  # @return (Float) the average rating for this summary (rounded to 2 decimal places)
98
89
  def average_rating
99
90
  ((self.one_star_rating_count +
@@ -5,13 +5,6 @@ module Spaceship
5
5
  attr_accessor :device_type
6
6
 
7
7
  attr_accessor :language
8
-
9
- class << self
10
- # Create a new object based on a hash.
11
- def factory(attrs)
12
- self.new(attrs)
13
- end
14
- end
15
8
  end
16
9
  end
17
10
  end
@@ -33,12 +33,6 @@ module Spaceship
33
33
  'videoStatus' => :video_status
34
34
  )
35
35
 
36
- class << self
37
- def factory(attrs)
38
- self.new(attrs)
39
- end
40
- end
41
-
42
36
  def reset!(attrs = {})
43
37
  update_raw_data!({
44
38
  video_asset_token: nil,
@@ -584,6 +584,7 @@ module Spaceship
584
584
  lang_details = languages[0]
585
585
  display_families = lang_details["displayFamilies"]["value"]
586
586
  device_details = display_families.find { |display_family| display_family['name'] == device }
587
+ raise "Couldn't find device familiy for #{device}" if device_details.nil?
587
588
  raise "Unexpected state: missing device details for #{device}" unless device_details.key?(data_field)
588
589
  return device_details[data_field]
589
590
  rescue => ex
@@ -17,15 +17,6 @@ module Spaceship
17
17
  'username' => :username
18
18
  })
19
19
 
20
- class << self
21
- # Create a new object based on a hash.
22
- # This is used to create a new object based on the server response.
23
- def factory(attrs)
24
- obj = self.new(attrs)
25
- return obj
26
- end
27
- end
28
-
29
20
  def setup
30
21
  @version = Tunes::AppVersionPromocodes.factory(raw_data['version'])
31
22
  @codes = raw_data['codes']
@@ -21,15 +21,6 @@ module Spaceship
21
21
  'items' => :items
22
22
  })
23
23
 
24
- class << self
25
- # Create a new object based on a hash.
26
- # This is used to create a new object based on the server response.
27
- def factory(attrs)
28
- obj = self.new(attrs)
29
- return obj
30
- end
31
- end
32
-
33
24
  # Returns an array of all builds that can be sent to review
34
25
  def items
35
26
  @items ||= fetch_items
@@ -20,15 +20,6 @@ module Spaceship
20
20
  'maximumNumberOfCodes' => :maximum_number_of_codes,
21
21
  'contractFileName' => :contract_file_name
22
22
  })
23
-
24
- class << self
25
- # Create a new object based on a hash.
26
- # This is used to create a new object based on the server response.
27
- def factory(attrs)
28
- obj = self.new(attrs)
29
- return obj
30
- end
31
- end
32
23
  end
33
24
  end
34
25
  end
@@ -8,12 +8,6 @@ module Spaceship
8
8
  'ssoTokenForImage' => :sso_token_for_image,
9
9
  'ssoTokenForVideo' => :sso_token_for_video
10
10
  )
11
-
12
- class << self
13
- def factory(attrs)
14
- self.new(attrs)
15
- end
16
- end
17
11
  end
18
12
  end
19
13
  end
@@ -20,15 +20,6 @@ module Spaceship
20
20
  'userEmail' => :user_email,
21
21
  'date' => :date
22
22
  })
23
-
24
- class << self
25
- # Create a new object based on a hash.
26
- # This is used to create a new object based on the server response.
27
- def factory(attrs)
28
- obj = self.new(attrs)
29
- return obj
30
- end
31
- end
32
23
  end
33
24
  end
34
25
  end