fastlane 2.157.4 → 2.162.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +80 -80
  3. data/cert/lib/cert/options.rb +28 -1
  4. data/cert/lib/cert/runner.rb +50 -33
  5. data/deliver/lib/deliver/app_screenshot_iterator.rb +4 -4
  6. data/deliver/lib/deliver/options.rb +17 -1
  7. data/deliver/lib/deliver/runner.rb +36 -7
  8. data/deliver/lib/deliver/upload_metadata.rb +37 -6
  9. data/deliver/lib/deliver/upload_price_tier.rb +7 -2
  10. data/deliver/lib/deliver/upload_screenshots.rb +25 -8
  11. data/{pilot/lib/pilot/.manager.rb.swp → fastlane/lib/fastlane/.erb_template_helper.rb.swp} +0 -0
  12. data/fastlane/lib/fastlane/actions/{.ensure_git_status_clean.rb.swp → .git_commit.rb.swp} +0 -0
  13. data/fastlane/lib/fastlane/actions/actions_helper.rb +20 -1
  14. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +6 -1
  15. data/fastlane/lib/fastlane/actions/clean_build_artifacts.rb +1 -0
  16. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +2 -2
  17. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
  18. data/fastlane/lib/fastlane/actions/docs/create_app_online.md +1 -1
  19. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +3 -2
  20. data/fastlane/lib/fastlane/actions/docs/run_tests.md +2 -2
  21. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +3 -3
  22. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -2
  23. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +2 -2
  24. data/fastlane/lib/fastlane/actions/download_dsyms.rb +32 -7
  25. data/fastlane/lib/fastlane/actions/ensure_git_status_clean.rb +13 -2
  26. data/fastlane/lib/fastlane/helper/git_helper.rb +2 -0
  27. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +6 -4
  28. data/fastlane/lib/fastlane/swift_fastlane_function.rb +1 -1
  29. data/fastlane/lib/fastlane/version.rb +1 -1
  30. data/fastlane/swift/Actions.swift +2 -1
  31. data/fastlane/swift/Appfile.swift +2 -4
  32. data/fastlane/swift/ArgumentProcessor.swift +2 -6
  33. data/fastlane/swift/ControlCommand.swift +2 -5
  34. data/fastlane/swift/Deliverfile.swift +5 -2
  35. data/fastlane/swift/DeliverfileProtocol.swift +15 -4
  36. data/fastlane/swift/Fastfile.swift +5 -1
  37. data/fastlane/swift/Fastlane.swift +2333 -2240
  38. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +5 -5
  39. data/fastlane/swift/Gymfile.swift +5 -2
  40. data/fastlane/swift/GymfileProtocol.swift +6 -3
  41. data/fastlane/swift/LaneFileProtocol.swift +42 -29
  42. data/fastlane/swift/MainProcess.swift +77 -0
  43. data/fastlane/swift/Matchfile.swift +5 -2
  44. data/fastlane/swift/MatchfileProtocol.swift +21 -6
  45. data/fastlane/swift/Plugins.swift +2 -1
  46. data/fastlane/swift/Precheckfile.swift +5 -2
  47. data/fastlane/swift/PrecheckfileProtocol.swift +18 -3
  48. data/fastlane/swift/RubyCommand.swift +2 -6
  49. data/fastlane/swift/RubyCommandable.swift +2 -6
  50. data/fastlane/swift/Runner.swift +5 -9
  51. data/fastlane/swift/RunnerArgument.swift +2 -6
  52. data/fastlane/swift/Scanfile.swift +5 -2
  53. data/fastlane/swift/ScanfileProtocol.swift +6 -3
  54. data/fastlane/swift/Screengrabfile.swift +5 -2
  55. data/fastlane/swift/ScreengrabfileProtocol.swift +6 -3
  56. data/fastlane/swift/Snapshotfile.swift +5 -2
  57. data/fastlane/swift/SnapshotfileProtocol.swift +6 -3
  58. data/fastlane/swift/SocketClient.swift +3 -7
  59. data/fastlane/swift/SocketClientDelegateProtocol.swift +2 -6
  60. data/fastlane/swift/SocketResponse.swift +2 -6
  61. data/fastlane/swift/formatting/Brewfile.lock.json +18 -10
  62. data/fastlane/swift/main.swift +4 -8
  63. data/fastlane/swift/upgrade_manifest.json +1 -1
  64. data/fastlane_core/lib/fastlane_core/analytics/analytics_session.rb +6 -7
  65. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +2 -2
  66. data/frameit/lib/frameit/editor.rb +1 -0
  67. data/match/lib/match/generator.rb +6 -1
  68. data/match/lib/match/importer.rb +44 -8
  69. data/match/lib/match/migrate.rb +13 -2
  70. data/match/lib/match/nuke.rb +65 -22
  71. data/match/lib/match/options.rb +27 -2
  72. data/match/lib/match/runner.rb +38 -10
  73. data/match/lib/match/spaceship_ensure.rb +27 -21
  74. data/match/lib/match/storage/google_cloud_storage.rb +20 -3
  75. data/match/lib/match/storage/s3_storage.rb +19 -3
  76. data/pilot/lib/pilot/options.rb +2 -2
  77. data/precheck/lib/precheck/options.rb +25 -0
  78. data/precheck/lib/precheck/rule_processor.rb +94 -60
  79. data/precheck/lib/precheck/runner.rb +26 -5
  80. data/sigh/lib/sigh/options.rb +21 -0
  81. data/sigh/lib/sigh/runner.rb +80 -38
  82. data/snapshot/lib/assets/SnapshotHelper.swift +17 -2
  83. data/spaceship/README.md +1 -1
  84. data/spaceship/lib/spaceship/{connect_api/.DS_Store → .DS_Store} +0 -0
  85. data/spaceship/lib/spaceship/client.rb +2 -1
  86. data/spaceship/lib/spaceship/connect_api.rb +1 -0
  87. data/spaceship/lib/spaceship/connect_api/api_client.rb +3 -3
  88. data/spaceship/lib/spaceship/connect_api/client.rb +38 -15
  89. data/{fastlane/lib/fastlane/actions/.update_project_provisioning.rb.swp → spaceship/lib/spaceship/connect_api/models/.app_store_version_submission.rb.swp} +0 -0
  90. data/spaceship/lib/spaceship/connect_api/models/app.rb +17 -9
  91. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +1 -0
  92. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +3 -1
  93. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +2 -2
  94. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +3 -5
  95. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +3 -5
  96. data/spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb +21 -0
  97. data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +2 -1
  98. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +42 -0
  99. data/spaceship/lib/spaceship/connect_api/models/profile.rb +7 -1
  100. data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +59 -0
  101. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +28 -2
  102. data/spaceship/lib/spaceship/connect_api/spaceship.rb +3 -2
  103. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +13 -0
  104. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +29 -9
  105. data/spaceship/lib/spaceship/connect_api/users/users.rb +40 -0
  106. data/spaceship/lib/spaceship/helper/net_http_generic_request.rb +11 -5
  107. metadata +24 -25
  108. data/fastlane/lib/fastlane/actions/.hockey.rb.swp +0 -0
  109. data/fastlane/lib/fastlane/actions/.slack.rb.swp +0 -0
  110. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcuserdata/josh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
@@ -52,10 +52,10 @@ module Deliver
52
52
  end
53
53
  end
54
54
 
55
- # Iterate given local app_screenshot over localizations and app_screenshot_sets with index within each app_screenshot_set
55
+ # Iterate given local app_screenshot over localizations and app_screenshot_sets
56
56
  #
57
57
  # @param screenshots_per_language [Hash<String, Array<Deliver::AppScreenshot>]
58
- # @yield [localization, app_screenshot_set, app_screenshot, index]
58
+ # @yield [localization, app_screenshot_set, app_screenshot]
59
59
  # @yieldparam [optional, Spaceship::ConnectAPI::AppStoreVersionLocalization] localization
60
60
  # @yieldparam [optional, Spaceship::ConnectAPI::AppStoreScreenshotSet] app_screenshot_set
61
61
  # @yieldparam [optional, Deliver::AppScreenshot] screenshot
@@ -85,8 +85,8 @@ module Deliver
85
85
  app_screenshot_set ||= localization.create_app_screenshot_set(attributes: { screenshotDisplayType: display_type })
86
86
 
87
87
  # iterate over screenshots per display size with index
88
- screenshots.each.with_index do |screenshot, index|
89
- yield(localization, app_screenshot_set, screenshot, index)
88
+ screenshots.each do |screenshot|
89
+ yield(localization, app_screenshot_set, screenshot)
90
90
  end
91
91
  end
92
92
  end
@@ -12,6 +12,22 @@ module Deliver
12
12
  user ||= ENV["DELIVER_USER"]
13
13
 
14
14
  [
15
+ FastlaneCore::ConfigItem.new(key: :api_key_path,
16
+ env_name: "DELIVER_API_KEY_PATH",
17
+ description: "Path to your App Store Connect API Key JSON file (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-json-file)",
18
+ optional: true,
19
+ conflicting_options: [:api_key],
20
+ verify_block: proc do |value|
21
+ UI.user_error!("Couldn't find API key JSON file at path '#{value}'") unless File.exist?(value)
22
+ end),
23
+ FastlaneCore::ConfigItem.new(key: :api_key,
24
+ env_name: "DELIVER_API_KEY",
25
+ description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#use-return-value-and-pass-in-as-an-option)",
26
+ type: Hash,
27
+ optional: true,
28
+ sensitive: true,
29
+ conflicting_options: [:api_key_path]),
30
+
15
31
  FastlaneCore::ConfigItem.new(key: :username,
16
32
  short_option: "-u",
17
33
  env_name: "DELIVER_USERNAME",
@@ -129,7 +145,7 @@ module Deliver
129
145
  default_value: false),
130
146
  FastlaneCore::ConfigItem.new(key: :skip_app_version_update,
131
147
  env_name: "DELIVER_SKIP_APP_VERSION_UPDATE",
132
- description: "Don't update app version for submission",
148
+ description: "Dont create or update the app version that is being prepared for submission",
133
149
  is_string: false,
134
150
  default_value: false),
135
151
 
@@ -26,11 +26,22 @@ module Deliver
26
26
  end
27
27
 
28
28
  def login
29
- # Team selection passed though FASTLANE_TEAM_ID and FASTLANE_TEAM_NAME environment variables
30
- # Prompts select team if multiple teams and none specified
31
- UI.message("Login to App Store Connect (#{options[:username]})")
32
- Spaceship::ConnectAPI.login(options[:username], nil, use_portal: false, use_tunes: true)
33
- UI.message("Login successful")
29
+ if api_token
30
+ UI.message("Creating authorization token for App Store Connect API")
31
+ Spaceship::ConnectAPI.token = api_token
32
+ else
33
+ # Team selection passed though FASTLANE_TEAM_ID and FASTLANE_TEAM_NAME environment variables
34
+ # Prompts select team if multiple teams and none specified
35
+ UI.message("Login to App Store Connect (#{options[:username]})")
36
+ Spaceship::ConnectAPI.login(options[:username], nil, use_portal: false, use_tunes: true)
37
+ UI.message("Login successful")
38
+ end
39
+ end
40
+
41
+ def api_token
42
+ @api_token ||= Spaceship::ConnectAPI::Token.create(options[:api_key]) if options[:api_key]
43
+ @api_token ||= Spaceship::ConnectAPI::Token.from_json_file(options[:api_key_path]) if options[:api_key_path]
44
+ return @api_token
34
45
  end
35
46
 
36
47
  def run
@@ -67,10 +78,21 @@ module Deliver
67
78
  precheck_options = {
68
79
  default_rule_level: options[:precheck_default_rule_level],
69
80
  include_in_app_purchases: options[:precheck_include_in_app_purchases],
70
- app_identifier: options[:app_identifier],
71
- username: options[:username]
81
+ app_identifier: options[:app_identifier]
72
82
  }
73
83
 
84
+ if options[:api_key] || options[:api_key_path]
85
+ if options[:precheck_include_in_app_purchases]
86
+ UI.user_error!("Precheck cannot check In-app purchases with the App Store Connect API Key (yet). Exclude In-app purchases from precheck or use Apple ID login")
87
+ end
88
+
89
+ precheck_options[:api_key] = options[:api_key]
90
+ precheck_options[:api_key_path] = options[:api_key_path]
91
+ else
92
+ precheck_options[:username] = options[:username]
93
+ precheck_options[:platform] = options[:platform]
94
+ end
95
+
74
96
  precheck_config = FastlaneCore::Configuration.create(Precheck::Options.available_options, precheck_options)
75
97
  Precheck.config = precheck_config
76
98
 
@@ -174,10 +196,17 @@ module Deliver
174
196
 
175
197
  private
176
198
 
199
+ # If App Store Connect API token, use token.
177
200
  # If itc_provider was explicitly specified, use it.
178
201
  # If there are multiple teams, infer the provider from the selected team name.
179
202
  # If there are fewer than two teams, don't infer the provider.
180
203
  def transporter_for_selected_team
204
+ # Use JWT auth
205
+ unless api_token.nil?
206
+ api_token.refresh! if api_token.expired?
207
+ return FastlaneCore::ItunesTransporter.new(nil, nil, false, nil, api_token.text)
208
+ end
209
+
181
210
  tunes_client = Spaceship::ConnectAPI.client.tunes_client
182
211
 
183
212
  generic_transporter = FastlaneCore::ItunesTransporter.new(options[:username], nil, false, options[:itc_provider])
@@ -96,7 +96,7 @@ module Deliver
96
96
 
97
97
  if v.nil?
98
98
  UI.message("Couldn't find live version, editing the current version on App Store Connect instead")
99
- version = app.get_edit_app_store_version(platform: platform)
99
+ version = fetch_edit_app_store_version(app, platform)
100
100
  # we don't want to update the localised_options and non_localised_options
101
101
  # as we also check for `options[:edit_live]` at other areas in the code
102
102
  # by not touching those 2 variables, deliver is more consistent with what the option says
@@ -105,13 +105,17 @@ module Deliver
105
105
  UI.message("Found live version")
106
106
  end
107
107
  else
108
- version = app.get_edit_app_store_version(platform: platform)
108
+ version = fetch_edit_app_store_version(app, platform)
109
109
  localised_options = (LOCALISED_VERSION_VALUES.keys + LOCALISED_APP_VALUES.keys)
110
110
  non_localised_options = NON_LOCALISED_VERSION_VALUES.keys
111
111
  end
112
112
 
113
113
  # Needed for to filter out release notes from being sent up
114
- number_of_versions = app.get_app_store_versions(filter: { platform: platform }, limit: 2).size
114
+ number_of_versions = Spaceship::ConnectAPI.get_app_store_versions(
115
+ app_id: app.id,
116
+ filter: { platform: platform },
117
+ limit: 2
118
+ ).count
115
119
  is_first_version = number_of_versions == 1
116
120
  UI.verbose("Version '#{version.version_string}' is the first version on App Store Connect") if is_first_version
117
121
 
@@ -202,7 +206,7 @@ module Deliver
202
206
  end
203
207
 
204
208
  # Update categories
205
- app_info = app.fetch_edit_app_info
209
+ app_info = fetch_edit_app_info(app)
206
210
  if app_info
207
211
  category_id_map = {}
208
212
 
@@ -410,9 +414,35 @@ module Deliver
410
414
  .uniq
411
415
  end
412
416
 
417
+ def fetch_edit_app_store_version(app, platform, wait_time: 10)
418
+ retry_if_nil("Cannot find edit app store version", wait_time: wait_time) do
419
+ app.get_edit_app_store_version(platform: platform)
420
+ end
421
+ end
422
+
423
+ def fetch_edit_app_info(app, wait_time: 10)
424
+ retry_if_nil("Cannot find edit app info", wait_time: wait_time) do
425
+ app.fetch_edit_app_info
426
+ end
427
+ end
428
+
429
+ def retry_if_nil(message, tries: 5, wait_time: 10)
430
+ loop do
431
+ tries -= 1
432
+
433
+ value = yield
434
+ return value if value
435
+
436
+ UI.message("#{message}... Retrying after #{wait_time} seconds (remaining: #{tries})")
437
+ sleep(wait_time)
438
+
439
+ return nil if tries.zero?
440
+ end
441
+ end
442
+
413
443
  # Finding languages to enable
414
444
  def verify_available_info_languages!(options, app, languages)
415
- app_info = app.fetch_edit_app_info
445
+ app_info = fetch_edit_app_info(app)
416
446
 
417
447
  unless app_info
418
448
  UI.user_error!("Cannot update languages - could not find an editable info")
@@ -447,7 +477,7 @@ module Deliver
447
477
  # Finding languages to enable
448
478
  def verify_available_version_languages!(options, app, languages)
449
479
  platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
450
- version = app.get_edit_app_store_version(platform: platform)
480
+ version = fetch_edit_app_store_version(app, platform)
451
481
 
452
482
  unless version
453
483
  UI.user_error!("Cannot update languages - could not find an editable version for '#{platform}'")
@@ -554,6 +584,7 @@ module Deliver
554
584
  def set_review_information(version, options)
555
585
  return unless options[:app_review_information]
556
586
  info = options[:app_review_information]
587
+ info = info.collect { |k, v| [k.to_sym, v] }.to_h
557
588
  UI.user_error!("`app_review_information` must be a hash", show_github_issues: true) unless info.kind_of?(Hash)
558
589
 
559
590
  attributes = {}
@@ -14,9 +14,14 @@ module Deliver
14
14
  attributes = {}
15
15
  territory_ids = []
16
16
 
17
- app_prices = app.fetch_app_prices
17
+ # As of 2020-09-14:
18
+ # Official App Store Connect does not have an endpoint to get app prices for an app
19
+ # Need to get prices from the app's relationships
20
+ # Prices from app's relationship doess not have price tier so need to fetch app price with price tier relationship
21
+ app_prices = app.prices
18
22
  if app_prices.first
19
- old_price = app_prices.first.price_tier.id
23
+ app_price = Spaceship::ConnectAPI.get_app_price(app_price_id: app_prices.first.id, includes: "priceTier").first
24
+ old_price = app_price.price_tier.id
20
25
  else
21
26
  UI.message("App has no prices yet... Enabling all countries in App Store Connect")
22
27
  territory_ids = Spaceship::ConnectAPI::Territory.all.map(&:id)
@@ -126,10 +126,16 @@ module Deliver
126
126
  end
127
127
  end
128
128
 
129
- number_of_screenshots = 0
129
+ # Each app_screenshot_set can have only 10 images
130
+ number_of_screenshots_per_set = {}
131
+ total_number_of_screenshots = 0
132
+
130
133
  iterator = AppScreenshotIterator.new(localizations)
131
- iterator.each_local_screenshot(screenshots_per_language) do |localization, app_screenshot_set, screenshot, index|
132
- if index >= 10
134
+ iterator.each_local_screenshot(screenshots_per_language) do |localization, app_screenshot_set, screenshot|
135
+ # Initialize counter on each app screenshot set
136
+ number_of_screenshots_per_set[app_screenshot_set] ||= (app_screenshot_set.app_screenshots || []).count
137
+
138
+ if number_of_screenshots_per_set[app_screenshot_set] >= 10
133
139
  UI.error("Too many screenshots found for device '#{screenshot.device_type}' in '#{screenshot.language}', skipping this one (#{screenshot.path})")
134
140
  next
135
141
  end
@@ -141,10 +147,12 @@ module Deliver
141
147
  if duplicate
142
148
  UI.message("Previous uploaded. Skipping '#{screenshot.path}'...")
143
149
  else
150
+ UI.verbose("Queued uplaod sceeenshot job for #{localization.locale} #{app_screenshot_set.screenshot_display_type} #{screenshot.path}")
144
151
  worker.enqueue(UploadScreenshotJob.new(app_screenshot_set, screenshot.path))
152
+ number_of_screenshots_per_set[app_screenshot_set] += 1
145
153
  end
146
154
 
147
- number_of_screenshots += 1
155
+ total_number_of_screenshots += 1
148
156
  end
149
157
 
150
158
  worker.start
@@ -154,7 +162,7 @@ module Deliver
154
162
  Helper.show_loading_indicator("Waiting for all the screenshots processed...")
155
163
  states = wait_for_complete(iterator)
156
164
  Helper.hide_loading_indicator
157
- retry_upload_screenshots_if_needed(iterator, states, number_of_screenshots, tries, localizations, screenshots_per_language)
165
+ retry_upload_screenshots_if_needed(iterator, states, total_number_of_screenshots, tries, localizations, screenshots_per_language)
158
166
 
159
167
  UI.message("Successfully uploaded all screenshots")
160
168
  end
@@ -203,12 +211,21 @@ module Deliver
203
211
  # Check if local screenshots' checksum exist on App Store Connect
204
212
  checksum_to_app_screenshot = iterator.each_app_screenshot.map { |_, _, app_screenshot| [app_screenshot.source_file_checksum, app_screenshot] }.to_h
205
213
 
206
- missing_local_screenshots = iterator.each_local_screenshot(screenshots_per_language).select do |_, _, local_screenshot, index|
214
+ number_of_screenshots_per_set = {}
215
+ missing_local_screenshots = iterator.each_local_screenshot(screenshots_per_language).select do |_, app_screenshot_set, local_screenshot|
216
+ number_of_screenshots_per_set[app_screenshot_set] ||= (app_screenshot_set.app_screenshots || []).count
207
217
  checksum = UploadScreenshots.calculate_checksum(local_screenshot.path)
208
- checksum_to_app_screenshot[checksum].nil? && index < 10 # if index is more than 10, it's skipped
218
+
219
+ if checksum_to_app_screenshot[checksum]
220
+ next(false)
221
+ else
222
+ is_missing = number_of_screenshots_per_set[app_screenshot_set] < 10 # if it's more than 10, it's skipped
223
+ number_of_screenshots_per_set[app_screenshot_set] += 1
224
+ next(is_missing)
225
+ end
209
226
  end
210
227
 
211
- missing_local_screenshots.each do |_, _, screenshot, _|
228
+ missing_local_screenshots.each do |_, _, screenshot|
212
229
  UI.error("#{screenshot.path} is missing on App Store Connect.")
213
230
  end
214
231
 
@@ -4,6 +4,25 @@ module Fastlane
4
4
  LANE_NAME = :LANE_NAME
5
5
  PLATFORM_NAME = :PLATFORM_NAME
6
6
  ENVIRONMENT = :ENVIRONMENT
7
+
8
+ # A slighly decorated hash that will store and fetch sensitive data
9
+ # but not display it while iterating keys and values
10
+ class LaneContextValues < Hash
11
+ def initialize
12
+ @sensitive_context = {}
13
+ end
14
+
15
+ def set_sensitive(key, value)
16
+ @sensitive_context[key] = value
17
+ end
18
+
19
+ def [](key)
20
+ if @sensitive_context.key?(key)
21
+ return @sensitive_context[key]
22
+ end
23
+ super
24
+ end
25
+ end
7
26
  end
8
27
 
9
28
  def self.reset_aliases
@@ -27,7 +46,7 @@ module Fastlane
27
46
 
28
47
  # The shared hash can be accessed by any action and contains information like the screenshots path or beta URL
29
48
  def self.lane_context
30
- @lane_context ||= {}
49
+ @lane_context ||= SharedValues::LaneContextValues.new
31
50
  end
32
51
 
33
52
  # Used in tests to get a clear lane before every test
@@ -17,6 +17,10 @@ module Fastlane
17
17
  UI.user_error!(":key_content or :key_filepath is required")
18
18
  end
19
19
 
20
+ # New lines don't get read properly when coming from an ENV
21
+ # Replacing them literal version with a new line
22
+ key_content = key_content.gsub('\n', "\n") if key_content
23
+
20
24
  # This hash matches the named arguments on
21
25
  # the Spaceship::ConnectAPI::Token.create method
22
26
  key = {
@@ -27,7 +31,7 @@ module Fastlane
27
31
  in_house: in_house
28
32
  }
29
33
 
30
- Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY] = key
34
+ Actions.lane_context.set_sensitive(SharedValues::APP_STORE_CONNECT_API_KEY, key)
31
35
 
32
36
  return key
33
37
  end
@@ -55,6 +59,7 @@ module Fastlane
55
59
  FastlaneCore::ConfigItem.new(key: :key_content,
56
60
  env_name: "APP_STORE_CONNECT_API_KEY_KEY",
57
61
  description: "The content of the key p8 file",
62
+ sensitive: true,
58
63
  optional: true,
59
64
  conflicting_options: [:filepath]),
60
65
  FastlaneCore::ConfigItem.new(key: :duration,
@@ -23,6 +23,7 @@ module Fastlane
23
23
 
24
24
  Actions.lane_context[Actions::SharedValues::SIGH_PROFILE_PATHS] = nil
25
25
  Actions.lane_context[Actions::SharedValues::DSYM_PATHS] = nil
26
+ Actions.lane_context[Actions::SharedValues::DSYM_LATEST_UPLOADED_DATE] = nil
26
27
 
27
28
  UI.success('Cleaned up build artifacts 🐙')
28
29
  end
@@ -198,7 +198,7 @@ class JUnit4StyleTests {
198
198
 
199
199
  ```
200
200
 
201
- There is an [example project](https://github.com/fastlane/fastlane/tree/master/screengrab/example/src/androidTest/java/tools/fastlane/localetester) showing how to use use JUnit 3 or 4 and Espresso with the screengrab Java library to capture screenshots during a UI test run.
201
+ There is an [example project](https://github.com/fastlane/fastlane/tree/master/screengrab/example/src/androidTest/java/tools/fastlane/localetester) showing how to use JUnit 3 or 4 and Espresso with the screengrab Java library to capture screenshots during a UI test run.
202
202
 
203
203
  Using JUnit 4 is preferable because of its ability to perform actions before and after the entire test class is run. This means you will change the device's locale far fewer times when compared with JUnit 3 running those commands before and after each test method.
204
204
 
@@ -251,7 +251,7 @@ new CleanStatusBar()
251
251
  <details>
252
252
  <summary>Launch Arguments</summary>
253
253
 
254
- You can provide additional arguments to your testcases on launch. These strings will be available in your tests through `InstrumentationRegistry.getArguments()`.
254
+ You can provide additional arguments to your test cases on launch. These strings will be available in your tests through `InstrumentationRegistry.getArguments()`.
255
255
 
256
256
  ```ruby
257
257
  screengrab(
@@ -251,7 +251,7 @@ to update your `SnapshotHelper.swift` files. In case you modified your `Snapshot
251
251
 
252
252
  ## Launch Arguments
253
253
 
254
- You can provide additional arguments to your app on launch. These strings will be available in your app (eg. not in the testing target) through `ProcessInfo.processInfo.arguments`. Alternatively, use user-default syntax (`-key value`) and they will be available as key-value pairs in `UserDefaults.standard`.
254
+ You can provide additional arguments to your app on launch. These strings will be available in your app (e.g. not in the testing target) through `ProcessInfo.processInfo.arguments`. Alternatively, use user-default syntax (`-key value`) and they will be available as key-value pairs in `UserDefaults.standard`.
255
255
 
256
256
  ```ruby-skip-tests
257
257
  launch_arguments([
@@ -2,7 +2,7 @@
2
2
  <img src="/img/actions/produce.png" width="250">
3
3
  </p>
4
4
 
5
- ###### Create new iOS apps on App Store Connect and Dev Portal using your command line
5
+ ###### Create new iOS apps on App Store Connect and Apple Developer Portal using your command line
6
6
 
7
7
  _produce_ creates new iOS apps on both the Apple Developer Portal and App Store Connect with the minimum required information.
8
8
 
@@ -133,7 +133,7 @@ The general parameters are defined in the `default` key and can be:
133
133
  | `stack_title` | Specifies whether _frameit_ should display the keyword above the title when both keyword and title are defined. If it is false, the title and keyword will be displayed side by side when both keyword and title are defined. | `false` |
134
134
  | `title_below_image` | Specifies whether _frameit_ should place the title and optional keyword below the device frame. If it is false, it will be placed above the device frame. | `false` |
135
135
  | `show_complete_frame` | Specifies whether _frameit_ should shrink the device frame so that it is completely shown in the framed screenshot. If it is false, clipping of the device frame might occur at the bottom (when `title_below_image` is `false`) or top (when `title_below_image` is `true`) of the framed screenshot. | `false` |
136
- | `padding` | The content of the framed screenshot will be resized to match the specified `padding` around all edges. The vertical padding is also applied between the text and the top or bottom (depending on `title_below_image`) of the device frame. <p> There are 3 different options of specyfying the padding: <p> 1. Default: An integer value that defines both horizontal and vertical padding in pixels. <br> 2. A string that defines (different) padding values in pixels for horizontal and vertical padding. The syntax is `"<horizontal>x<vertical>"`, e.g. `"30x60"`. <br> 3. A string that defines (different) padding values in percentage for horizontal and vertical padding. The syntax is `"<horizontal>%x<vertical>%"`, e.g. `"5%x10%"`. <br> **Note:** The percentage is calculated from the smallest image dimension (height or width). <p> A combination of option 2 and 3 is possible, e.g. `"5%x40"`. | `50` |
136
+ | `padding` | The content of the framed screenshot will be resized to match the specified `padding` around all edges. The vertical padding is also applied between the text and the top or bottom (depending on `title_below_image`) of the device frame. <p> There are 3 different options of specifying the padding: <p> 1. Default: An integer value that defines both horizontal and vertical padding in pixels. <br> 2. A string that defines (different) padding values in pixels for horizontal and vertical padding. The syntax is `"<horizontal>x<vertical>"`, e.g. `"30x60"`. <br> 3. A string that defines (different) padding values in percentage for horizontal and vertical padding. The syntax is `"<horizontal>%x<vertical>%"`, e.g. `"5%x10%"`. <br> **Note:** The percentage is calculated from the smallest image dimension (height or width). <p> A combination of option 2 and 3 is possible, e.g. `"5%x40"`. | `50` |
137
137
  | `interline_spacing` | Specifies whether _frameit_ should add or subtract this many pixels between the individual lines of text. This only applies to a multi-line `title` and/or `keyword` to expand or squash together the individual lines of text. | `0` |
138
138
  | `font_scale_factor` | Specifies whether _frameit_ should increase or decrease the font size of the text. Is ignored for `keyword` or `title`, if `font_size` is specified. | `0.1` |
139
139
  | `frame` | Overrides the color of the frame to be used. (Valid values are `BLACK`, `WHITE`, `GOLD` and `ROSE_GOLD`) | NA |
@@ -161,9 +161,10 @@ The `keyword` and `title` parameters are both used in `default` and `data`. They
161
161
 
162
162
  | Key | Description | Default value |
163
163
  |-----|-------------|---------------|
164
- | `color` | The font color for the text. Specify a hex/html color code. | `#000000` (black) |
164
+ | `color` | The font color for the text. Specify a HEX/HTML color code. | `#000000` (black) |
165
165
  | `font` | The font family for the text. Specify the (relative) path to the font file (e.g. an OpenType Font). | The default `imagemagick` font, which is system dependent. |
166
166
  | `font_size` | The font size for the text specified in points. If not specified or `0`, font will be scaled automatically to fit the available space. _frameit_ still shrinks the text, if it would not fit. | NA |
167
+ | `font_weight` | The [font weight for the text](https://imagemagick.org/script/command-line-options.php#weight). Specify an integer value (e.g. 900). | NA |
167
168
  | `text` | The text that should be used for the `keyword` or `title`. <p> Note: If you want to use localised text, use [`.strings` files](#strings-files). | NA |
168
169
 
169
170
  ### Example
@@ -81,7 +81,7 @@ _scan_ uses the latest APIs and tools to make running tests plain simple and off
81
81
  👱 | Automatically switches to the [travis formatter](https://github.com/kattrali/xcpretty-travis-formatter) when running on Travis
82
82
  📖 | Helps you resolve common test errors like simulator not responding
83
83
 
84
- _scan_ uses a plain `xcodebuild` command, therefore keeping 100% compatible with `xcodebuild`. To generate the nice output, _scan_ uses [xcpretty](https://github.com/supermarin/xcpretty). You can alway access the raw output in `~/Library/Logs/scan`.
84
+ _scan_ uses a plain `xcodebuild` command, therefore keeping 100% compatible with `xcodebuild`. To generate the nice output, _scan_ uses [xcpretty](https://github.com/supermarin/xcpretty). You can always access the raw output in `~/Library/Logs/scan`.
85
85
 
86
86
  ![img/actions/scanScreenshot.png](/img/actions/scanScreenshot.png)
87
87
  ![img/actions/slack.png](/img/actions/slack.png)
@@ -100,7 +100,7 @@ That's all you need to run your tests. If you want more control, here are some a
100
100
  fastlane scan --workspace "Example.xcworkspace" --scheme "AppName" --device "iPhone 6" --clean
101
101
  ```
102
102
 
103
- If you need to use a different xcode install, use `xcode-select` or define `DEVELOPER_DIR`:
103
+ If you need to use a different Xcode install, use `xcode-select` or define `DEVELOPER_DIR`:
104
104
 
105
105
  ```no-highlight
106
106
  DEVELOPER_DIR="/Applications/Xcode6.2.app" scan