Use the maven-publish plugin to publish AAR files. (#101276)

This commit is contained in:
Elsabe Ros
2022-04-13 07:19:08 +02:00
committed by GitHub
parent 58fe098376
commit 2b0255f0d9
8 changed files with 292 additions and 115 deletions

View File

@@ -67,21 +67,45 @@ Future<void> main() async {
]);
});
final String outputAarDirectory = path.join(
final String outputAarDirectoryOld = path.join(
flutterProject.rootPath,
'build/host/outputs/repo/com/example/${flutterProject.name}/flutter_release/1.0/flutter_release-1.0.aar',
);
final Iterable<String> aarFiles = await getFilesInAar(outputAarDirectory);
final Iterable<String> oldAarFiles = await getFilesInAar(outputAarDirectoryOld);
checkCollectionContains<String>(<String>[
...flutterAssets,
'jni/armeabi-v7a/libapp.so',
], aarFiles);
], oldAarFiles);
final String outputAarDirectoryNew = path.join(
flutterProject.rootPath,
'build/host/outputs/repo/com/example/${flutterProject.name}/flutter/1.0/flutter-1.0-release.aar',
);
final Iterable<String> newAarFiles = await getFilesInAar(outputAarDirectoryNew);
checkCollectionContains<String>(<String>[
...flutterAssets,
'jni/armeabi-v7a/libapp.so',
], newAarFiles);
// Verify that an identifier from the Dart project code is not present
// in the compiled binary.
await inDirectory(flutterProject.rootPath, () async {
await exec('unzip', <String>[outputAarDirectory]);
await exec('unzip', <String>[outputAarDirectoryOld]);
checkFileExists(path.join(flutterProject.rootPath, 'jni/armeabi-v7a/libapp.so'));
final String response = await eval(
'grep',
<String>[flutterProject.name, 'jni/armeabi-v7a/libapp.so'],
canFail: true,
);
if (response.trim().contains('matches')) {
foundAarProjectName = true;
}
});
await inDirectory(flutterProject.rootPath, () async {
await exec('unzip', <String>[outputAarDirectoryNew]);
checkFileExists(path.join(flutterProject.rootPath, 'jni/armeabi-v7a/libapp.so'));
final String response = await eval(
'grep',