提交 e7eb1c8b 编写于 作者: J Jason Simmons 提交者: Gary Qian

Update the verify_exported script to include the symbols for ICU data (#7647)

上级 b032bbd0
name: verify_exported
dependencies:
path: 1.6.2
collection: 1.14.11
......@@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:io';
import 'package:path/path.dart' as p;
import 'package:collection/collection.dart' show MapEquality;
// This script verifies that the release binaries only export the expected
// symbols.
......@@ -92,16 +93,19 @@ int _checkAndroid(String outPath, String nmPath, Iterable<String> builds) {
continue;
}
final Iterable<NmEntry> entries = NmEntry.parse(nmResult.stdout);
if (entries.isEmpty) {
print('ERROR: $libFlutter exports no symbol');
print(' Expected exactly one symbol "JNI_OnLoad" of type "T", but got none.');
failures++;
} else if (entries.length > 1 || entries.first.type != 'T' || entries.first.name != 'JNI_OnLoad') {
print('ERROR: $libFlutter exports unexpected symbols.');
print(' Expected exactly one symbol "JNI_OnLoad" of type "T", but got instead:');
print(entries.fold<String>('', (String previous, NmEntry entry) {
return '${previous == '' ? '' : '$previous\n'} ${entry.type} ${entry.name}';
}));
final Map<String, String> entryMap = Map.fromIterable(
entries,
key: (entry) => entry.name,
value: (entry) => entry.type);
final Map<String, String> expectedSymbols = {
'JNI_OnLoad': 'T',
'_binary_icudtl_dat_size': 'A',
'_binary_icudtl_dat_start': 'D',
};
if (!MapEquality<String, String>().equals(entryMap, expectedSymbols)) {
print('ERROR: $libFlutter exports the wrong symbols');
print(' Expected $expectedSymbols');
print(' Library has $entryMap.');
failures++;
} else {
print('OK: $libFlutter');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册