Unverified Commit d0a29dc1 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Allow local networking Info.plist insertion to fail (#78085)

parent 9f4e132f
......@@ -235,8 +235,10 @@ AddObservatoryBonjourService() {
local built_products_plist="${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}"
if [[ ! -f "${built_products_plist}" ]]; then
EchoError "error: ${INFOPLIST_PATH} does not exist. The Flutter \"Thin Binary\" build phase must run after \"Copy Bundle Resources\"."
exit -1
# Very occasionally Xcode hasn't created an Info.plist when this runs.
# The file will be present on re-run.
echo "${INFOPLIST_PATH} does not exist. Skipping _dartobservatory._tcp NSBonjourServices insertion. Try re-building to enable \"flutter attach\"."
return
fi
# If there are already NSBonjourServices specified by the app (uncommon), insert the observatory service name to the existing list.
if plutil -extract NSBonjourServices xml1 -o - "${built_products_plist}"; then
......
......@@ -96,7 +96,7 @@ void main() {
infoPlist = buildDirectory.childFile('Info.plist');
});
test('fails when the Info.plist is missing', () async {
test('handles when the Info.plist is missing', () async {
final ProcessResult result = await Process.run(
xcodeBackendPath,
<String>['test_observatory_bonjour_service'],
......@@ -106,8 +106,8 @@ void main() {
'INFOPLIST_PATH': 'Info.plist',
},
);
expect(result.stderr, startsWith('error: Info.plist does not exist.'));
expect(result.exitCode, isNot(0));
expect(result.stdout, contains('Info.plist does not exist.'));
expect(result.exitCode, 0);
});
const String emptyPlist = '''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment