Made xcode_backend stop on error. (#50664)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user