Update logic for parsing sdk version number (#15918)

* add logic to parse 11.3 sim runtime major version

* add null aware and bump group number

* add comment describing version
This commit is contained in:
Jonah Williams
2018-04-01 17:35:05 -07:00
committed by GitHub
parent 68db514ec0
commit 0c89920069
2 changed files with 17 additions and 2 deletions

View File

@@ -441,11 +441,11 @@ class IOSSimulator extends Device {
@override
Future<String> get sdkNameAndVersion async => category;
final RegExp _iosSdkRegExp = new RegExp(r'iOS (\d+)');
final RegExp _iosSdkRegExp = new RegExp(r'iOS( |-)(\d+)');
Future<int> get sdkMajorVersion async {
final Match sdkMatch = _iosSdkRegExp.firstMatch(await sdkNameAndVersion);
return int.parse(sdkMatch.group(1) ?? 11);
return int.parse(sdkMatch?.group(2) ?? 11);
}
@override