ensure dart2js does not compile unsupported packages (#40368)
This commit is contained in:
@@ -24,7 +24,7 @@ dependencies:
|
||||
charcode: 1.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
collection: 1.14.11 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
convert: 2.1.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
crypto: 2.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
crypto: 2.1.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
csslib: 0.16.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
file: 5.0.10 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
front_end: 0.1.19 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
@@ -39,7 +39,7 @@ dependencies:
|
||||
matcher: 0.12.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
mime: 0.9.6+3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
multi_server_socket: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
node_preamble: 1.4.7 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
node_preamble: 1.4.8 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
package_config: 1.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
package_resolver: 1.0.10 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
pedantic: 1.8.0+1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
@@ -67,4 +67,4 @@ dev_dependencies:
|
||||
mockito: 4.1.1
|
||||
test_api: 0.2.5
|
||||
|
||||
# PUBSPEC CHECKSUM: 2d21
|
||||
# PUBSPEC CHECKSUM: 8b23
|
||||
|
||||
@@ -281,17 +281,23 @@ Future<void> _runBuildTests() async {
|
||||
await _flutterBuildApk(examplePath);
|
||||
await _flutterBuildIpa(examplePath);
|
||||
}
|
||||
await _flutterBuildDart2js(path.join('dev', 'integration_tests', 'web'));
|
||||
// Web compilation tests.
|
||||
await _flutterBuildDart2js(path.join('dev', 'integration_tests', 'web'), path.join('lib', 'main.dart'));
|
||||
// Should fail to compile with dart:io.
|
||||
await _flutterBuildDart2js(path.join('dev', 'integration_tests', 'web_compile_tests'),
|
||||
path.join('lib', 'dart_io_import.dart'),
|
||||
expectNonZeroExit: true,
|
||||
);
|
||||
|
||||
print('${bold}DONE: All build tests successful.$reset');
|
||||
}
|
||||
|
||||
Future<void> _flutterBuildDart2js(String relativePathToApplication) async {
|
||||
Future<void> _flutterBuildDart2js(String relativePathToApplication, String target, { bool expectNonZeroExit = false }) async {
|
||||
print('Running Dart2JS build tests...');
|
||||
await runCommand(flutter,
|
||||
<String>['build', 'web', '-v'],
|
||||
<String>['build', 'web', '-v', '--target=$target'],
|
||||
workingDirectory: path.join(flutterRoot, relativePathToApplication),
|
||||
expectNonZeroExit: false,
|
||||
expectNonZeroExit: expectNonZeroExit,
|
||||
environment: <String, String>{
|
||||
'FLUTTER_WEB': 'true',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user