mirror of
https://github.com/flutter/flutter
synced 2024-08-25 02:46:31 +00:00
Shake widget inspector from non-debug builds (#80157)
This commit is contained in:
parent
b52eebb8d4
commit
e7b7ebc066
|
@ -28,7 +28,7 @@ dependencies:
|
|||
fake_async: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -68,4 +68,4 @@ flutter:
|
|||
assets:
|
||||
- icon/
|
||||
|
||||
# PUBSPEC CHECKSUM: f55e
|
||||
# PUBSPEC CHECKSUM: 9d5f
|
||||
|
|
|
@ -50,7 +50,7 @@ dev_dependencies:
|
|||
coverage: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
fake_async: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -84,4 +84,4 @@ flutter:
|
|||
- packages/flutter_gallery_assets/people/square/ali.png
|
||||
- packages/flutter_gallery_assets/places/india_chettinad_silk_maker.png
|
||||
|
||||
# PUBSPEC CHECKSUM: a16d
|
||||
# PUBSPEC CHECKSUM: 896e
|
||||
|
|
|
@ -50,7 +50,7 @@ dev_dependencies:
|
|||
coverage: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
fake_async: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -209,4 +209,4 @@ flutter:
|
|||
fonts:
|
||||
- asset: packages/flutter_gallery_assets/fonts/GalleryIcons.ttf
|
||||
|
||||
# PUBSPEC CHECKSUM: a16d
|
||||
# PUBSPEC CHECKSUM: 896e
|
||||
|
|
|
@ -31,7 +31,7 @@ dependencies:
|
|||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http: 0.13.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
intl: 0.17.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -70,4 +70,4 @@ dependencies:
|
|||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# PUBSPEC CHECKSUM: de15
|
||||
# PUBSPEC CHECKSUM: ba16
|
||||
|
|
|
@ -48,7 +48,7 @@ dev_dependencies:
|
|||
coverage: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
fake_async: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -82,4 +82,4 @@ flutter:
|
|||
- packages/flutter_gallery_assets/people/square/ali.png
|
||||
- packages/flutter_gallery_assets/places/india_chettinad_silk_maker.png
|
||||
|
||||
# PUBSPEC CHECKSUM: a16d
|
||||
# PUBSPEC CHECKSUM: 896e
|
||||
|
|
|
@ -48,7 +48,7 @@ dev_dependencies:
|
|||
coverage: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
fake_async: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -82,4 +82,4 @@ flutter:
|
|||
- packages/flutter_gallery_assets/people/square/ali.png
|
||||
- packages/flutter_gallery_assets/places/india_chettinad_silk_maker.png
|
||||
|
||||
# PUBSPEC CHECKSUM: a16d
|
||||
# PUBSPEC CHECKSUM: 896e
|
||||
|
|
|
@ -46,7 +46,7 @@ dev_dependencies:
|
|||
fake_async: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
logging: 1.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -77,4 +77,4 @@ dev_dependencies:
|
|||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# PUBSPEC CHECKSUM: 3589
|
||||
# PUBSPEC CHECKSUM: 518a
|
||||
|
|
|
@ -28,7 +28,7 @@ dependencies:
|
|||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http: 0.13.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
logging: 1.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -61,4 +61,4 @@ dependencies:
|
|||
dev_dependencies:
|
||||
test_api: 0.3.0
|
||||
|
||||
# PUBSPEC CHECKSUM: a88d
|
||||
# PUBSPEC CHECKSUM: 668e
|
||||
|
|
|
@ -306,11 +306,62 @@ Future<void> _runToolTests() async {
|
|||
});
|
||||
}
|
||||
|
||||
Future<void> runForbiddenFromReleaseTests() async {
|
||||
// Build a release APK to get the snapshot json.
|
||||
final Directory tempDirectory = Directory.systemTemp.createTempSync('forbidden_imports');
|
||||
final List<String> command = <String>[
|
||||
'build',
|
||||
'apk',
|
||||
'--target-platform',
|
||||
'android-arm64',
|
||||
'--release',
|
||||
'--analyze-size',
|
||||
'--code-size-directory',
|
||||
tempDirectory.path,
|
||||
'-v',
|
||||
];
|
||||
|
||||
await runCommand(
|
||||
flutter,
|
||||
command,
|
||||
workingDirectory: path.join(flutterRoot, 'examples', 'hello_world'),
|
||||
);
|
||||
|
||||
// First, a smoke test.
|
||||
final List<String> smokeTestArgs = <String>[
|
||||
path.join(flutterRoot, 'dev', 'forbidden_from_release_tests', 'bin', 'main.dart'),
|
||||
'--snapshot', path.join(tempDirectory.path, 'snapshot.arm64-v8a.json'),
|
||||
'--package-config', path.join(flutterRoot, 'examples', 'hello_world', '.dart_tool', 'package_config.json'),
|
||||
'--forbidden-type', 'package:flutter/src/widgets/framework.dart::Widget',
|
||||
];
|
||||
await runCommand(
|
||||
dart,
|
||||
smokeTestArgs,
|
||||
workingDirectory: flutterRoot,
|
||||
expectNonZeroExit: true,
|
||||
);
|
||||
|
||||
// Actual test.
|
||||
final List<String> args = <String>[
|
||||
path.join(flutterRoot, 'dev', 'forbidden_from_release_tests', 'bin', 'main.dart'),
|
||||
'--snapshot', path.join(tempDirectory.path, 'snapshot.arm64-v8a.json'),
|
||||
'--package-config', path.join(flutterRoot, 'examples', 'hello_world', '.dart_tool', 'package_config.json'),
|
||||
'--forbidden-type', 'package:flutter/src/widgets/widget_inspector.dart::WidgetInspectorService',
|
||||
];
|
||||
await runCommand(
|
||||
dart,
|
||||
args,
|
||||
workingDirectory: flutterRoot,
|
||||
);
|
||||
}
|
||||
|
||||
/// Verifies that APK, and IPA (if on macOS) builds the examples apps
|
||||
/// without crashing. It does not actually launch the apps. That happens later
|
||||
/// in the devicelab. This is just a smoke-test. In particular, this will verify
|
||||
/// we can build when there are spaces in the path name for the Flutter SDK and
|
||||
/// target app.
|
||||
///
|
||||
/// Also does some checking about types included in hello_world.
|
||||
Future<void> _runBuildTests() async {
|
||||
final List<FileSystemEntity> exampleDirectories = Directory(path.join(flutterRoot, 'examples')).listSync()
|
||||
..add(Directory(path.join(flutterRoot, 'packages', 'integration_test', 'example')))
|
||||
|
@ -340,6 +391,7 @@ Future<void> _runBuildTests() async {
|
|||
path.join('lib', 'dart_io_import.dart'),
|
||||
),
|
||||
],
|
||||
runForbiddenFromReleaseTests,
|
||||
]..shuffle(math.Random(0));
|
||||
|
||||
await _runShardRunnerIndexOfTotalSubshard(tests);
|
||||
|
|
|
@ -29,7 +29,7 @@ dev_dependencies:
|
|||
convert: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
coverage: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
crypto: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -57,4 +57,4 @@ dev_dependencies:
|
|||
webkit_inspection_protocol: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
yaml: 3.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
||||
# PUBSPEC CHECKSUM: 3e4c
|
||||
# PUBSPEC CHECKSUM: c14d
|
||||
|
|
|
@ -39,7 +39,7 @@ dev_dependencies:
|
|||
coverage: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
crypto: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
matcher: 0.12.10 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -63,4 +63,4 @@ dev_dependencies:
|
|||
webkit_inspection_protocol: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
yaml: 3.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
||||
# PUBSPEC CHECKSUM: a88d
|
||||
# PUBSPEC CHECKSUM: 668e
|
||||
|
|
11
dev/forbidden_from_release_tests/README.md
Normal file
11
dev/forbidden_from_release_tests/README.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Forbidden from release tests
|
||||
|
||||
This program compiles the Dart portions of a Flutter application to the
|
||||
AOT format used for release builds, and verifies that debugging related types
|
||||
are not retained. By default, it uses the `//examples/hello_world` application
|
||||
in this repository.
|
||||
|
||||
This harness is invoked from `dev/bots/test.dart`. By default it uses the
|
||||
`examples/hello_world.dart` as if it were being compiled for Android arm64
|
||||
release. New forbidden types may be added by adding more `--forbidden-type`
|
||||
options in the `runForbiddenFromReleaseTests` method in `dev/bots/test.dart`
|
160
dev/forbidden_from_release_tests/bin/main.dart
Normal file
160
dev/forbidden_from_release_tests/bin/main.dart
Normal file
|
@ -0,0 +1,160 @@
|
|||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart=2.9
|
||||
// TODO(dnfield): migrate this once vm_snapshot_analysis is migrated.
|
||||
// https://github.com/dart-lang/sdk/issues/45683
|
||||
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:args/args.dart';
|
||||
import 'package:file/file.dart';
|
||||
import 'package:file/local.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:package_config/package_config.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:process/process.dart';
|
||||
import 'package:vm_snapshot_analysis/program_info.dart';
|
||||
import 'package:vm_snapshot_analysis/v8_profile.dart';
|
||||
|
||||
const ProcessManager processManager = LocalProcessManager();
|
||||
const FileSystem fs = LocalFileSystem();
|
||||
|
||||
Future<void> main(List<String> args) async {
|
||||
final Options options = Options.fromArgs(args);
|
||||
final String json = options.snapshot.readAsStringSync();
|
||||
final Snapshot snapshot = Snapshot.fromJson(jsonDecode(json) as Map<String, dynamic>);
|
||||
final ProgramInfo programInfo = toProgramInfo(snapshot);
|
||||
|
||||
final List<String> foundForbiddenTypes = <String>[];
|
||||
bool fail = false;
|
||||
for (final String forbiddenType in options.forbiddenTypes) {
|
||||
final int slash = forbiddenType.indexOf('/');
|
||||
final int doubleColons = forbiddenType.indexOf('::');
|
||||
if (slash == -1 || doubleColons < 2) {
|
||||
print('Invalid forbidden type "$forbiddenType". The format must be <package_uri>::<type_name>, e.g. package:flutter/src/widgets/framework.dart::Widget');
|
||||
fail = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!await validateType(forbiddenType, options.packageConfig)) {
|
||||
foundForbiddenTypes.add('Forbidden type "$forbiddenType" does not seem to exist.');
|
||||
continue;
|
||||
}
|
||||
|
||||
final List<String> lookupPath = <String>[
|
||||
forbiddenType.substring(0, slash),
|
||||
forbiddenType.substring(0, doubleColons),
|
||||
forbiddenType.substring(doubleColons + 2),
|
||||
];
|
||||
if (programInfo.lookup(lookupPath) != null) {
|
||||
foundForbiddenTypes.add(forbiddenType);
|
||||
}
|
||||
}
|
||||
if (fail) {
|
||||
print('Invalid forbidden type formats. Exiting.');
|
||||
exit(-1);
|
||||
}
|
||||
if (foundForbiddenTypes.isNotEmpty) {
|
||||
print('The output contained the following forbidden types:');
|
||||
print(foundForbiddenTypes.join('\n'));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
print('No forbidden types found.');
|
||||
}
|
||||
|
||||
Future<bool> validateType(String forbiddenType, File packageConfigFile) async {
|
||||
if (!forbiddenType.startsWith('package:')) {
|
||||
print('Warning: Unable to validate $forbiddenType. Continuing.');
|
||||
return true;
|
||||
}
|
||||
|
||||
final Uri packageUri = Uri.parse(forbiddenType.substring(0, forbiddenType.indexOf('::')));
|
||||
final String typeName = forbiddenType.substring(forbiddenType.indexOf('::') + 2);
|
||||
|
||||
final PackageConfig packageConfig = PackageConfig.parseString(
|
||||
packageConfigFile.readAsStringSync(),
|
||||
packageConfigFile.uri,
|
||||
);
|
||||
final Uri packageFileUri = packageConfig.resolve(packageUri);
|
||||
final File packageFile = fs.file(packageFileUri);
|
||||
if (!packageFile.existsSync()) {
|
||||
print('File $packageFile does not exist - forbidden type has moved or been removed.');
|
||||
return false;
|
||||
}
|
||||
|
||||
// This logic is imperfect. It will not detect mixed in types the way that
|
||||
// the snapshot has them, e.g. TypeName&MixedIn&Whatever. It also assumes
|
||||
// there is at least one space before and after the type name, which is not
|
||||
// strictly required by the language.
|
||||
final List<String> contents = packageFile.readAsStringSync().split('\n');
|
||||
for (final String line in contents) {
|
||||
// Ignore comments.
|
||||
// This will fail for multi- and intra-line comments (i.e. /* */).
|
||||
if (line.trim().startsWith('//')) {
|
||||
continue;
|
||||
}
|
||||
if (line.contains(' $typeName ')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
class Options {
|
||||
const Options({
|
||||
@required this.snapshot,
|
||||
@required this.packageConfig,
|
||||
@required this.forbiddenTypes,
|
||||
});
|
||||
|
||||
factory Options.fromArgs(List<String> args) {
|
||||
final ArgParser argParser = ArgParser();
|
||||
argParser.addOption(
|
||||
'snapshot',
|
||||
help: 'The path V8 snapshot file.',
|
||||
valueHelp: '/tmp/snapshot.arm64-v8a.json',
|
||||
);
|
||||
argParser.addOption(
|
||||
'package-config',
|
||||
help: 'Dart package_config.json file generated by `pub get`.',
|
||||
valueHelp: path.join(r'$FLUTTER_ROOT', 'examples', 'hello_world', '.dart_tool', 'package_config.json'),
|
||||
defaultsTo: path.join(fs.currentDirectory.path, 'examples', 'hello_world', '.dart_tool', 'package_config.json'),
|
||||
);
|
||||
argParser.addMultiOption(
|
||||
'forbidden-type',
|
||||
help: 'Type name(s) to forbid from release compilation, e.g. "package:flutter/src/widgets/framework.dart::Widget".',
|
||||
valueHelp: '<package_uri>::<type_name>',
|
||||
);
|
||||
|
||||
argParser.addFlag('help', help: 'Prints usage.', negatable: false);
|
||||
final ArgResults argResults = argParser.parse(args);
|
||||
|
||||
if (argResults['help'] == true) {
|
||||
print(argParser.usage);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
return Options(
|
||||
snapshot: _getFileArg(argResults, 'snapshot'),
|
||||
packageConfig: _getFileArg(argResults, 'package-config'),
|
||||
forbiddenTypes: Set<String>.from(argResults['forbidden-type'] as List<String>),
|
||||
);
|
||||
}
|
||||
|
||||
final File snapshot;
|
||||
final File packageConfig;
|
||||
final Set<String> forbiddenTypes;
|
||||
|
||||
static File _getFileArg(ArgResults argResults, String argName) {
|
||||
final File result = fs.file(argResults[argName] as String);
|
||||
if (!result.existsSync()) {
|
||||
print('The $argName file at $result could not be found.');
|
||||
exit(-1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
18
dev/forbidden_from_release_tests/pubspec.yaml
Normal file
18
dev/forbidden_from_release_tests/pubspec.yaml
Normal file
|
@ -0,0 +1,18 @@
|
|||
name: forbidden_from_release_tests
|
||||
publish_to: 'none'
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
|
||||
dependencies:
|
||||
args: 2.0.0
|
||||
file: 6.1.0
|
||||
package_config: 2.0.0
|
||||
path: 1.8.0
|
||||
process: 4.2.1
|
||||
vm_snapshot_analysis: 0.6.0
|
||||
|
||||
meta: 1.3.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
platform: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
||||
# PUBSPEC CHECKSUM: 6b98
|
|
@ -25,7 +25,7 @@ dependencies:
|
|||
crypto: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -65,4 +65,4 @@ dependencies:
|
|||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# PUBSPEC CHECKSUM: db19
|
||||
# PUBSPEC CHECKSUM: c31a
|
||||
|
|
|
@ -60,7 +60,7 @@ dev_dependencies:
|
|||
coverage: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
fake_async: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -91,4 +91,4 @@ dev_dependencies:
|
|||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# PUBSPEC CHECKSUM: 4bca
|
||||
# PUBSPEC CHECKSUM: 09cb
|
||||
|
|
|
@ -26,7 +26,7 @@ dependencies:
|
|||
crypto: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -66,4 +66,4 @@ dependencies:
|
|||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# PUBSPEC CHECKSUM: db19
|
||||
# PUBSPEC CHECKSUM: c31a
|
||||
|
|
|
@ -26,7 +26,7 @@ dependencies:
|
|||
crypto: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -66,4 +66,4 @@ dependencies:
|
|||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# PUBSPEC CHECKSUM: db19
|
||||
# PUBSPEC CHECKSUM: c31a
|
||||
|
|
|
@ -26,7 +26,7 @@ dependencies:
|
|||
crypto: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -66,4 +66,4 @@ dependencies:
|
|||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# PUBSPEC CHECKSUM: db19
|
||||
# PUBSPEC CHECKSUM: c31a
|
||||
|
|
|
@ -75,7 +75,7 @@ dev_dependencies:
|
|||
crypto: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
logging: 1.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -273,4 +273,4 @@ flutter:
|
|||
- asset: packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Regular.ttf
|
||||
- asset: packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Light.ttf
|
||||
|
||||
# PUBSPEC CHECKSUM: 4f1e
|
||||
# PUBSPEC CHECKSUM: a51f
|
||||
|
|
|
@ -60,7 +60,7 @@ dev_dependencies:
|
|||
coverage: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
fake_async: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -91,4 +91,4 @@ dev_dependencies:
|
|||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# PUBSPEC CHECKSUM: 4bca
|
||||
# PUBSPEC CHECKSUM: 09cb
|
||||
|
|
|
@ -37,7 +37,7 @@ dev_dependencies:
|
|||
fake_async: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -78,4 +78,4 @@ flutter:
|
|||
# the material Icons class.
|
||||
uses-material-design: true
|
||||
|
||||
# PUBSPEC CHECKSUM: b7d2
|
||||
# PUBSPEC CHECKSUM: 9fd3
|
||||
|
|
|
@ -26,7 +26,7 @@ dependencies:
|
|||
crypto: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -66,4 +66,4 @@ dependencies:
|
|||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# PUBSPEC CHECKSUM: db19
|
||||
# PUBSPEC CHECKSUM: c31a
|
||||
|
|
|
@ -32,7 +32,7 @@ dependencies:
|
|||
crypto: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -81,4 +81,4 @@ dev_dependencies:
|
|||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# PUBSPEC CHECKSUM: 4bc7
|
||||
# PUBSPEC CHECKSUM: 83c8
|
||||
|
|
|
@ -39,7 +39,7 @@ dev_dependencies:
|
|||
fake_async: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -73,4 +73,4 @@ dev_dependencies:
|
|||
webkit_inspection_protocol: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
yaml: 3.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
||||
# PUBSPEC CHECKSUM: b811
|
||||
# PUBSPEC CHECKSUM: a012
|
||||
|
|
|
@ -43,7 +43,7 @@ dev_dependencies:
|
|||
|
||||
boolean_selector: 2.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
coverage: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -95,4 +95,4 @@ executables:
|
|||
vm_service_client: 0.2.6 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
web_socket_channel: 1.0.9 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
||||
# PUBSPEC CHECKSUM: 0f87
|
||||
# PUBSPEC CHECKSUM: b088
|
||||
|
|
|
@ -38,7 +38,7 @@ dev_dependencies:
|
|||
convert: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
coverage: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
logging: 1.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -63,4 +63,4 @@ dev_dependencies:
|
|||
webkit_inspection_protocol: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
yaml: 3.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
||||
# PUBSPEC CHECKSUM: b14f
|
||||
# PUBSPEC CHECKSUM: 8750
|
||||
|
|
|
@ -35,7 +35,7 @@ dev_dependencies:
|
|||
fake_async: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -69,4 +69,4 @@ dev_dependencies:
|
|||
webkit_inspection_protocol: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
yaml: 3.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
||||
# PUBSPEC CHECKSUM: b7d2
|
||||
# PUBSPEC CHECKSUM: 9fd3
|
||||
|
|
|
@ -35,7 +35,7 @@ dev_dependencies:
|
|||
fake_async: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -72,4 +72,4 @@ dev_dependencies:
|
|||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# PUBSPEC CHECKSUM: b7d2
|
||||
# PUBSPEC CHECKSUM: 9fd3
|
||||
|
|
|
@ -35,7 +35,7 @@ dev_dependencies:
|
|||
fake_async: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -72,4 +72,4 @@ dev_dependencies:
|
|||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# PUBSPEC CHECKSUM: b7d2
|
||||
# PUBSPEC CHECKSUM: 9fd3
|
||||
|
|
|
@ -290,7 +290,10 @@ mixin WidgetsBinding on BindingBase, ServicesBinding, SchedulerBinding, GestureB
|
|||
window.onLocaleChanged = handleLocaleChanged;
|
||||
window.onAccessibilityFeaturesChanged = handleAccessibilityFeaturesChanged;
|
||||
SystemChannels.navigation.setMethodCallHandler(_handleNavigationInvocation);
|
||||
FlutterErrorDetails.propertiesTransformers.add(transformDebugCreator);
|
||||
assert(() {
|
||||
FlutterErrorDetails.propertiesTransformers.add(debugTransformDebugCreator);
|
||||
return true;
|
||||
}());
|
||||
}
|
||||
|
||||
void _debugAddStackFilters() {
|
||||
|
|
|
@ -2892,7 +2892,12 @@ bool _isDebugCreator(DiagnosticsNode node) => node is DiagnosticsDebugCreator;
|
|||
///
|
||||
/// This function will be registered to [FlutterErrorDetails.propertiesTransformers]
|
||||
/// in [WidgetsBinding.initInstances].
|
||||
Iterable<DiagnosticsNode> transformDebugCreator(Iterable<DiagnosticsNode> properties) sync* {
|
||||
///
|
||||
/// This is meant to be called only in debug mode. In other modes, it yields an empty list.
|
||||
Iterable<DiagnosticsNode> debugTransformDebugCreator(Iterable<DiagnosticsNode> properties) sync* {
|
||||
if (!kDebugMode) {
|
||||
return;
|
||||
}
|
||||
final List<DiagnosticsNode> pending = <DiagnosticsNode>[];
|
||||
ErrorSummary? errorSummary;
|
||||
for (final DiagnosticsNode node in properties) {
|
||||
|
@ -2962,8 +2967,6 @@ Iterable<DiagnosticsNode> _describeRelevantUserCode(
|
|||
// TODO(chunhtai): should print out all the widgets that are about to cross
|
||||
// package boundaries.
|
||||
if (debugIsLocalCreationLocation(target)) {
|
||||
|
||||
|
||||
DiagnosticsNode? devToolsDiagnostic;
|
||||
|
||||
// TODO(kenz): once the inspector is better at dealing with broken trees,
|
||||
|
|
|
@ -1018,7 +1018,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
|
|||
builder.add(DiagnosticsStackTrace('When the exception was thrown, this was the stack', null));
|
||||
builder.add(DiagnosticsDebugCreator(DebugCreator(elementA)));
|
||||
|
||||
final List<DiagnosticsNode> nodes = List<DiagnosticsNode>.from(transformDebugCreator(builder.properties));
|
||||
final List<DiagnosticsNode> nodes = List<DiagnosticsNode>.from(debugTransformDebugCreator(builder.properties));
|
||||
expect(nodes.length, 5);
|
||||
expect(nodes[0].runtimeType, StringProperty);
|
||||
expect(nodes[0].name, 'dummy1');
|
||||
|
@ -1080,7 +1080,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
|
|||
builder.add(StringProperty('dummy2', 'value'));
|
||||
builder.add(DiagnosticsStackTrace('When the exception was thrown, this was the stack', null));
|
||||
|
||||
final List<DiagnosticsNode> nodes = List<DiagnosticsNode>.from(transformDebugCreator(builder.properties));
|
||||
final List<DiagnosticsNode> nodes = List<DiagnosticsNode>.from(debugTransformDebugCreator(builder.properties));
|
||||
expect(nodes.length, 5);
|
||||
expect(nodes[0].runtimeType, StringProperty);
|
||||
expect(nodes[0].name, 'dummy1');
|
||||
|
@ -1128,7 +1128,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
|
|||
builder.add(DiagnosticsDebugCreator(DebugCreator(elementA)));
|
||||
builder.add(StringProperty('dummy2', 'value'));
|
||||
|
||||
final List<DiagnosticsNode> nodes = List<DiagnosticsNode>.from(transformDebugCreator(builder.properties));
|
||||
final List<DiagnosticsNode> nodes = List<DiagnosticsNode>.from(debugTransformDebugCreator(builder.properties));
|
||||
expect(nodes.length, 6);
|
||||
expect(nodes[0].runtimeType, ErrorSummary);
|
||||
expect(nodes[1].runtimeType, DiagnosticsBlock);
|
||||
|
@ -1162,7 +1162,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
|
|||
builder.add(DiagnosticsDebugCreator(DebugCreator(elementA)));
|
||||
builder.add(StringProperty('dummy2', 'value'));
|
||||
|
||||
final List<DiagnosticsNode> nodes = List<DiagnosticsNode>.from(transformDebugCreator(builder.properties));
|
||||
final List<DiagnosticsNode> nodes = List<DiagnosticsNode>.from(debugTransformDebugCreator(builder.properties));
|
||||
expect(nodes.length, 4);
|
||||
expect(nodes[0].runtimeType, ErrorSummary);
|
||||
expect(nodes[1].runtimeType, DiagnosticsBlock);
|
||||
|
@ -1194,7 +1194,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
|
|||
builder.add(DiagnosticsDebugCreator(DebugCreator(elementA)));
|
||||
builder.add(StringProperty('dummy2', 'value'));
|
||||
|
||||
final List<DiagnosticsNode> nodes = List<DiagnosticsNode>.from(transformDebugCreator(builder.properties));
|
||||
final List<DiagnosticsNode> nodes = List<DiagnosticsNode>.from(debugTransformDebugCreator(builder.properties));
|
||||
expect(nodes.length, 4);
|
||||
expect(nodes[0].runtimeType, ErrorSummary);
|
||||
expect(nodes[1].runtimeType, DiagnosticsBlock);
|
||||
|
|
|
@ -51,7 +51,7 @@ dev_dependencies:
|
|||
convert: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
coverage: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -74,4 +74,4 @@ dev_dependencies:
|
|||
webkit_inspection_protocol: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
yaml: 3.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
||||
# PUBSPEC CHECKSUM: 23d5
|
||||
# PUBSPEC CHECKSUM: 45d6
|
||||
|
|
|
@ -45,7 +45,7 @@ dependencies:
|
|||
path: 1.8.0
|
||||
mime: 1.0.0
|
||||
logging: 1.0.1
|
||||
http_multi_server: 3.0.0
|
||||
http_multi_server: 3.0.1
|
||||
convert: 3.0.0
|
||||
async: 2.5.0
|
||||
|
||||
|
@ -108,4 +108,4 @@ dartdoc:
|
|||
# Exclude this package from the hosted API docs.
|
||||
nodoc: true
|
||||
|
||||
# PUBSPEC CHECKSUM: e452
|
||||
# PUBSPEC CHECKSUM: 0d53
|
||||
|
|
|
@ -30,7 +30,7 @@ dev_dependencies:
|
|||
coverage: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
crypto: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -61,4 +61,4 @@ dev_dependencies:
|
|||
webkit_inspection_protocol: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
yaml: 3.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
||||
# PUBSPEC CHECKSUM: 3e4f
|
||||
# PUBSPEC CHECKSUM: fb50
|
||||
|
|
|
@ -48,7 +48,7 @@ dev_dependencies:
|
|||
fake_async: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 6.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
glob: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_multi_server: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
http_parser: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
@ -84,4 +84,4 @@ dev_dependencies:
|
|||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# PUBSPEC CHECKSUM: c177
|
||||
# PUBSPEC CHECKSUM: a978
|
||||
|
|
Loading…
Reference in a new issue