fastlane-plugin-create_simulator_devices 0.0.8 → 0.0.10

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: 7bdb9272237c51e5824b954d1591ab42bd0053fbbff4c361f5c06cfeb651b1b3
4
- data.tar.gz: 3456a1d7ac219530936a2018de26542107751705a559c267425f6f4b020d51ac
3
+ metadata.gz: b9a6a73e52cb63c48fac77618a91aea9c4818d2899fca14d50cff5f960d6f677
4
+ data.tar.gz: 81a019571d0c07bcb7238b5930dfffc08ea00cf34f7a1c3db93e90aa024fd072
5
5
  SHA512:
6
- metadata.gz: c360db8d2be359e49f5aca77e8f78f3324a49a7661f1c29ad5633b3d20825830d34c058df3e110a76b921ca336363c53e535ca3f292cb2b81b163100be153fda
7
- data.tar.gz: bd29fc50811bc0f8d59151a84f61e594d9b68f388f8731116e64b2d00f7ee0099ce2b317b0580f31e15c88fc96d3f96cefb0500c901b6c2344d108de7400c77d
6
+ metadata.gz: 451d3c4046b5c364bd6d9c9428bbf5072109741daea14a621a21164950d3e6339accd13d7e4b53c4d48000517a9b51ea65eab59c90ba28aa13bb2c4cc849efee
7
+ data.tar.gz: '06849f35aa5f2fa377e341a90dfeb3afe8030f79775334f1740c9d18309396d6ff37835cbbc87fdaaf6f39453c5faa3f5db4e8d579a1360a5577b2528bcfdf55'
@@ -7,10 +7,6 @@ require_relative '../helpers/create_simulator_devices/models'
7
7
 
8
8
  module Fastlane
9
9
  module Actions
10
- module SharedValues
11
- AVAILABLE_SIMULATOR_DEVICES = :AVAILABLE_SIMULATOR_DEVICES
12
- end
13
-
14
10
  CreateSimulatorDevices = ::Fastlane::CreateSimulatorDevices
15
11
 
16
12
  # Create simulator devices.
@@ -34,11 +30,7 @@ module Fastlane
34
30
  verbose: verbose
35
31
  )
36
32
 
37
- available_simulator_devices = runner.run(required_devices)
38
-
39
- Actions.lane_context[SharedValues::AVAILABLE_SIMULATOR_DEVICES] = available_simulator_devices
40
-
41
- available_simulator_devices
33
+ runner.run(required_devices)
42
34
  end
43
35
 
44
36
  #####################################################
@@ -50,16 +50,15 @@ module Fastlane
50
50
  def almost_equal?(other)
51
51
  return false if other.nil?
52
52
 
53
- lhs_build_version = @build_version
54
- rhs_build_version = other.to_s
53
+ rhs_build_version = AppleBuildVersion.new(other.to_s)
55
54
 
56
55
  lhs_is_beta = beta?
57
- rhs_is_beta = AppleBuildVersion.new(rhs_build_version).beta?
56
+ rhs_is_beta = rhs_build_version.beta?
58
57
 
59
- return self == other unless lhs_is_beta && rhs_is_beta && lhs_build_version.length == rhs_build_version.length
58
+ return self == other unless lhs_is_beta && rhs_is_beta && @build_version.length == rhs_build_version.to_s.length
60
59
 
61
60
  # Take only leading chars up to the first letter included e.g. 22C146 -> 22C
62
- lhs_build_version.minor_version == rhs_build_version.minor_version
61
+ minor_version == rhs_build_version.minor_version
63
62
  end
64
63
 
65
64
  def minor_version
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'runtime_helper'
4
+ require 'fastlane'
5
+ require_relative 'shared_values'
4
6
 
5
7
  module Fastlane
6
8
  # Create simulator devices.
@@ -48,14 +50,15 @@ module Fastlane
48
50
 
49
51
  log_matched_devices(matched_devices: matched_devices)
50
52
 
51
- matched_devices.map!(&:description)
53
+ available_simulator_devices = matched_devices.map(&:available_device)
54
+ Actions.lane_context[Actions::SharedValues::AVAILABLE_SIMULATOR_DEVICES] = available_simulator_devices
52
55
 
53
- UI.user_error!('No available devices found') if matched_devices.empty?
54
-
55
- matched_devices
56
+ available_simulator_devices.map(&:name)
56
57
  end
57
58
 
58
59
  def log_matched_devices(matched_devices:)
60
+ UI.user_error!('No available devices found') if matched_devices.empty?
61
+
59
62
  UI.message('Matched devices:')
60
63
  matched_devices.each do |matched_device|
61
64
  device_info = ''
@@ -65,6 +68,11 @@ module Fastlane
65
68
  end
66
69
  UI.message(" #{matched_device.description}: #{matched_device.available_device.description}#{device_info}")
67
70
  end
71
+
72
+ matched_devices_names = matched_devices
73
+ .map { |matched_device| matched_device.available_device.name }
74
+ .join(', ')
75
+ UI.message("Available simulator devices: #{matched_devices_names}")
68
76
  end
69
77
 
70
78
  def delete_unavailable_devices
@@ -136,14 +144,14 @@ module Fastlane
136
144
  available_device_types = shell_helper.available_device_types
137
145
 
138
146
  device_os_version = device[/ \(([\d.]*?)\)$/, 1]
139
- device_name = device.delete_suffix(" (#{device_os_version})").strip unless device_os_version.nil?
147
+ device_name = device_os_version.nil? ? device : device.delete_suffix(" (#{device_os_version})").strip
140
148
 
141
149
  device_type = available_device_types.detect do |available_device_type|
142
150
  device_name == available_device_type.name
143
151
  end
144
152
 
145
153
  unless device_type
146
- UI.important("Device type not found for device #{device}")
154
+ UI.important("Device type not found for device #{device}. Available device types: #{available_device_types.map(&:name).join(', ')}.")
147
155
  return nil
148
156
  end
149
157
 
@@ -199,7 +199,7 @@ module Fastlane
199
199
  sdk_platform: sdk.platform,
200
200
  os_name: required_device.os_name,
201
201
  product_version: runtime_version || sdk.product_version,
202
- product_build_version:,
202
+ product_build_version: product_build_version,
203
203
  is_latest: sdk.product_build_version.almost_equal?(product_build_version)
204
204
  )
205
205
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'fastlane'
4
+
5
+ module Fastlane
6
+ module Actions
7
+ module SharedValues
8
+ AVAILABLE_SIMULATOR_DEVICES = :AVAILABLE_SIMULATOR_DEVICES
9
+ end
10
+ end
11
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Fastlane
4
4
  module CreateSimulatorDevices
5
- VERSION = '0.0.8'
5
+ VERSION = '0.0.10'
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.8
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitalii Budnik
@@ -31,6 +31,7 @@ files:
31
31
  - lib/fastlane/plugin/create_simulator_devices/helpers/create_simulator_devices/models/xcodebuild/sdk.rb
32
32
  - lib/fastlane/plugin/create_simulator_devices/helpers/create_simulator_devices/runner.rb
33
33
  - lib/fastlane/plugin/create_simulator_devices/helpers/create_simulator_devices/runtime_helper.rb
34
+ - lib/fastlane/plugin/create_simulator_devices/helpers/create_simulator_devices/shared_values.rb
34
35
  - lib/fastlane/plugin/create_simulator_devices/helpers/create_simulator_devices/shell_helper.rb
35
36
  - lib/fastlane/plugin/create_simulator_devices/version.rb
36
37
  homepage: