[KT-54442] Fix default test device Apple OS family parser.
This commit is contained in:
committed by
Space Team
parent
7f40a9394b
commit
0127c3a6c4
+9
-7
@@ -38,12 +38,17 @@ class XcodeUtils private constructor() {
|
|||||||
|
|
||||||
val out = runCommand(listOf("/usr/bin/xcrun", "simctl", "list", "devices", "available"))
|
val out = runCommand(listOf("/usr/bin/xcrun", "simctl", "list", "devices", "available"))
|
||||||
|
|
||||||
val result = mutableMapOf<String, String>()
|
val result = mutableMapOf<Family, String>()
|
||||||
var os: String? = null
|
var os: Family? = null
|
||||||
out.lines().forEach { s ->
|
out.lines().forEach { s ->
|
||||||
val osFound = osRegex.find(s)?.value
|
val osFound = osRegex.find(s)?.value
|
||||||
if (osFound != null) {
|
if (osFound != null) {
|
||||||
os = osFound.split(" ")[1]
|
val osName = osFound.split(" ")[1]
|
||||||
|
os = try {
|
||||||
|
Family.valueOf(osName.toUpperCaseAsciiOnly())
|
||||||
|
} catch (e: Exception) {
|
||||||
|
null
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
val currentOs = os
|
val currentOs = os
|
||||||
if (currentOs != null) {
|
if (currentOs != null) {
|
||||||
@@ -55,10 +60,7 @@ class XcodeUtils private constructor() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
result
|
||||||
result.entries.associate { (osName, deviceId) ->
|
|
||||||
Family.valueOf(osName.toUpperCaseAsciiOnly()) to deviceId
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getDefaultTestDeviceId(target: KonanTarget): String? = defaultTestDevices[target.family]
|
fun getDefaultTestDeviceId(target: KonanTarget): String? = defaultTestDevices[target.family]
|
||||||
|
|||||||
Reference in New Issue
Block a user