Revert "Generate ELF shared libraries and allow multi-abi libs in APKs and App bundles (#33696)" (#34121)
This commit is contained in:
@@ -157,102 +157,16 @@ someOtherTask
|
||||
});
|
||||
test('should provide apk file name for default build types', () {
|
||||
final GradleProject project = GradleProject(<String>['debug', 'profile', 'release'], <String>[], fs.directory('/some/dir'),fs.directory('/some/dir'));
|
||||
expect(project.apkFilesFor(const AndroidBuildInfo(BuildInfo.debug)).first, 'app-debug.apk');
|
||||
expect(project.apkFilesFor(const AndroidBuildInfo(BuildInfo.profile)).first, 'app-profile.apk');
|
||||
expect(project.apkFilesFor(const AndroidBuildInfo(BuildInfo.release)).first, 'app-release.apk');
|
||||
expect(project.apkFilesFor(const AndroidBuildInfo(BuildInfo(BuildMode.release, 'unknown'))).isEmpty, isTrue);
|
||||
expect(project.apkFileFor(BuildInfo.debug), 'app-debug.apk');
|
||||
expect(project.apkFileFor(BuildInfo.profile), 'app-profile.apk');
|
||||
expect(project.apkFileFor(BuildInfo.release), 'app-release.apk');
|
||||
expect(project.apkFileFor(const BuildInfo(BuildMode.release, 'unknown')), isNull);
|
||||
});
|
||||
test('should provide apk file name for flavored build types', () {
|
||||
final GradleProject project = GradleProject(<String>['debug', 'profile', 'release'], <String>['free', 'paid'], fs.directory('/some/dir'),fs.directory('/some/dir'));
|
||||
expect(project.apkFilesFor(const AndroidBuildInfo(BuildInfo(BuildMode.debug, 'free'))).first, 'app-free-debug.apk');
|
||||
expect(project.apkFilesFor(const AndroidBuildInfo(BuildInfo(BuildMode.release, 'paid'))).first, 'app-paid-release.apk');
|
||||
expect(project.apkFilesFor(const AndroidBuildInfo(BuildInfo(BuildMode.release, 'unknown'))).isEmpty, isTrue);
|
||||
});
|
||||
test('should provide apks for default build types and each ABI', () {
|
||||
final GradleProject project = GradleProject(<String>['debug', 'profile', 'release'], <String>[], fs.directory('/some/dir'),fs.directory('/some/dir'));
|
||||
expect(project.apkFilesFor(
|
||||
const AndroidBuildInfo(
|
||||
BuildInfo.debug,
|
||||
splitPerAbi: true,
|
||||
targetArchs: <AndroidArch>[
|
||||
AndroidArch.armeabi_v7a,
|
||||
AndroidArch.arm64_v8a,
|
||||
]
|
||||
)
|
||||
),
|
||||
<String>[
|
||||
'app-armeabi-v7a-debug.apk',
|
||||
'app-arm64-v8a-debug.apk',
|
||||
]);
|
||||
|
||||
expect(project.apkFilesFor(
|
||||
const AndroidBuildInfo(
|
||||
BuildInfo.release,
|
||||
splitPerAbi: true,
|
||||
targetArchs: <AndroidArch>[
|
||||
AndroidArch.armeabi_v7a,
|
||||
AndroidArch.arm64_v8a,
|
||||
]
|
||||
)
|
||||
),
|
||||
<String>[
|
||||
'app-armeabi-v7a-release.apk',
|
||||
'app-arm64-v8a-release.apk',
|
||||
]);
|
||||
|
||||
expect(project.apkFilesFor(
|
||||
const AndroidBuildInfo(
|
||||
BuildInfo(BuildMode.release, 'unknown'),
|
||||
splitPerAbi: true,
|
||||
targetArchs: <AndroidArch>[
|
||||
AndroidArch.armeabi_v7a,
|
||||
AndroidArch.arm64_v8a,
|
||||
]
|
||||
)
|
||||
).isEmpty, isTrue);
|
||||
});
|
||||
test('should provide apks for each ABI and flavored build types', () {
|
||||
final GradleProject project = GradleProject(<String>['debug', 'profile', 'release'], <String>['free', 'paid'], fs.directory('/some/dir'),fs.directory('/some/dir'));
|
||||
expect(project.apkFilesFor(
|
||||
const AndroidBuildInfo(
|
||||
BuildInfo(BuildMode.debug, 'free'),
|
||||
splitPerAbi: true,
|
||||
targetArchs: <AndroidArch>[
|
||||
AndroidArch.armeabi_v7a,
|
||||
AndroidArch.arm64_v8a,
|
||||
]
|
||||
)
|
||||
),
|
||||
<String>[
|
||||
'app-free-armeabi-v7a-debug.apk',
|
||||
'app-free-arm64-v8a-debug.apk',
|
||||
]);
|
||||
|
||||
expect(project.apkFilesFor(
|
||||
const AndroidBuildInfo(
|
||||
BuildInfo(BuildMode.release, 'paid'),
|
||||
splitPerAbi: true,
|
||||
targetArchs: <AndroidArch>[
|
||||
AndroidArch.armeabi_v7a,
|
||||
AndroidArch.arm64_v8a,
|
||||
]
|
||||
)
|
||||
),
|
||||
<String>[
|
||||
'app-paid-armeabi-v7a-release.apk',
|
||||
'app-paid-arm64-v8a-release.apk',
|
||||
]);
|
||||
|
||||
expect(project.apkFilesFor(
|
||||
const AndroidBuildInfo(
|
||||
BuildInfo(BuildMode.release, 'unknown'),
|
||||
splitPerAbi: true,
|
||||
targetArchs: <AndroidArch>[
|
||||
AndroidArch.armeabi_v7a,
|
||||
AndroidArch.arm64_v8a,
|
||||
]
|
||||
)
|
||||
).isEmpty, isTrue);
|
||||
expect(project.apkFileFor(const BuildInfo(BuildMode.debug, 'free')), 'app-free-debug.apk');
|
||||
expect(project.apkFileFor(const BuildInfo(BuildMode.release, 'paid')), 'app-paid-release.apk');
|
||||
expect(project.apkFileFor(const BuildInfo(BuildMode.release, 'unknown')), isNull);
|
||||
});
|
||||
test('should provide bundle file name for default build types', () {
|
||||
final GradleProject project = GradleProject(<String>['debug', 'profile', 'release'], <String>[], fs.directory('/some/dir'),fs.directory('/some/dir'));
|
||||
|
||||
@@ -80,7 +80,7 @@ void main() {
|
||||
});
|
||||
});
|
||||
|
||||
group('Snapshotter - AOT', () {
|
||||
group('Snapshotter - iOS AOT', () {
|
||||
const String kSnapshotDart = 'snapshot.dart';
|
||||
String skyEnginePath;
|
||||
|
||||
@@ -395,11 +395,10 @@ void main() {
|
||||
]);
|
||||
}, overrides: contextOverrides);
|
||||
|
||||
testUsingContext('builds shared library for android-arm', () async {
|
||||
fs.file('main.dill').writeAsStringSync('binary magic');
|
||||
|
||||
testUsingContext('returns failure if buildSharedLibrary is true but no NDK is found', () async {
|
||||
final String outputPath = fs.path.join('build', 'foo');
|
||||
fs.directory(outputPath).createSync(recursive: true);
|
||||
|
||||
when(mockAndroidSdk.ndk).thenReturn(null);
|
||||
|
||||
final int genSnapshotExitCode = await snapshotter.build(
|
||||
platform: TargetPlatform.android_arm,
|
||||
@@ -410,45 +409,8 @@ void main() {
|
||||
buildSharedLibrary: true,
|
||||
);
|
||||
|
||||
expect(genSnapshotExitCode, 0);
|
||||
expect(genSnapshot.callCount, 1);
|
||||
expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm);
|
||||
expect(genSnapshot.snapshotType.mode, BuildMode.release);
|
||||
expect(genSnapshot.additionalArgs, <String>[
|
||||
'--deterministic',
|
||||
'--snapshot_kind=app-aot-elf',
|
||||
'--elf=build/foo/app.so',
|
||||
'--no-sim-use-hardfp',
|
||||
'--no-use-integer-division',
|
||||
'main.dill',
|
||||
]);
|
||||
}, overrides: contextOverrides);
|
||||
|
||||
testUsingContext('builds shared library for android-arm64', () async {
|
||||
fs.file('main.dill').writeAsStringSync('binary magic');
|
||||
|
||||
final String outputPath = fs.path.join('build', 'foo');
|
||||
fs.directory(outputPath).createSync(recursive: true);
|
||||
|
||||
final int genSnapshotExitCode = await snapshotter.build(
|
||||
platform: TargetPlatform.android_arm64,
|
||||
buildMode: BuildMode.release,
|
||||
mainPath: 'main.dill',
|
||||
packagesPath: '.packages',
|
||||
outputPath: outputPath,
|
||||
buildSharedLibrary: true,
|
||||
);
|
||||
|
||||
expect(genSnapshotExitCode, 0);
|
||||
expect(genSnapshot.callCount, 1);
|
||||
expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm64);
|
||||
expect(genSnapshot.snapshotType.mode, BuildMode.release);
|
||||
expect(genSnapshot.additionalArgs, <String>[
|
||||
'--deterministic',
|
||||
'--snapshot_kind=app-aot-elf',
|
||||
'--elf=build/foo/app.so',
|
||||
'main.dill',
|
||||
]);
|
||||
expect(genSnapshotExitCode, isNot(0));
|
||||
expect(genSnapshot.callCount, 0);
|
||||
}, overrides: contextOverrides);
|
||||
|
||||
testUsingContext('builds Android arm release AOT snapshot', () async {
|
||||
|
||||
@@ -286,7 +286,7 @@ Information about project "Runner":
|
||||
platform: TargetPlatform.ios, mode: anyNamed('mode'))).thenReturn('engine');
|
||||
when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm'));
|
||||
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null, targetPlatform: TargetPlatform.ios);
|
||||
final FlutterProject project = FlutterProject.fromPath('path/to/project');
|
||||
await updateGeneratedXcodeProperties(
|
||||
project: project,
|
||||
@@ -304,7 +304,7 @@ Information about project "Runner":
|
||||
when(mockArtifacts.getArtifactPath(Artifact.flutterFramework,
|
||||
platform: TargetPlatform.ios, mode: anyNamed('mode'))).thenReturn('engine');
|
||||
when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm'));
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null, trackWidgetCreation: true);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null, trackWidgetCreation: true, targetPlatform: TargetPlatform.ios);
|
||||
final FlutterProject project = FlutterProject.fromPath('path/to/project');
|
||||
await updateGeneratedXcodeProperties(
|
||||
project: project,
|
||||
@@ -322,7 +322,7 @@ Information about project "Runner":
|
||||
when(mockArtifacts.getArtifactPath(Artifact.flutterFramework,
|
||||
platform: TargetPlatform.ios, mode: anyNamed('mode'))).thenReturn('engine');
|
||||
when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm'));
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null, targetPlatform: TargetPlatform.ios);
|
||||
final FlutterProject project = FlutterProject.fromPath('path/to/project');
|
||||
await updateGeneratedXcodeProperties(
|
||||
project: project,
|
||||
@@ -340,7 +340,7 @@ Information about project "Runner":
|
||||
when(mockArtifacts.getArtifactPath(Artifact.flutterFramework,
|
||||
platform: TargetPlatform.ios, mode: anyNamed('mode'))).thenReturn('engine');
|
||||
when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile'));
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null, targetPlatform: TargetPlatform.ios);
|
||||
|
||||
final FlutterProject project = FlutterProject.fromPath('path/to/project');
|
||||
await updateGeneratedXcodeProperties(
|
||||
|
||||
Reference in New Issue
Block a user