From d3c318ed49258507e4ba0d06f6348dd3c0515d81 Mon Sep 17 00:00:00 2001 From: gaaclarke <30870216+gaaclarke@users.noreply.github.com> Date: Wed, 12 Feb 2020 16:23:01 -0800 Subject: [PATCH] Made xcode_backend stop on error. (#50664) --- packages/flutter_tools/bin/xcode_backend.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/flutter_tools/bin/xcode_backend.sh b/packages/flutter_tools/bin/xcode_backend.sh index 870ad987db..5012c97698 100755 --- a/packages/flutter_tools/bin/xcode_backend.sh +++ b/packages/flutter_tools/bin/xcode_backend.sh @@ -3,6 +3,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +# Exit on error +set -e + RunCommand() { if [[ -n "$VERBOSE_SCRIPT_LOGGING" ]]; then echo "♦ $*" @@ -57,10 +60,12 @@ BuildApp() { # Default value of assets_path is flutter_assets local assets_path="flutter_assets" - # The value of assets_path can set by add FLTAssetsPath to AppFrameworkInfo.plist - FLTAssetsPath=$(/usr/libexec/PlistBuddy -c "Print :FLTAssetsPath" "${derived_dir}/AppFrameworkInfo.plist" 2>/dev/null) - if [[ -n "$FLTAssetsPath" ]]; then - assets_path="${FLTAssetsPath}" + # The value of assets_path can set by add FLTAssetsPath to + # AppFrameworkInfo.plist. + if FLTAssetsPath=$(/usr/libexec/PlistBuddy -c "Print :FLTAssetsPath" "${derived_dir}/AppFrameworkInfo.plist" 2>/dev/null); then + if [[ -n "$FLTAssetsPath" ]]; then + assets_path="${FLTAssetsPath}" + fi fi # Use FLUTTER_BUILD_MODE if it's set, otherwise use the Xcode build configuration name @@ -219,8 +224,7 @@ LipoExecutable() { exit 1 fi else - lipo -output "${output}" -extract "${arch}" "${executable}" - if [[ $? == 0 ]]; then + if lipo -output "${output}" -extract "${arch}" "${executable}"; then all_executables+=("${output}") else echo "Failed to extract ${arch} for ${executable}. Running lipo -info:" @@ -300,9 +304,6 @@ EmbedFlutterFrameworks() { } # Main entry point. - -# TODO(cbracken): improve error handling, then enable set -e - if [[ $# == 0 ]]; then # Backwards-compatibility: if no args are provided, build. BuildApp