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

This commit is contained in:
Jenn Magder 2021-03-13 14:38:02 -08:00 committed by GitHub
parent 9f4e132fb8
commit d0a29dc10c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View file

@ -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

View file

@ -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 = '''