[flutter] replace 'checked mode' with 'debug mode' (#87408)
diff --git a/dev/bots/analyze.dart b/dev/bots/analyze.dart
index 1c45e42..28788b3 100644
--- a/dev/bots/analyze.dart
+++ b/dev/bots/analyze.dart
@@ -48,6 +48,9 @@
print('$clock runtimeType in toString...');
await verifyNoRuntimeTypeInToString(flutterRoot);
+ print('$clock debug mode instead of checked mode...');
+ await verifyNoCheckedMode(flutterRoot);
+
print('$clock Unexpected binaries...');
await verifyNoBinaries(flutterRoot);
@@ -471,6 +474,29 @@
}
}
+
+/// Verifies that all instances of "checked mode" have been migrated to "debug mode".
+Future<void> verifyNoCheckedMode(String workingDirectory) async {
+ final String flutterPackages = path.join(workingDirectory, 'packages');
+ final List<File> files = await _allFiles(flutterPackages, 'dart', minimumMatches: 400)
+ .where((File file) => path.extension(file.path) == '.dart')
+ .toList();
+ final List<String> problems = <String>[];
+ for (final File file in files) {
+ int lineCount = 0;
+ for (final String line in file.readAsLinesSync()) {
+ if (line.toLowerCase().contains('checked mode')) {
+ problems.add('${file.path}:$lineCount uses deprecated "checked mode" instead of "debug mode".');
+ }
+ lineCount += 1;
+ }
+ }
+ if (problems.isNotEmpty) {
+ exitWithError(problems);
+ }
+}
+
+
Future<void> verifyNoRuntimeTypeInToString(String workingDirectory) async {
final String flutterLib = path.join(workingDirectory, 'packages', 'flutter', 'lib');
final Set<String> excludedFiles = <String>{