mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Update the verify_exported script to include the symbols for ICU data (#7647)
This commit is contained in:
parent
b032bbd0cc
commit
e7eb1c8bf6
@ -1,3 +1,4 @@
|
||||
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');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user