@@ -66,7 +66,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
66
66
String content = pubspec.readAsStringSync ();
67
67
content = content.replaceFirst (
68
68
'\n dependencies:\n ' ,
69
- '\n dependencies:\n device_info: 0.4.1\n package_info: 0.4.0+9\n ' ,
69
+ '\n dependencies:\n device_info: 0.4.1\n package_info: 0.4.0+9\n connectivity: 3.0.3 \n ' ,
70
70
);
71
71
pubspec.writeAsStringSync (content, flush: true );
72
72
await inDirectory (projectDir, () async {
@@ -284,6 +284,21 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
284
284
'device_info' ,
285
285
);
286
286
await _checkBitcode (pluginFrameworkPath, mode);
287
+ if (! await _linksOnFlutter (pluginFrameworkPath)) {
288
+ throw TaskResult .failure ('$pluginFrameworkPath does not link on Flutter' );
289
+ }
290
+
291
+ final String transitiveDependencyFrameworkPath = path.join (
292
+ outputPath,
293
+ mode,
294
+ 'Reachability.xcframework' ,
295
+ localXcodeArmDirectoryName,
296
+ 'Reachability.framework' ,
297
+ 'Reachability' ,
298
+ );
299
+ if (await _linksOnFlutter (transitiveDependencyFrameworkPath)) {
300
+ throw TaskResult .failure ('Transitive dependency $transitiveDependencyFrameworkPath unexpectedly links on Flutter' );
301
+ }
287
302
288
303
checkFileExists (path.join (
289
304
outputPath,
@@ -407,6 +422,18 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
407
422
mode,
408
423
'package_info.xcframework' ,
409
424
));
425
+
426
+ checkDirectoryExists (path.join (
427
+ cocoapodsOutputPath,
428
+ mode,
429
+ 'connectivity.xcframework' ,
430
+ ));
431
+
432
+ checkDirectoryExists (path.join (
433
+ cocoapodsOutputPath,
434
+ mode,
435
+ 'Reachability.xcframework' ,
436
+ ));
410
437
}
411
438
412
439
if (File (path.join (
@@ -443,3 +470,13 @@ Future<String> _dylibSymbols(String pathToDylib) {
443
470
'arm64' ,
444
471
]);
445
472
}
473
+
474
+ Future <bool > _linksOnFlutter (String pathToBinary) async {
475
+ final String loadCommands = await eval ('otool' , < String > [
476
+ '-l' ,
477
+ '-arch' ,
478
+ 'arm64' ,
479
+ pathToBinary,
480
+ ]);
481
+ return loadCommands.contains ('Flutter.framework' );
482
+ }
0 commit comments