fastlane-plugin-create_simulator_devices 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4503cde1b1fa249acb89e95512569c44328ddf78b4351553c7f19adfbc87c340
4
- data.tar.gz: 101c638d175f6c745476f8e352be9e85c3159037e87b427fcdb75dd3036d9a5c
3
+ metadata.gz: 53aed494d69e050f8014a9b188cf5dd2fb3475c5d8e44b7d22e21eb8949d66aa
4
+ data.tar.gz: 315fe5620703cde142b5ae0aff18cc90989398e96e2587dab89f1030bcf0ece1
5
5
  SHA512:
6
- metadata.gz: daba564bbe2ca199f503b4219b1049999a687b6294c669176e2554fa78757cd41387f99d2d379c30c831a6111f6fbd49725b3485c10d91a380e4934d04d39f42
7
- data.tar.gz: 0f9c5aa1a972feb31812672cdcae916385f9e8ec9c9d17dc8b2c683db2fb5880a3e8061ef16b0f337848f55a7dee85674bd0aad2d0bff9bc764a431dec177f19
6
+ metadata.gz: 68539faced67b76306b818ccb1cc3172c00245e903e234085852c22db09c683907bc94f024238c73a31c1edd869d481df7b6a174a2cf996817fa4acc598b9010
7
+ data.tar.gz: ba14fdf8693f60557079f96eead7e46cf5730f6e0cc86f7d72477185b0acbd4367851562789b0d095336104d4bc3b1dee2547fb9863cbcac041b2d650ec277e7
@@ -18,6 +18,10 @@ module Fastlane
18
18
  available
19
19
  end
20
20
 
21
+ def description
22
+ "#{name} (#{device_type_identifier}, #{udid})"
23
+ end
24
+
21
25
  def self.from_hash(hash)
22
26
  new(
23
27
  name: hash[:name],
@@ -38,7 +38,15 @@ module Fastlane
38
38
  # Return distinct matched devices strings
39
39
  matched_devices = required_devices
40
40
  .reject { |required_device| required_device.available_device.nil? }
41
- .map(&:description)
41
+
42
+ if verbose
43
+ UI.message('Matched devices:')
44
+ matched_devices.each do |matched_device|
45
+ UI.message("\n\t#{matched_device.description}: #{matched_device.available_device.description}")
46
+ end
47
+ end
48
+
49
+ matched_devices.map!(&:description)
42
50
 
43
51
  UI.user_error!('No available devices found') if matched_devices.empty?
44
52
 
@@ -58,6 +66,8 @@ module Fastlane
58
66
 
59
67
  available_devices = shell_helper.available_devices_for_runtimes[required_device.available_runtime.identifier.to_sym]
60
68
 
69
+ return [] if available_devices.nil?
70
+
61
71
  available_devices.detect { |device| device.device_type_identifier == required_device.device_type.identifier }
62
72
  end
63
73
 
@@ -35,6 +35,7 @@ module Fastlane
35
35
  end
36
36
 
37
37
  shell_helper.available_runtimes(force: true)
38
+ shell_helper.available_devices_for_runtimes(force: true)
38
39
  end
39
40
 
40
41
  def install_missing_runtimes(required_devices)
@@ -51,6 +52,7 @@ module Fastlane
51
52
  # Update available_runtimes after installing the runtimes.
52
53
  shell_helper.installed_runtimes_with_state
53
54
  shell_helper.available_runtimes(force: true)
55
+ shell_helper.available_devices_for_runtimes(force: true)
54
56
 
55
57
  # Check if missing runtimes are available after installing
56
58
  missing_runtimes = missing_runtimes(missing_runtimes)
@@ -143,7 +145,7 @@ module Fastlane
143
145
  def cached_runtime_file(missing_runtime)
144
146
  FileUtils.mkdir_p(cache_dir)
145
147
 
146
- runtime_dmg_search_pattern = "#{cache_dir}/#{missing_runtime.sdk_platform}_#{missing_runtime.product_version}_"
148
+ runtime_dmg_search_pattern = "#{cache_dir}/#{missing_runtime.sdk_platform}_#{missing_runtime.product_version}*_"
147
149
 
148
150
  # Remove the last character of the build version if it is the latest beta.
149
151
  # Apple can create a new Runtime version and block product build version
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Fastlane
4
4
  module CreateSimulatorDevices
5
- VERSION = '0.0.2'
5
+ VERSION = '0.0.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-create_simulator_devices
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitalii Budnik