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

This reverts commit 2b0255f0d9.
This commit is contained in:
Zachary Anderson
2022-04-13 08:12:07 -07:00
committed by GitHub
parent 5fb74db1a9
commit 6190c5df09
8 changed files with 115 additions and 292 deletions

View File

@@ -67,45 +67,21 @@ Future<void> main() async {
]);
});
final String outputAarDirectoryOld = path.join(
final String outputAarDirectory = path.join(
flutterProject.rootPath,
'build/host/outputs/repo/com/example/${flutterProject.name}/flutter_release/1.0/flutter_release-1.0.aar',
);
final Iterable<String> oldAarFiles = await getFilesInAar(outputAarDirectoryOld);
final Iterable<String> aarFiles = await getFilesInAar(outputAarDirectory);
checkCollectionContains<String>(<String>[
...flutterAssets,
'jni/armeabi-v7a/libapp.so',
], 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);
], aarFiles);
// 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>[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]);
await exec('unzip', <String>[outputAarDirectory]);
checkFileExists(path.join(flutterProject.rootPath, 'jni/armeabi-v7a/libapp.so'));
final String response = await eval(
'grep',

View File

@@ -98,7 +98,7 @@ Future<void> main() async {
'repo',
);
section('Check release Maven artifacts (old format)');
section('Check release Maven artifacts');
checkFileExists(path.join(
repoPath,
@@ -111,7 +111,7 @@ Future<void> main() async {
'flutter_release-1.0.aar',
));
final String releasePomOld = path.join(
final String releasePom = path.join(
repoPath,
'io',
'flutter',
@@ -122,7 +122,7 @@ Future<void> main() async {
'flutter_release-1.0.pom',
);
checkFileExists(releasePomOld);
checkFileExists(releasePom);
checkFileExists(path.join(
repoPath,
@@ -146,54 +146,6 @@ Future<void> main() async {
'plugin_with_android_release-1.0.pom',
));
section('Check release Maven artifacts (new format)');
checkFileExists(path.join(
repoPath,
'io',
'flutter',
'devicelab',
'hello',
'flutter',
'1.0',
'flutter-1.0-release.aar',
));
final String releasePomNew = path.join(
repoPath,
'io',
'flutter',
'devicelab',
'hello',
'flutter',
'1.0',
'flutter-1.0.pom',
);
checkFileExists(releasePomNew);
checkFileExists(path.join(
repoPath,
'io',
'flutter',
'devicelab',
'plugin_with_android',
'plugin_with_android',
'1.0',
'plugin_with_android-1.0-release.aar',
));
checkFileExists(path.join(
repoPath,
'io',
'flutter',
'devicelab',
'plugin_with_android',
'plugin_with_android',
'1.0',
'plugin_with_android-1.0.pom',
));
section('Check AOT blobs in release POM');
checkFileContains(<String>[
@@ -201,17 +153,8 @@ Future<void> main() async {
'armeabi_v7a_release',
'arm64_v8a_release',
'x86_64_release',
'plugin_with_android',
'<relocation>', //make sure the old pom contains the <relocation> tag
], releasePomOld);
checkFileContains(<String>[
'flutter_embedding_release',
'armeabi_v7a_release',
'arm64_v8a_release',
'x86_64_release',
'plugin_with_android',
], releasePomNew);
'plugin_with_android_release',
], releasePom);
section('Check assets in release AAR');
@@ -237,29 +180,7 @@ Future<void> main() async {
)
);
checkCollectionContains<String>(
<String>[
...flutterAssets,
// AOT snapshots
'jni/arm64-v8a/libapp.so',
'jni/armeabi-v7a/libapp.so',
'jni/x86_64/libapp.so',
],
await getFilesInAar(
path.join(
repoPath,
'io',
'flutter',
'devicelab',
'hello',
'flutter',
'1.0',
'flutter-1.0-release.aar',
)
)
);
section('Check debug Maven artifacts (old format)');
section('Check debug Maven artifacts');
checkFileExists(path.join(
repoPath,
@@ -272,7 +193,7 @@ Future<void> main() async {
'flutter_debug-1.0.aar',
));
final String debugPomOld = path.join(
final String debugPom = path.join(
repoPath,
'io',
'flutter',
@@ -283,7 +204,7 @@ Future<void> main() async {
'flutter_debug-1.0.pom',
);
checkFileExists(debugPomOld);
checkFileExists(debugPom);
checkFileExists(path.join(
repoPath,
@@ -307,54 +228,6 @@ Future<void> main() async {
'plugin_with_android_debug-1.0.pom',
));
section('Check debug Maven artifacts (new format)');
checkFileExists(path.join(
repoPath,
'io',
'flutter',
'devicelab',
'hello',
'flutter',
'1.0',
'flutter-1.0-debug.aar',
));
final String debugPomNew = path.join(
repoPath,
'io',
'flutter',
'devicelab',
'hello',
'flutter',
'1.0',
'flutter-1.0.pom',
);
checkFileExists(debugPomNew);
checkFileExists(path.join(
repoPath,
'io',
'flutter',
'devicelab',
'plugin_with_android',
'plugin_with_android',
'1.0',
'plugin_with_android-1.0-debug.aar',
));
checkFileExists(path.join(
repoPath,
'io',
'flutter',
'devicelab',
'plugin_with_android',
'plugin_with_android',
'1.0',
'plugin_with_android-1.0.pom',
));
section('Check AOT blobs in debug POM');
checkFileContains(<String>[
@@ -363,18 +236,8 @@ Future<void> main() async {
'x86_64_debug',
'armeabi_v7a_debug',
'arm64_v8a_debug',
'plugin_with_android',
'<relocation>', //make sure the old pom contains the <relocation> tag
], debugPomOld);
checkFileContains(<String>[
'flutter_embedding_debug',
'x86_debug',
'x86_64_debug',
'armeabi_v7a_debug',
'arm64_v8a_debug',
'plugin_with_android',
], debugPomNew);
'plugin_with_android_debug',
], debugPom);
section('Check assets in debug AAR');
@@ -389,27 +252,11 @@ Future<void> main() async {
'flutter_debug-1.0.aar',
));
final Iterable<String> debugAarNew = await getFilesInAar(path.join(
repoPath,
'io',
'flutter',
'devicelab',
'hello',
'flutter',
'1.0',
'flutter-1.0-debug.aar',
));
checkCollectionContains<String>(<String>[
...flutterAssets,
...debugAssets,
], debugAar);
checkCollectionContains<String>(<String>[
...flutterAssets,
...debugAssets,
], debugAarNew);
return TaskResult.success(null);
} on TaskResult catch (taskResult) {
return taskResult;