Add a new PrebuiltFlutterApplicationPackage interface. (#95290)

* Add a new PrebuiltFlutterApplicationPackage interface.

* Review feedback

* Rename bundleDir to uncompressedBundle
This commit is contained in:
Lau Ching Jun 2022-01-05 07:54:57 -08:00 committed by GitHub
parent 7444ad8da4
commit 7f0050f5b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 166 additions and 80 deletions

View File

@ -362,7 +362,7 @@ class AndroidDevice extends Device {
}
String _getSourceSha1(AndroidApk apk) {
final File shaFile = _fileSystem.file('${apk.file.path}.sha1');
final File shaFile = _fileSystem.file('${apk.applicationPackage.path}.sha1');
return shaFile.existsSync() ? shaFile.readAsStringSync() : '';
}
@ -435,13 +435,13 @@ class AndroidDevice extends Device {
AndroidApk app, {
String? userIdentifier,
}) async {
if (!app.file.existsSync()) {
_logger.printError('"${_fileSystem.path.relative(app.file.path)}" does not exist.');
if (!app.applicationPackage.existsSync()) {
_logger.printError('"${_fileSystem.path.relative(app.applicationPackage.path)}" does not exist.');
return false;
}
final Status status = _logger.startProgress(
'Installing ${_fileSystem.path.relative(app.file.path)}...',
'Installing ${_fileSystem.path.relative(app.applicationPackage.path)}...',
);
final RunResult installResult = await _processUtils.run(
adbCommandForDevice(<String>[
@ -450,7 +450,7 @@ class AndroidDevice extends Device {
'-r',
if (userIdentifier != null)
...<String>['--user', userIdentifier],
app.file.path
app.applicationPackage.path
]));
status.stop();
// Some versions of adb exit with exit code 0 even on failure :(

View File

@ -21,13 +21,13 @@ import 'android_sdk.dart';
import 'gradle.dart';
/// An application package created from an already built Android APK.
class AndroidApk extends ApplicationPackage {
class AndroidApk extends ApplicationPackage implements PrebuiltApplicationPackage {
AndroidApk({
required String id,
required this.file,
required this.applicationPackage,
required this.versionCode,
required this.launchActivity,
}) : assert(file != null),
}) : assert(applicationPackage != null),
assert(launchActivity != null),
super(id: id);
@ -80,14 +80,14 @@ class AndroidApk extends ApplicationPackage {
return AndroidApk(
id: packageName,
file: apk,
applicationPackage: apk,
versionCode: data.versionCode == null ? null : int.tryParse(data.versionCode!),
launchActivity: '${data.packageName}/${data.launchableActivityName}',
);
}
/// Path to the actual apk file.
final File file;
@override
final FileSystemEntity applicationPackage;
/// The path to the activity that should be launched.
final String launchActivity;
@ -197,14 +197,14 @@ class AndroidApk extends ApplicationPackage {
return AndroidApk(
id: packageId,
file: apkFile,
applicationPackage: apkFile,
versionCode: null,
launchActivity: launchActivity,
);
}
@override
String get name => file.basename;
String get name => applicationPackage.basename;
}
abstract class _Entry {

View File

@ -31,3 +31,12 @@ abstract class ApplicationPackage {
@override
String toString() => displayName ?? id;
}
/// An interface for application package that is created from prebuilt binary.
abstract class PrebuiltApplicationPackage implements ApplicationPackage {
/// The application bundle of the prebuilt application.
///
/// The same ApplicationPackage should be able to be recreated by passing
/// the file to [FlutterApplicationPackageFactory.getPackageForPlatform].
FileSystemEntity get applicationPackage;
}

View File

@ -33,7 +33,7 @@ abstract class FuchsiaApp extends ApplicationPackage {
return null;
}
return PrebuiltFuchsiaApp(
farArchive: applicationBinary.path,
applicationPackage: applicationBinary,
);
}
@ -44,20 +44,20 @@ abstract class FuchsiaApp extends ApplicationPackage {
File farArchive(BuildMode buildMode);
}
class PrebuiltFuchsiaApp extends FuchsiaApp {
class PrebuiltFuchsiaApp extends FuchsiaApp implements PrebuiltApplicationPackage {
PrebuiltFuchsiaApp({
required String farArchive,
}) : _farArchive = farArchive,
// TODO(zanderso): Extract the archive and extract the id from meta/package.
super(projectBundleId: farArchive);
final String _farArchive;
required this.applicationPackage,
}) : // TODO(zanderso): Extract the archive and extract the id from meta/package.
super(projectBundleId: applicationPackage.path);
@override
File farArchive(BuildMode buildMode) => globals.fs.file(_farArchive);
File farArchive(BuildMode buildMode) => globals.fs.file(applicationPackage);
@override
String get name => _farArchive;
String get name => applicationPackage.path;
@override
final FileSystemEntity applicationPackage;
}
class BuildableFuchsiaApp extends FuchsiaApp {

View File

@ -23,14 +23,14 @@ abstract class IOSApp extends ApplicationPackage {
'File "${applicationBinary.path}" does not exist. Use an app bundle or an ipa.');
return null;
}
Directory bundleDir;
Directory uncompressedBundle;
if (entityType == FileSystemEntityType.directory) {
final Directory directory = globals.fs.directory(applicationBinary);
if (!_isBundleDirectory(directory)) {
globals.printError('Folder "${applicationBinary.path}" is not an app bundle.');
return null;
}
bundleDir = globals.fs.directory(applicationBinary);
uncompressedBundle = globals.fs.directory(applicationBinary);
} else {
// Try to unpack as an ipa.
final Directory tempDir = globals.fs.systemTempDirectory.createTempSync('flutter_app.');
@ -44,14 +44,14 @@ abstract class IOSApp extends ApplicationPackage {
return null;
}
try {
bundleDir = payloadDir.listSync().whereType<Directory>().singleWhere(_isBundleDirectory);
uncompressedBundle = payloadDir.listSync().whereType<Directory>().singleWhere(_isBundleDirectory);
} on StateError {
globals.printError(
'Invalid prebuilt iOS ipa. Does not contain a single app bundle.');
return null;
}
}
final String plistPath = globals.fs.path.join(bundleDir.path, 'Info.plist');
final String plistPath = globals.fs.path.join(uncompressedBundle.path, 'Info.plist');
if (!globals.fs.file(plistPath).existsSync()) {
globals.printError('Invalid prebuilt iOS app. Does not contain Info.plist.');
return null;
@ -66,9 +66,10 @@ abstract class IOSApp extends ApplicationPackage {
}
return PrebuiltIOSApp(
bundleDir: bundleDir,
bundleName: globals.fs.path.basename(bundleDir.path),
uncompressedBundle: uncompressedBundle,
bundleName: globals.fs.path.basename(uncompressedBundle.path),
projectBundleId: id,
applicationPackage: applicationBinary,
);
}
@ -152,14 +153,19 @@ class BuildableIOSApp extends IOSApp {
}
}
class PrebuiltIOSApp extends IOSApp {
class PrebuiltIOSApp extends IOSApp implements PrebuiltApplicationPackage {
PrebuiltIOSApp({
required this.bundleDir,
required this.uncompressedBundle,
this.bundleName,
required String projectBundleId,
required this.applicationPackage,
}) : super(projectBundleId: projectBundleId);
final Directory bundleDir;
/// The uncompressed bundle of the application.
///
/// [IOSApp.fromPrebuiltApp] will uncompress the application into a temporary
/// directory even when an `.ipa` file was used to create the [IOSApp] instance.
final Directory uncompressedBundle;
final String? bundleName;
@override
@ -174,5 +180,11 @@ class PrebuiltIOSApp extends IOSApp {
@override
String get deviceBundlePath => _bundlePath;
String get _bundlePath => bundleDir.path;
String get _bundlePath => uncompressedBundle.path;
/// A [File] or [Directory] pointing to the application bundle.
///
/// This can be either an `.ipa` file or an uncompressed `.app` directory.
@override
final FileSystemEntity applicationPackage;
}

View File

@ -38,10 +38,11 @@ abstract class MacOSApp extends ApplicationPackage {
}
return PrebuiltMacOSApp(
bundleDir: bundleInfo.bundle,
bundleName: bundleInfo.bundle.path,
uncompressedBundle: bundleInfo.uncompressedBundle,
bundleName: bundleInfo.uncompressedBundle.path,
projectBundleId: bundleInfo.id,
executable: bundleInfo.executable,
applicationPackage: applicationBinary,
);
}
@ -52,14 +53,14 @@ abstract class MacOSApp extends ApplicationPackage {
globals.printError('File "${applicationBundle.path}" does not exist.');
return null;
}
Directory bundleDir;
Directory uncompressedBundle;
if (entityType == FileSystemEntityType.directory) {
final Directory directory = globals.fs.directory(applicationBundle);
if (!_isBundleDirectory(directory)) {
globals.printError('Folder "${applicationBundle.path}" is not an app bundle.');
return null;
}
bundleDir = globals.fs.directory(applicationBundle);
uncompressedBundle = globals.fs.directory(applicationBundle);
} else {
// Try to unpack as a zip.
final Directory tempDir = globals.fs.systemTempDirectory.createTempSync('flutter_app.');
@ -70,7 +71,7 @@ abstract class MacOSApp extends ApplicationPackage {
return null;
}
try {
bundleDir = tempDir
uncompressedBundle = tempDir
.listSync()
.whereType<Directory>()
.singleWhere(_isBundleDirectory);
@ -79,7 +80,7 @@ abstract class MacOSApp extends ApplicationPackage {
return null;
}
}
final String plistPath = globals.fs.path.join(bundleDir.path, 'Contents', 'Info.plist');
final String plistPath = globals.fs.path.join(uncompressedBundle.path, 'Contents', 'Info.plist');
if (!globals.fs.file(plistPath).existsSync()) {
globals.printError('Invalid prebuilt macOS app. Does not contain Info.plist.');
return null;
@ -95,11 +96,11 @@ abstract class MacOSApp extends ApplicationPackage {
globals.printError('Invalid prebuilt macOS app. Info.plist does not contain bundle executable');
return null;
}
final String executable = globals.fs.path.join(bundleDir.path, 'Contents', 'MacOS', executableName);
final String executable = globals.fs.path.join(uncompressedBundle.path, 'Contents', 'MacOS', executableName);
if (!globals.fs.file(executable).existsSync()) {
globals.printError('Could not find macOS binary at $executable');
}
return _BundleInfo(executable, id, bundleDir);
return _BundleInfo(executable, id, uncompressedBundle);
}
@override
@ -110,16 +111,21 @@ abstract class MacOSApp extends ApplicationPackage {
String? executable(BuildMode buildMode);
}
class PrebuiltMacOSApp extends MacOSApp {
class PrebuiltMacOSApp extends MacOSApp implements PrebuiltApplicationPackage {
PrebuiltMacOSApp({
required this.bundleDir,
required this.uncompressedBundle,
required this.bundleName,
required this.projectBundleId,
required String executable,
required this.applicationPackage,
}) : _executable = executable,
super(projectBundleId: projectBundleId);
final Directory bundleDir;
/// The uncompressed bundle of the application.
///
/// [MacOSApp.fromPrebuiltApp] will uncompress the application into a temporary
/// directory even when an `.zip` file was used to create the [MacOSApp] instance.
final Directory uncompressedBundle;
final String bundleName;
final String projectBundleId;
@ -129,10 +135,16 @@ class PrebuiltMacOSApp extends MacOSApp {
String get name => bundleName;
@override
String? applicationBundle(BuildMode buildMode) => bundleDir.path;
String? applicationBundle(BuildMode buildMode) => uncompressedBundle.path;
@override
String? executable(BuildMode buildMode) => _executable;
/// A [File] or [Directory] pointing to the application bundle.
///
/// This can be either a `.zip` file or an uncompressed `.app` directory.
@override
final FileSystemEntity applicationPackage;
}
class BuildableMacOSApp extends MacOSApp {
@ -170,9 +182,9 @@ class BuildableMacOSApp extends MacOSApp {
}
class _BundleInfo {
_BundleInfo(this.executable, this.id, this.bundle);
_BundleInfo(this.executable, this.id, this.uncompressedBundle);
final Directory bundle;
final Directory uncompressedBundle;
final String executable;
final String id;
}

View File

@ -68,7 +68,7 @@ void main() {
final File apkFile = fileSystem.file('app.apk')..createSync();
final AndroidApk apk = AndroidApk(
id: 'FlutterApp',
file: apkFile,
applicationPackage: apkFile,
launchActivity: 'FlutterActivity',
versionCode: 1,
);
@ -133,7 +133,7 @@ void main() {
final File apkFile = fileSystem.file('app.apk')..createSync();
final AndroidApk apk = AndroidApk(
id: 'FlutterApp',
file: apkFile,
applicationPackage: apkFile,
launchActivity: 'FlutterActivity',
versionCode: 1,
);
@ -171,7 +171,7 @@ void main() {
final File apkFile = fileSystem.file('app.apk')..createSync();
final AndroidApk apk = AndroidApk(
id: 'FlutterApp',
file: apkFile,
applicationPackage: apkFile,
launchActivity: 'FlutterActivity',
versionCode: 1,
);

View File

@ -73,7 +73,7 @@ void main() {
]);
final File apk = fileSystem.file('app.apk')..createSync();
final AndroidApk androidApk = AndroidApk(
file: apk,
applicationPackage: apk,
id: 'app',
versionCode: 22,
launchActivity: 'Main',
@ -89,7 +89,7 @@ void main() {
testWithoutContext('Cannot install app if APK file is missing', () async {
final File apk = fileSystem.file('app.apk');
final AndroidApk androidApk = AndroidApk(
file: apk,
applicationPackage: apk,
id: 'app',
versionCode: 22,
launchActivity: 'Main',
@ -117,7 +117,7 @@ void main() {
]);
final File apk = fileSystem.file('app.apk')..createSync();
final AndroidApk androidApk = AndroidApk(
file: apk,
applicationPackage: apk,
id: 'app',
versionCode: 22,
launchActivity: 'Main',
@ -146,7 +146,7 @@ void main() {
]);
final File apk = fileSystem.file('app.apk')..createSync();
final AndroidApk androidApk = AndroidApk(
file: apk,
applicationPackage: apk,
id: 'app',
versionCode: 22,
launchActivity: 'Main',
@ -190,7 +190,7 @@ void main() {
]);
final File apk = fileSystem.file('app.apk')..createSync();
final AndroidApk androidApk = AndroidApk(
file: apk,
applicationPackage: apk,
id: 'app',
versionCode: 22,
launchActivity: 'Main',
@ -224,7 +224,7 @@ void main() {
final File apk = fileSystem.file('app.apk')..createSync();
fileSystem.file('app.apk.sha1').writeAsStringSync('example_sha');
final AndroidApk androidApk = AndroidApk(
file: apk,
applicationPackage: apk,
id: 'app',
versionCode: 22,
launchActivity: 'Main',
@ -265,7 +265,7 @@ void main() {
final File apk = fileSystem.file('app.apk')..createSync();
fileSystem.file('app.apk.sha1').writeAsStringSync('example_sha');
final AndroidApk androidApk = AndroidApk(
file: apk,
applicationPackage: apk,
id: 'app',
versionCode: 22,
launchActivity: 'Main',
@ -298,7 +298,7 @@ void main() {
]);
final File apk = fileSystem.file('app.apk')..createSync();
final AndroidApk androidApk = AndroidApk(
file: apk,
applicationPackage: apk,
id: 'app',
versionCode: 22,
launchActivity: 'Main',

View File

@ -84,6 +84,8 @@ void main() {
applicationBinary: apkFile,
);
expect(applicationPackage.name, 'app.apk');
expect(applicationPackage, isA<PrebuiltApplicationPackage>());
expect((applicationPackage as PrebuiltApplicationPackage).applicationPackage.path, apkFile.path);
expect(fakeProcessManager.hasRemainingExpectations, isFalse);
}, overrides: overrides);
@ -298,9 +300,10 @@ void main() {
testPlistParser.setProperty('CFBundleIdentifier', 'fooBundleId');
final PrebuiltIOSApp iosApp = IOSApp.fromPrebuiltApp(globals.fs.file('bundle.app')) as PrebuiltIOSApp;
expect(testLogger.errorText, isEmpty);
expect(iosApp.bundleDir.path, 'bundle.app');
expect(iosApp.uncompressedBundle.path, 'bundle.app');
expect(iosApp.id, 'fooBundleId');
expect(iosApp.bundleName, 'bundle.app');
expect(iosApp.applicationPackage.path, globals.fs.directory('bundle.app').path);
}, overrides: overrides);
testUsingContext('Bad ipa zip-file, no payload dir', () {
@ -348,9 +351,10 @@ void main() {
};
final PrebuiltIOSApp iosApp = IOSApp.fromPrebuiltApp(globals.fs.file('app.ipa')) as PrebuiltIOSApp;
expect(testLogger.errorText, isEmpty);
expect(iosApp.bundleDir.path, endsWith('bundle.app'));
expect(iosApp.uncompressedBundle.path, endsWith('bundle.app'));
expect(iosApp.id, 'fooBundleId');
expect(iosApp.bundleName, 'bundle.app');
expect(iosApp.applicationPackage.path, globals.fs.file('app.ipa').path);
}, overrides: overrides);
testUsingContext('returns null when there is no ios or .ios directory', () async {
@ -427,6 +431,7 @@ void main() {
final PrebuiltFuchsiaApp fuchsiaApp = FuchsiaApp.fromPrebuiltApp(globals.fs.file('bundle.far')) as PrebuiltFuchsiaApp;
expect(testLogger.errorText, isEmpty);
expect(fuchsiaApp.id, 'bundle.far');
expect(fuchsiaApp.applicationPackage.path, globals.fs.file('bundle.far').path);
}, overrides: overrides);
testUsingContext('returns null when there is no fuchsia', () async {

View File

@ -43,7 +43,8 @@ void main() {
testWithoutContext('IOSDevice.installApp calls ios-deploy correctly with USB', () async {
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
bundleDir: fileSystem.currentDirectory,
uncompressedBundle: fileSystem.currentDirectory,
applicationPackage: bundleDirectory,
);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: <String>[
@ -73,7 +74,8 @@ void main() {
testWithoutContext('IOSDevice.installApp calls ios-deploy correctly with network', () async {
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
bundleDir: fileSystem.currentDirectory,
uncompressedBundle: fileSystem.currentDirectory,
applicationPackage: bundleDirectory,
);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: <String>[
@ -100,7 +102,11 @@ void main() {
});
testWithoutContext('IOSDevice.uninstallApp calls ios-deploy correctly', () async {
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app', bundleDir: bundleDirectory);
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
uncompressedBundle: bundleDirectory,
applicationPackage: bundleDirectory,
);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: <String>[
iosDeployPath,
@ -123,7 +129,11 @@ void main() {
group('isAppInstalled', () {
testWithoutContext('catches ProcessException from ios-deploy', () async {
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app', bundleDir: bundleDirectory);
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
uncompressedBundle: bundleDirectory,
applicationPackage: bundleDirectory,
);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: <String>[
iosDeployPath,
@ -147,7 +157,11 @@ void main() {
});
testWithoutContext('returns true when app is installed', () async {
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app', bundleDir: bundleDirectory);
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
uncompressedBundle: bundleDirectory,
applicationPackage: bundleDirectory,
);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: <String>[
iosDeployPath,
@ -171,7 +185,11 @@ void main() {
});
testWithoutContext('returns false when app is not installed', () async {
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app', bundleDir: bundleDirectory);
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
uncompressedBundle: bundleDirectory,
applicationPackage: bundleDirectory,
);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: <String>[
iosDeployPath,
@ -197,7 +215,11 @@ void main() {
});
testWithoutContext('returns false on command timeout or other error', () async {
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app', bundleDir: bundleDirectory);
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
uncompressedBundle: bundleDirectory,
applicationPackage: bundleDirectory,
);
const String stderr = '2020-03-26 17:48:43.484 ios-deploy[21518:5501783] [ !! ] Timed out waiting for device';
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: <String>[
@ -228,7 +250,8 @@ void main() {
testWithoutContext('IOSDevice.installApp catches ProcessException from ios-deploy', () async {
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
bundleDir: fileSystem.currentDirectory,
uncompressedBundle: fileSystem.currentDirectory,
applicationPackage: bundleDirectory,
);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: <String>[
@ -250,7 +273,11 @@ void main() {
});
testWithoutContext('IOSDevice.uninstallApp catches ProcessException from ios-deploy', () async {
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app', bundleDir: bundleDirectory);
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
uncompressedBundle: bundleDirectory,
applicationPackage: bundleDirectory,
);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: <String>[
iosDeployPath,

View File

@ -93,7 +93,8 @@ void main() {
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
bundleName: 'Runner',
bundleDir: MemoryFileSystem.test().directory('bundle'),
uncompressedBundle: MemoryFileSystem.test().directory('bundle'),
applicationPackage: MemoryFileSystem.test().directory('bundle'),
);
device.portForwarder = devicePortForwarder;
@ -116,7 +117,8 @@ void main() {
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
bundleName: 'Runner',
bundleDir: fileSystem.currentDirectory,
uncompressedBundle: fileSystem.currentDirectory,
applicationPackage: fileSystem.currentDirectory,
);
final FakeDeviceLogReader deviceLogReader = FakeDeviceLogReader();
@ -153,7 +155,8 @@ void main() {
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
bundleName: 'Runner',
bundleDir: fileSystem.currentDirectory,
uncompressedBundle: fileSystem.currentDirectory,
applicationPackage: fileSystem.currentDirectory,
);
final FakeDeviceLogReader deviceLogReader = FakeDeviceLogReader();
@ -191,7 +194,8 @@ void main() {
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
bundleName: 'Runner',
bundleDir: fileSystem.currentDirectory,
uncompressedBundle: fileSystem.currentDirectory,
applicationPackage: fileSystem.currentDirectory,
);
final FakeDeviceLogReader deviceLogReader = FakeDeviceLogReader();
@ -230,7 +234,8 @@ void main() {
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
bundleName: 'Runner',
bundleDir: fileSystem.currentDirectory,
uncompressedBundle: fileSystem.currentDirectory,
applicationPackage: fileSystem.currentDirectory,
);
final LaunchResult launchResult = await device.startApp(iosApp,
@ -296,7 +301,8 @@ void main() {
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
bundleName: 'Runner',
bundleDir: fileSystem.currentDirectory,
uncompressedBundle: fileSystem.currentDirectory,
applicationPackage: fileSystem.currentDirectory,
);
final FakeDeviceLogReader deviceLogReader = FakeDeviceLogReader();

View File

@ -917,7 +917,12 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
testPlistParser.setProperty('CFBundleIdentifier', 'correct');
final Directory mockDir = globals.fs.currentDirectory;
final IOSApp package = PrebuiltIOSApp(projectBundleId: 'incorrect', bundleName: 'name', bundleDir: mockDir);
final IOSApp package = PrebuiltIOSApp(
projectBundleId: 'incorrect',
bundleName: 'name',
uncompressedBundle: mockDir,
applicationPackage: mockDir,
);
const BuildInfo mockInfo = BuildInfo(BuildMode.debug, 'flavor', treeShakeIcons: false);
final DebuggingOptions mockOptions = DebuggingOptions.disabled(mockInfo);
@ -940,7 +945,12 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
);
final Directory mockDir = globals.fs.currentDirectory;
final IOSApp package = PrebuiltIOSApp(projectBundleId: 'incorrect', bundleName: 'name', bundleDir: mockDir);
final IOSApp package = PrebuiltIOSApp(
projectBundleId: 'incorrect',
bundleName: 'name',
uncompressedBundle: mockDir,
applicationPackage: mockDir,
);
const BuildInfo mockInfo = BuildInfo(BuildMode.debug, 'flavor', treeShakeIcons: false);
final DebuggingOptions mockOptions = DebuggingOptions.disabled(mockInfo);
@ -967,7 +977,12 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
testPlistParser.setProperty('CFBundleIdentifier', 'correct');
final Directory mockDir = globals.fs.currentDirectory;
final IOSApp package = PrebuiltIOSApp(projectBundleId: 'correct', bundleName: 'name', bundleDir: mockDir);
final IOSApp package = PrebuiltIOSApp(
projectBundleId: 'correct',
bundleName: 'name',
uncompressedBundle: mockDir,
applicationPackage: mockDir,
);
const BuildInfo mockInfo = BuildInfo(BuildMode.debug, 'flavor', treeShakeIcons: false);
final DebuggingOptions mockOptions = DebuggingOptions.enabled(mockInfo, enableSoftwareRendering: true);

View File

@ -100,7 +100,7 @@ group('PrebuiltMacOSApp', () {
final PrebuiltMacOSApp macosApp = MacOSApp.fromPrebuiltApp(fileSystem.file('bundle.app')) as PrebuiltMacOSApp;
expect(logger.errorText, isEmpty);
expect(macosApp.bundleDir.path, 'bundle.app');
expect(macosApp.uncompressedBundle.path, 'bundle.app');
expect(macosApp.id, 'fooBundleId');
expect(macosApp.bundleName, 'bundle.app');
}, overrides: overrides);
@ -152,7 +152,7 @@ group('PrebuiltMacOSApp', () {
final PrebuiltMacOSApp macosApp = MacOSApp.fromPrebuiltApp(fileSystem.file('app.zip')) as PrebuiltMacOSApp;
expect(logger.errorText, isEmpty);
expect(macosApp.bundleDir.path, endsWith('bundle.app'));
expect(macosApp.uncompressedBundle.path, endsWith('bundle.app'));
expect(macosApp.id, 'fooBundleId');
expect(macosApp.bundleName, endsWith('bundle.app'));
}, overrides: overrides);