Test that modules built as AAR contain the right assets and artifacts (#37206)

This commit is contained in:
Emmanuel Garcia
2019-07-30 13:38:06 -07:00
committed by GitHub
parent dfad03952f
commit bd02e4f573
2 changed files with 71 additions and 3 deletions

View File

@@ -34,6 +34,7 @@ Future<void> runPluginProjectTest(Future<void> testFunction(FlutterPluginProject
}
}
/// Returns the list of files inside an Android Package Kit.
Future<Iterable<String>> getFilesInApk(String apk) async {
if (!File(apk).existsSync())
throw TaskResult.failure(
@@ -50,11 +51,16 @@ Future<Iterable<String>> getFilesInApk(String apk) async {
.map((String line) => line.split(' ').last)
.toList();
}
/// Returns the list of files inside an Android App Bundle.
Future<Iterable<String>> getFilesInAppBundle(String bundle) {
return getFilesInApk(bundle);
}
/// Returns the list of files inside an Android Archive.
Future<Iterable<String>> getFilesInAar(String aar) {
return getFilesInApk(aar);
}
void checkItContains<T>(Iterable<T> values, Iterable<T> collection) {
for (T value in values) {
if (!collection.contains(value)) {