Skip to content

Commit 0c81077

Browse files
authored
Migrate devicelab tasks i-z to null safety. (flutter#85998)
1 parent c800b9c commit 0c81077

File tree

61 files changed

+45
-167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+45
-167
lines changed

dev/devicelab/bin/tasks/ios_app_with_extensions_test.dart

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'dart:convert';
86
import 'dart:io';
97

@@ -18,8 +16,8 @@ Future<void> main() async {
1816
await task(() async {
1917
section('Copy test Flutter App with watchOS Companion');
2018

21-
String watchDeviceID;
22-
String phoneDeviceID;
19+
String? watchDeviceID;
20+
String? phoneDeviceID;
2321
final Directory tempDir = Directory.systemTemp
2422
.createTempSync('flutter_ios_app_with_extensions_test.');
2523
final Directory projectDir =
@@ -127,23 +125,23 @@ Future<void> main() async {
127125
// iOS 13.4 (13.4 - 17E255) - com.apple.CoreSimulator.SimRuntime.iOS-13-4
128126
// tvOS 13.4 (13.4 - 17L255) - com.apple.CoreSimulator.SimRuntime.tvOS-13-4
129127
// watchOS 6.2 (6.2 - 17T256) - com.apple.CoreSimulator.SimRuntime.watchOS-6-2
130-
String iOSSimRuntime;
131-
String watchSimRuntime;
128+
String? iOSSimRuntime;
129+
String? watchSimRuntime;
132130

133131
final RegExp iOSRuntimePattern = RegExp(r'iOS .*\) - (.*)');
134132
final RegExp watchOSRuntimePattern = RegExp(r'watchOS .*\) - (.*)');
135133

136134
for (final String runtime in LineSplitter.split(availableRuntimes)) {
137135
// These seem to be in order, so allow matching multiple lines so it grabs
138136
// the last (hopefully latest) one.
139-
final RegExpMatch iOSRuntimeMatch = iOSRuntimePattern.firstMatch(runtime);
137+
final RegExpMatch? iOSRuntimeMatch = iOSRuntimePattern.firstMatch(runtime);
140138
if (iOSRuntimeMatch != null) {
141-
iOSSimRuntime = iOSRuntimeMatch.group(1).trim();
139+
iOSSimRuntime = iOSRuntimeMatch.group(1)!.trim();
142140
continue;
143141
}
144-
final RegExpMatch watchOSRuntimeMatch = watchOSRuntimePattern.firstMatch(runtime);
142+
final RegExpMatch? watchOSRuntimeMatch = watchOSRuntimePattern.firstMatch(runtime);
145143
if (watchOSRuntimeMatch != null) {
146-
watchSimRuntime = watchOSRuntimeMatch.group(1).trim();
144+
watchSimRuntime = watchOSRuntimeMatch.group(1)!.trim();
147145
}
148146
}
149147
if (iOSSimRuntime == null || watchSimRuntime == null) {

dev/devicelab/bin/tasks/ios_content_validation_test.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'dart:io';
86

97
import 'package:flutter_devicelab/framework/apk_utils.dart';
@@ -46,7 +44,7 @@ Future<void> main() async {
4644
final Directory appBundle = applications
4745
.listSync()
4846
.whereType<Directory>()
49-
.singleWhere((Directory directory) => path.extension(directory.path) == '.app', orElse: () => null);
47+
.singleWhere((Directory directory) => path.extension(directory.path) == '.app');
5048

5149
final String flutterFramework = path.join(
5250
appBundle.path,

dev/devicelab/bin/tasks/ios_defines_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:flutter_devicelab/framework/devices.dart';
86
import 'package:flutter_devicelab/framework/framework.dart';
97
import 'package:flutter_devicelab/tasks/integration_tests.dart';

dev/devicelab/bin/tasks/ios_platform_view_tests.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:flutter_devicelab/framework/devices.dart';
86
import 'package:flutter_devicelab/framework/framework.dart';
97
import 'package:flutter_devicelab/tasks/integration_tests.dart';

dev/devicelab/bin/tasks/large_image_changer_perf_android.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:flutter_devicelab/framework/devices.dart';
86
import 'package:flutter_devicelab/framework/framework.dart';
97
import 'package:flutter_devicelab/framework/utils.dart';

dev/devicelab/bin/tasks/large_image_changer_perf_ios.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:flutter_devicelab/framework/devices.dart';
86
import 'package:flutter_devicelab/framework/framework.dart';
97
import 'package:flutter_devicelab/framework/utils.dart';

dev/devicelab/bin/tasks/linux_chrome_dev_mode.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:flutter_devicelab/framework/framework.dart';
86
import 'package:flutter_devicelab/tasks/web_dev_mode_tests.dart';
97

dev/devicelab/bin/tasks/macos_chrome_dev_mode.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:flutter_devicelab/framework/framework.dart';
86
import 'package:flutter_devicelab/tasks/web_dev_mode_tests.dart';
97

dev/devicelab/bin/tasks/microbenchmarks.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:flutter_devicelab/framework/devices.dart';
86
import 'package:flutter_devicelab/framework/framework.dart';
97
import 'package:flutter_devicelab/tasks/microbenchmarks.dart';

dev/devicelab/bin/tasks/microbenchmarks_ios.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:flutter_devicelab/framework/devices.dart';
86
import 'package:flutter_devicelab/framework/framework.dart';
97
import 'package:flutter_devicelab/tasks/microbenchmarks.dart';

0 commit comments

Comments
 (0)