Fix watchOS build when companion app is configured with xcode variable (#84519)

This commit is contained in:
Mirko Mucaria
2021-06-17 23:14:03 +02:00
committed by GitHub
parent e57d97afd8
commit bce1706f1c
6 changed files with 41 additions and 4 deletions

View File

@@ -697,6 +697,24 @@ apply plugin: 'kotlin-android'
XcodeProjectInterpreter: () => mockXcodeProjectInterpreter,
FlutterProjectFactory: () => flutterProjectFactory,
});
testUsingContext('has watch companion with build settings', () async {
final FlutterProject project = await someProject();
project.ios.xcodeProject.createSync();
mockXcodeProjectInterpreter.buildSettings = <String, String>{
'PRODUCT_BUNDLE_IDENTIFIER': 'io.flutter.someProject',
};
project.ios.hostAppRoot.childDirectory('WatchTarget').childFile('Info.plist').createSync(recursive: true);
testPlistParser.setProperty('WKCompanionAppBundleIdentifier', r'$(PRODUCT_BUNDLE_IDENTIFIER)');
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null), isTrue);
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(),
PlistParser: () => testPlistParser,
XcodeProjectInterpreter: () => mockXcodeProjectInterpreter,
FlutterProjectFactory: () => flutterProjectFactory,
});
});
});
}