fastlane 2.9.0 → 2.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/cert/lib/cert/options.rb +11 -1
  4. data/cert/lib/cert/runner.rb +11 -3
  5. data/credentials_manager/lib/credentials_manager/account_manager.rb +1 -1
  6. data/credentials_manager/lib/credentials_manager/appfile_config.rb +2 -2
  7. data/fastlane/README.md +1 -1
  8. data/fastlane/lib/assets/completions/completion.bash +3 -1
  9. data/fastlane/lib/assets/completions/completion.sh +4 -1
  10. data/fastlane/lib/assets/completions/completion.zsh +2 -0
  11. data/fastlane/lib/fastlane/actions/actions_helper.rb +2 -2
  12. data/fastlane/lib/fastlane/actions/clipboard.rb +1 -1
  13. data/fastlane/lib/fastlane/actions/deploygate.rb +2 -2
  14. data/fastlane/lib/fastlane/actions/ipa.rb +2 -2
  15. data/fastlane/lib/fastlane/actions/sonar.rb +10 -3
  16. data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +1 -1
  17. data/fastlane/lib/fastlane/actions/xcodebuild.rb +23 -6
  18. data/fastlane/lib/fastlane/documentation/docs_generator.rb +1 -1
  19. data/fastlane/lib/fastlane/fast_file.rb +2 -2
  20. data/fastlane/lib/fastlane/lane_manager.rb +5 -2
  21. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +2 -0
  22. data/fastlane/lib/fastlane/runner.rb +1 -1
  23. data/fastlane/lib/fastlane/version.rb +1 -1
  24. data/fastlane_core/lib/fastlane_core/cert_checker.rb +1 -1
  25. data/fastlane_core/lib/fastlane_core/configuration/configuration_file.rb +2 -2
  26. data/fastlane_core/lib/fastlane_core/print_table.rb +6 -0
  27. data/frameit/lib/frameit/strings_parser.rb +1 -1
  28. data/gym/lib/assets/wrap_xcodebuild/xcbuild-safe.sh +3 -0
  29. data/gym/lib/gym/generators/build_command_generator.rb +1 -0
  30. data/gym/lib/gym/options.rb +6 -1
  31. data/pem/README.md +1 -1
  32. data/scan/lib/scan/options.rb +14 -2
  33. data/scan/lib/scan/test_command_generator.rb +3 -2
  34. data/screengrab/lib/screengrab/options.rb +11 -1
  35. data/screengrab/lib/screengrab/runner.rb +48 -23
  36. data/sigh/lib/assets/resign.sh +75 -37
  37. data/sigh/lib/sigh/runner.rb +29 -9
  38. data/snapshot/lib/assets/SnapshotHelper.swift +4 -0
  39. data/snapshot/lib/assets/SnapshotHelper2-3.swift +4 -0
  40. data/snapshot/lib/snapshot/dependency_checker.rb +1 -1
  41. data/snapshot/lib/snapshot/options.rb +6 -0
  42. data/snapshot/lib/snapshot/runner.rb +15 -0
  43. data/spaceship/lib/spaceship/client.rb +1 -1
  44. data/spaceship/lib/spaceship/portal/certificate.rb +2 -1
  45. data/spaceship/lib/spaceship/portal/device.rb +3 -1
  46. data/spaceship/lib/spaceship/portal/portal_client.rb +2 -2
  47. data/spaceship/lib/spaceship/portal/provisioning_profile.rb +4 -2
  48. metadata +2 -2
@@ -61,7 +61,7 @@ module Sigh
61
61
  # Fetches a profile matching the user's search requirements
62
62
  def fetch_profiles
63
63
  UI.message "Fetching profiles..."
64
- results = profile_type.find_by_bundle_id(Sigh.config[:app_identifier])
64
+ results = profile_type.find_by_bundle_id(Sigh.config[:app_identifier], mac: Sigh.config[:platform].to_s == 'macos')
65
65
  results = results.find_all do |current_profile|
66
66
  if current_profile.valid? || Sigh.config[:force]
67
67
  true
@@ -136,15 +136,35 @@ module Sigh
136
136
  profile
137
137
  end
138
138
 
139
+ def certificates_for_profile_and_platform
140
+ case Sigh.config[:platform].to_s
141
+ when 'ios'
142
+ if profile_type == Spaceship.provisioning_profile.Development
143
+ certificates = Spaceship.certificate.development.all
144
+ elsif profile_type == Spaceship.provisioning_profile.InHouse
145
+ certificates = Spaceship.certificate.in_house.all
146
+ else
147
+ certificates = Spaceship.certificate.production.all # Ad hoc or App Store
148
+ end
149
+
150
+ when 'macos'
151
+ if profile_type == Spaceship.provisioning_profile.Development
152
+ certificates = Spaceship.certificate.mac_development.all
153
+ elsif profile_type == Spaceship.provisioning_profile.AppStore
154
+ certificates = Spaceship.certificate.mac_app_distribution.all
155
+ elsif profile_type == Spaceship.provisioning_profile.Direct
156
+ certificates = Spaceship.certificate.developer_id_application.all
157
+ else
158
+ certificates = Spaceship.certificate.mac_app_distribution.all
159
+ end
160
+ end
161
+
162
+ certificates
163
+ end
164
+
139
165
  # Certificate to use based on the current distribution mode
140
166
  def certificate_to_use
141
- if profile_type == Spaceship.provisioning_profile.Development
142
- certificates = Spaceship.certificate.development.all
143
- elsif profile_type == Spaceship.provisioning_profile.InHouse
144
- certificates = Spaceship.certificate.in_house.all
145
- else
146
- certificates = Spaceship.certificate.production.all # Ad hoc or App Store
147
- end
167
+ certificates = certificates_for_profile_and_platform
148
168
 
149
169
  # Filter them
150
170
  certificates = certificates.find_all do |c|
@@ -211,7 +231,7 @@ module Sigh
211
231
 
212
232
  # Makes sure the current App ID exists. If not, it will show an appropriate error message
213
233
  def ensure_app_exists!
214
- return if Spaceship::App.find(Sigh.config[:app_identifier])
234
+ return if Spaceship::App.find(Sigh.config[:app_identifier], mac: Sigh.config[:platform].to_s == 'macos')
215
235
  print_produce_command(Sigh.config)
216
236
  UI.user_error!("Could not find App with App Identifier '#{Sigh.config[:app_identifier]}'")
217
237
  end
@@ -129,6 +129,10 @@ open class Snapshot: NSObject {
129
129
 
130
130
  extension XCUIElement {
131
131
  var isLoadingIndicator: Bool {
132
+ let whiteListedLoaders = ["GeofenceLocationTrackingOn", "StandardLocationTrackingOn"]
133
+ if whiteListedLoaders.contains(self.identifier) {
134
+ return false
135
+ }
132
136
  return self.frame.size == CGSize(width: 10, height: 20)
133
137
  }
134
138
  }
@@ -131,6 +131,10 @@ public class Snapshot: NSObject {
131
131
 
132
132
  extension XCUIElement {
133
133
  var isLoadingIndicator: Bool {
134
+ let whiteListedLoaders = ["GeofenceLocationTrackingOn", "StandardLocationTrackingOn"]
135
+ if whiteListedLoaders.contains(self.identifier) {
136
+ return false
137
+ }
134
138
  return self.frame.size == CGSize(width: 10, height: 20)
135
139
  }
136
140
  }
@@ -43,7 +43,7 @@ module Snapshot
43
43
 
44
44
  def self.check_simctl
45
45
  unless `xcrun simctl`.include? "openurl"
46
- UI.user_error!("Could not find `xcrun simctl`. Make sure you have the latest version of Xcode and Mac OS installed.")
46
+ UI.user_error!("Could not find `xcrun simctl`. Make sure you have the latest version of Xcode and macOS installed.")
47
47
  end
48
48
  end
49
49
  end
@@ -63,6 +63,12 @@ module Snapshot
63
63
  env_name: "SNAPSHOT_OUTPUT_DIRECTORY",
64
64
  description: "The directory where to store the screenshots",
65
65
  default_value: output_directory),
66
+ FastlaneCore::ConfigItem.new(key: :output_simulator_logs,
67
+ env_name: "SNAPSHOT_OUTPUT_SIMULATOR_LOGS",
68
+ description: "If the logs generated by the app (e.g. using NSLog, perror, etc.) in the Simulator should be written to the output_directory",
69
+ type: TrueClass,
70
+ default_value: false,
71
+ optional: true),
66
72
  FastlaneCore::ConfigItem.new(key: :ios_version,
67
73
  description: "By default, the latest version should be used automatically. If you want to change it, do it here",
68
74
  short_option: "-i",
@@ -62,6 +62,10 @@ module Snapshot
62
62
  # Generate HTML report
63
63
  ReportsGenerator.new.generate
64
64
 
65
+ if Snapshot.config[:output_simulator_logs]
66
+ output_simulator_logs
67
+ end
68
+
65
69
  # Clear the Derived Data
66
70
  unless Snapshot.config[:derived_data_path]
67
71
  FileUtils.rm_rf(TestCommandGenerator.derived_data_path)
@@ -96,6 +100,17 @@ module Snapshot
96
100
  end
97
101
  end
98
102
 
103
+ def output_simulator_logs
104
+ Snapshot.config[:devices].each do |device_name|
105
+ device = TestCommandGenerator.find_device(device_name)
106
+ sim_device_logfilepath_source = File.expand_path("~/Library/Logs/CoreSimulator/#{device.udid}/system.log")
107
+ next unless File.exist?(sim_device_logfilepath_source)
108
+
109
+ sim_device_logfilepath_dest = File.join(Snapshot.config[:output_directory], "#{device.name}_#{device.os_type}_#{device.os_version}_system.log")
110
+ FileUtils.cp(sim_device_logfilepath_source, sim_device_logfilepath_dest)
111
+ end
112
+ end
113
+
99
114
  def print_results(results)
100
115
  return if results.count == 0
101
116
 
@@ -368,7 +368,7 @@ module Spaceship
368
368
 
369
369
  def with_retry(tries = 5, &_block)
370
370
  return yield
371
- rescue Faraday::Error::ConnectionFailed, Faraday::Error::TimeoutError, AppleTimeoutError, Errno::EPIPE => ex # New Faraday version: Faraday::TimeoutError => ex
371
+ rescue Faraday::Error::ConnectionFailed, Faraday::Error::TimeoutError, AppleTimeoutError => ex # New Faraday version: Faraday::TimeoutError => ex
372
372
  tries -= 1
373
373
  unless tries.zero?
374
374
  logger.warn("Timeout received: '#{ex.message}'. Retrying after 3 seconds (remaining: #{tries})...")
@@ -283,6 +283,7 @@ module Spaceship
283
283
  # @return (Certificate): The newly created certificate
284
284
  def create!(csr: nil, bundle_id: nil)
285
285
  type = CERTIFICATE_TYPE_IDS.key(self)
286
+ mac = MAC_CERTIFICATE_TYPE_IDS.include? type
286
287
 
287
288
  # look up the app_id by the bundle_id
288
289
  if bundle_id
@@ -295,7 +296,7 @@ module Spaceship
295
296
  csr = OpenSSL::X509::Request.new(csr) if csr.kind_of?(String)
296
297
 
297
298
  # if this succeeds, we need to save the .cer and the private key in keychain access or wherever they go in linux
298
- response = client.create_certificate!(type, csr.to_pem, app_id)
299
+ response = client.create_certificate!(type, csr.to_pem, app_id, mac)
299
300
  # munge the response to make it work for the factory
300
301
  response['certificateTypeDisplayId'] = response['certificateType']['certificateTypeDisplayId']
301
302
  self.new(response)
@@ -100,10 +100,12 @@ module Spaceship
100
100
  all.select { |device| device.device_type != "tvOS" }
101
101
  end
102
102
 
103
- # @return (Array) Returns all devices that can be used for iOS profiles (all devices except TVs)
103
+ # @return (Array) Returns all devices matching the provided profile_type
104
104
  def all_for_profile_type(profile_type)
105
105
  if profile_type.include? "tvOS"
106
106
  Spaceship::Device.all_apple_tvs
107
+ elsif profile_type.include? "Mac"
108
+ Spaceship::Device.all_macs
107
109
  else
108
110
  Spaceship::Device.all_ios_profile_devices
109
111
  end
@@ -315,10 +315,10 @@ module Spaceship
315
315
  end
316
316
  end
317
317
 
318
- def create_certificate!(type, csr, app_id = nil)
318
+ def create_certificate!(type, csr, app_id = nil, mac = false)
319
319
  ensure_csrf(Spaceship::Certificate)
320
320
 
321
- r = request(:post, 'account/ios/certificate/submitCertificateRequest.action', {
321
+ r = request(:post, "account/#{platform_slug(mac)}/certificate/submitCertificateRequest.action", {
322
322
  teamId: team_id,
323
323
  type: type,
324
324
  csrContent: csr,
@@ -249,13 +249,15 @@ module Spaceship
249
249
  # @return (Array) Returns all profiles registered for this account
250
250
  # If you're calling this from a subclass (like AdHoc), this will
251
251
  # only return the profiles that are of this type
252
- def all(mac: false)
252
+ # @param mac (Bool) (optional): Pass true to get all Mac provisioning profiles
253
+ # @param xcode (Bool) (optional): Pass true to include Xcode managed provisioning profiles
254
+ def all(mac: false, xcode: false)
253
255
  profiles = client.provisioning_profiles(mac: mac).map do |profile|
254
256
  self.factory(profile)
255
257
  end
256
258
 
257
259
  # filter out the profiles managed by xcode
258
- profiles.delete_if(&:managed_by_xcode?)
260
+ profiles.delete_if(&:managed_by_xcode?) unless xcode
259
261
 
260
262
  return profiles if self == ProvisioningProfile
261
263
 
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.9.0
4
+ version: 2.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2017-01-17 00:00:00.000000000 Z
17
+ date: 2017-01-23 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: slack-notifier