Unverified Commit d3c318ed authored by gaaclarke's avatar gaaclarke Committed by GitHub

Made xcode_backend stop on error. (#50664)

parent d57d4935
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
# Exit on error
set -e
RunCommand() { RunCommand() {
if [[ -n "$VERBOSE_SCRIPT_LOGGING" ]]; then if [[ -n "$VERBOSE_SCRIPT_LOGGING" ]]; then
echo "♦ $*" echo "♦ $*"
...@@ -57,10 +60,12 @@ BuildApp() { ...@@ -57,10 +60,12 @@ BuildApp() {
# Default value of assets_path is flutter_assets # Default value of assets_path is flutter_assets
local assets_path="flutter_assets" local assets_path="flutter_assets"
# The value of assets_path can set by add FLTAssetsPath to AppFrameworkInfo.plist # The value of assets_path can set by add FLTAssetsPath to
FLTAssetsPath=$(/usr/libexec/PlistBuddy -c "Print :FLTAssetsPath" "${derived_dir}/AppFrameworkInfo.plist" 2>/dev/null) # AppFrameworkInfo.plist.
if [[ -n "$FLTAssetsPath" ]]; then if FLTAssetsPath=$(/usr/libexec/PlistBuddy -c "Print :FLTAssetsPath" "${derived_dir}/AppFrameworkInfo.plist" 2>/dev/null); then
assets_path="${FLTAssetsPath}" if [[ -n "$FLTAssetsPath" ]]; then
assets_path="${FLTAssetsPath}"
fi
fi fi
# Use FLUTTER_BUILD_MODE if it's set, otherwise use the Xcode build configuration name # Use FLUTTER_BUILD_MODE if it's set, otherwise use the Xcode build configuration name
...@@ -219,8 +224,7 @@ LipoExecutable() { ...@@ -219,8 +224,7 @@ LipoExecutable() {
exit 1 exit 1
fi fi
else else
lipo -output "${output}" -extract "${arch}" "${executable}" if lipo -output "${output}" -extract "${arch}" "${executable}"; then
if [[ $? == 0 ]]; then
all_executables+=("${output}") all_executables+=("${output}")
else else
echo "Failed to extract ${arch} for ${executable}. Running lipo -info:" echo "Failed to extract ${arch} for ${executable}. Running lipo -info:"
...@@ -300,9 +304,6 @@ EmbedFlutterFrameworks() { ...@@ -300,9 +304,6 @@ EmbedFlutterFrameworks() {
} }
# Main entry point. # Main entry point.
# TODO(cbracken): improve error handling, then enable set -e
if [[ $# == 0 ]]; then if [[ $# == 0 ]]; then
# Backwards-compatibility: if no args are provided, build. # Backwards-compatibility: if no args are provided, build.
BuildApp BuildApp
......
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