fastlane-plugin-create_simulator_devices 0.0.4 → 0.0.5
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 +4 -4
- data/lib/fastlane/plugin/create_simulator_devices/helpers/create_simulator_devices/models/apple_build_version.rb +6 -1
- data/lib/fastlane/plugin/create_simulator_devices/helpers/create_simulator_devices/runner.rb +8 -3
- data/lib/fastlane/plugin/create_simulator_devices/helpers/create_simulator_devices/runtime_helper.rb +25 -14
- data/lib/fastlane/plugin/create_simulator_devices/helpers/create_simulator_devices/shell_helper.rb +2 -15
- data/lib/fastlane/plugin/create_simulator_devices/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fc01352add3412905b44f8168d0ce72b330e44ade2e34ff1040976d56ca3ee9
|
4
|
+
data.tar.gz: 9195a8c5a3edcd6391b38b16407ad0e41d8a9e6b4ed05b20da069f6e55944e05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc7bcbf613ac9e4839cf14993a53b9606d50ff39d6f9656bb03a3230814ecb78350d16655179e9836ca8fdf0ba1069212130b3f087589d19c1a93f850958607a
|
7
|
+
data.tar.gz: 98860ea4b0a943ae9a734503c694181e04656e4b20bed4eb6c3ecde2144e63a90e1c5fd3389c960c912d8e46c996c86ef3d55d110374d027d6805cd31d3b1fe2
|
@@ -58,7 +58,12 @@ module Fastlane
|
|
58
58
|
|
59
59
|
return self == other unless lhs_is_beta && rhs_is_beta && lhs_build_version.length == rhs_build_version.length
|
60
60
|
|
61
|
-
|
61
|
+
# 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
|
63
|
+
end
|
64
|
+
|
65
|
+
def minor_version
|
66
|
+
AppleBuildVersion.new(@build_version.match(/^[0-9]+[A-Z]+/)[0])
|
62
67
|
end
|
63
68
|
|
64
69
|
def <(other)
|
data/lib/fastlane/plugin/create_simulator_devices/helpers/create_simulator_devices/runner.rb
CHANGED
@@ -42,7 +42,7 @@ module Fastlane
|
|
42
42
|
if verbose
|
43
43
|
UI.message('Matched devices:')
|
44
44
|
matched_devices.each do |matched_device|
|
45
|
-
UI.message("\
|
45
|
+
UI.message("\t#{matched_device.description}: #{matched_device.available_device.description}")
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -68,7 +68,12 @@ module Fastlane
|
|
68
68
|
|
69
69
|
return [] if available_devices.nil?
|
70
70
|
|
71
|
-
|
71
|
+
# Find the device with the same name as the required device.
|
72
|
+
devices_with_same_type = available_devices
|
73
|
+
.select { |available_device| available_device.device_type_identifier == required_device.device_type.identifier }
|
74
|
+
|
75
|
+
devices_with_same_type
|
76
|
+
.detect { |available_device| available_device.name == required_device.device_type.name }
|
72
77
|
end
|
73
78
|
|
74
79
|
def create_missing_devices(required_devices)
|
@@ -82,7 +87,7 @@ module Fastlane
|
|
82
87
|
UI.message('Creating missing devices')
|
83
88
|
missing_devices.each do |missing_device|
|
84
89
|
shell_helper.create_device(
|
85
|
-
missing_device.
|
90
|
+
missing_device.device_type.name,
|
86
91
|
missing_device.device_type.identifier,
|
87
92
|
missing_device.available_runtime.identifier
|
88
93
|
)
|
data/lib/fastlane/plugin/create_simulator_devices/helpers/create_simulator_devices/runtime_helper.rb
CHANGED
@@ -74,8 +74,24 @@ module Fastlane
|
|
74
74
|
def available_runtime_matching_needed_runtime?(needed_runtime)
|
75
75
|
matching_runtimes = shell_helper.available_runtimes
|
76
76
|
.select do |available_runtime|
|
77
|
-
next false if needed_runtime.os_name != available_runtime.platform
|
78
|
-
|
77
|
+
next false if needed_runtime.os_name != available_runtime.platform
|
78
|
+
|
79
|
+
# If the product version is not equal, check if the first two segments are equal.
|
80
|
+
is_product_version_equal = if needed_runtime.product_version == available_runtime.version
|
81
|
+
true
|
82
|
+
else
|
83
|
+
lhs_segments = needed_runtime.product_version.segments
|
84
|
+
rhs_segments = available_runtime.version.segments
|
85
|
+
if rhs_segments.size == 3
|
86
|
+
lhs_segments[0] == rhs_segments[0] && lhs_segments[1] == rhs_segments[1]
|
87
|
+
else
|
88
|
+
false
|
89
|
+
end
|
90
|
+
end
|
91
|
+
next false unless is_product_version_equal
|
92
|
+
|
93
|
+
# If the product version is not equal, use the available runtime version.
|
94
|
+
needed_runtime.product_version = available_runtime.version
|
79
95
|
|
80
96
|
needed_runtime.product_build_version = [needed_runtime.product_build_version, available_runtime.build_version].compact.max
|
81
97
|
|
@@ -108,17 +124,6 @@ module Fastlane
|
|
108
124
|
available_runtime
|
109
125
|
end
|
110
126
|
|
111
|
-
def install_missing_runtime(missing_runtime, cached_runtime_file)
|
112
|
-
runtime_name = missing_runtime.runtime_name
|
113
|
-
|
114
|
-
if missing_runtime.product_build_version.nil?
|
115
|
-
UI.important("Failed to find runtime build version for #{runtime_name}")
|
116
|
-
return
|
117
|
-
end
|
118
|
-
|
119
|
-
shell_helper.import_runtime(cached_runtime_file, runtime_name)
|
120
|
-
end
|
121
|
-
|
122
127
|
def download_and_install_missing_runtime(missing_runtime)
|
123
128
|
UI.message("Attempting to install #{missing_runtime.runtime_name} runtime.")
|
124
129
|
|
@@ -152,9 +157,15 @@ module Fastlane
|
|
152
157
|
# shipped with Xcode betas and use the same product version.
|
153
158
|
# E.g. Xcode 26.0 Beta 3 has iOS 26.0 (23A5287e) SDK, but
|
154
159
|
# xcodebuild downloads iphonesimulator_26.0_23A5287g.dmg as latest.
|
155
|
-
runtime_dmg_search_pattern += missing_runtime.product_build_version.to_s
|
160
|
+
runtime_dmg_search_pattern += missing_runtime.product_build_version.minor_version.to_s if missing_runtime.product_build_version
|
156
161
|
runtime_dmg_search_pattern += '*.dmg'
|
157
162
|
|
163
|
+
if verbose
|
164
|
+
UI.message("Searching for #{missing_runtime.runtime_name} runtime image in #{cache_dir} with pattern: #{runtime_dmg_search_pattern}")
|
165
|
+
UI.message("Available dmg files: #{Dir.glob("#{cache_dir}/*.dmg")}")
|
166
|
+
UI.message("Available files with pattern: #{Dir.glob(runtime_dmg_search_pattern)}")
|
167
|
+
end
|
168
|
+
|
158
169
|
runtime_file = Dir
|
159
170
|
.glob(runtime_dmg_search_pattern)
|
160
171
|
.max_by { |filename| runtime_build_version_for_filename(filename) }
|
data/lib/fastlane/plugin/create_simulator_devices/helpers/create_simulator_devices/shell_helper.rb
CHANGED
@@ -148,11 +148,8 @@ module Fastlane
|
|
148
148
|
missing_runtime.os_name.shellescape
|
149
149
|
]
|
150
150
|
|
151
|
-
|
152
|
-
|
153
|
-
# Prefer the build version if available, otherwise use the product version.
|
154
|
-
command << (missing_runtime.product_build_version || missing_runtime.product_version.to_s).shellescape
|
155
|
-
end
|
151
|
+
command << '-buildVersion'
|
152
|
+
command << missing_runtime.product_version.to_s.shellescape
|
156
153
|
|
157
154
|
sh(command: command.join(' '), print_command: true, print_command_output: true)
|
158
155
|
end
|
@@ -166,16 +163,6 @@ module Fastlane
|
|
166
163
|
UI.important("Failed to import runtime #{runtime_name} with '#{import_platform_command}' :\n#{e}")
|
167
164
|
end
|
168
165
|
end
|
169
|
-
|
170
|
-
# def add_runtime(runtime_dmg_filename, runtime_name)
|
171
|
-
# UI.message("Adding runtime #{runtime_name}...")
|
172
|
-
# add_runtime_command = "xcrun simctl runtime add #{runtime_dmg_filename.shellescape}"
|
173
|
-
# begin
|
174
|
-
# sh(command: add_runtime_command)
|
175
|
-
# rescue StandardError => e
|
176
|
-
# UI.important("Failed to add runtime #{runtime_name} with '#{add_runtime_command}':\n#{e}")
|
177
|
-
# end
|
178
|
-
# end
|
179
166
|
end
|
180
167
|
end
|
181
168
|
end
|