Bundle ios dependencies (#34669)
This updates the flutter tool to cache binary files for ideviceinstaller, ios-deploy, libimobiledevice, and dynamically linked dependencies from Flutter's GCP bucket.
This commit is contained in:
committed by
GitHub
parent
90326b6184
commit
14d489adc5
@@ -392,9 +392,34 @@ class IosDeviceDiscovery implements DeviceDiscovery {
|
||||
_workingDevice = allDevices[math.Random().nextInt(allDevices.length)];
|
||||
}
|
||||
|
||||
// Returns the path to cached binaries relative to devicelab directory
|
||||
String get _artifactDirPath {
|
||||
return path.normalize(
|
||||
path.join(
|
||||
path.current,
|
||||
'../../bin/cache/artifacts',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Returns a colon-separated environment variable that contains the paths
|
||||
// of linked libraries for idevice_id
|
||||
Map<String, String> get _ideviceIdEnvironment {
|
||||
final String libPath = const <String>[
|
||||
'libimobiledevice',
|
||||
'usbmuxd',
|
||||
'libplist',
|
||||
'openssl',
|
||||
'ideviceinstaller',
|
||||
'ios-deploy',
|
||||
].map((String packageName) => path.join(_artifactDirPath, packageName)).join(':');
|
||||
return <String, String>{'DYLD_LIBRARY_PATH': libPath};
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<String>> discoverDevices() async {
|
||||
final List<String> iosDeviceIDs = LineSplitter.split(await eval('idevice_id', <String>['-l']))
|
||||
final String ideviceIdPath = path.join(_artifactDirPath, 'libimobiledevice', 'idevice_id');
|
||||
final List<String> iosDeviceIDs = LineSplitter.split(await eval(ideviceIdPath, <String>['-l'], environment: _ideviceIdEnvironment))
|
||||
.map<String>((String line) => line.trim())
|
||||
.where((String line) => line.isNotEmpty)
|
||||
.toList();
|
||||
|
||||
Reference in New Issue
Block a user