Migrate devicelab framework code to null safety. (#86325)
(Attempt to reland #85993)
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'utils.dart';
|
||||
@@ -42,17 +40,10 @@ Future<bool> containsBitcode(String pathToBinary) async {
|
||||
final List<String> lines = LineSplitter.split(loadCommands).toList();
|
||||
lines.asMap().forEach((int index, String line) {
|
||||
if (line.contains('segname __LLVM') && lines.length - index - 1 > 3) {
|
||||
final String emptyBitcodeMarker = lines
|
||||
emptyBitcodeMarkerFound |= lines
|
||||
.skip(index - 1)
|
||||
.take(4)
|
||||
.firstWhere(
|
||||
(String line) => line.contains(' size 0x0000000000000001'),
|
||||
orElse: () => null,
|
||||
);
|
||||
if (emptyBitcodeMarker != null) {
|
||||
emptyBitcodeMarkerFound = true;
|
||||
return;
|
||||
}
|
||||
.any((String line) => line.contains(' size 0x0000000000000001'));
|
||||
}
|
||||
});
|
||||
return !emptyBitcodeMarkerFound;
|
||||
@@ -79,16 +70,16 @@ Future<void> testWithNewIOSSimulator(
|
||||
workingDirectory: flutterDirectory.path,
|
||||
);
|
||||
|
||||
String iOSSimRuntime;
|
||||
String? iOSSimRuntime;
|
||||
|
||||
final RegExp iOSRuntimePattern = RegExp(r'iOS .*\) - (.*)');
|
||||
|
||||
for (final String runtime in LineSplitter.split(availableRuntimes)) {
|
||||
// These seem to be in order, so allow matching multiple lines so it grabs
|
||||
// the last (hopefully latest) one.
|
||||
final RegExpMatch iOSRuntimeMatch = iOSRuntimePattern.firstMatch(runtime);
|
||||
final RegExpMatch? iOSRuntimeMatch = iOSRuntimePattern.firstMatch(runtime);
|
||||
if (iOSRuntimeMatch != null) {
|
||||
iOSSimRuntime = iOSRuntimeMatch.group(1).trim();
|
||||
iOSSimRuntime = iOSRuntimeMatch.group(1)!.trim();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user