Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mac/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ execBuildCommand() {
eval "$cmnd" || ret_code=$?
set -e

mac_print_xcode_build_script_logs
mac_print_xcode_build_script_logs $ret_code

if [ $ret_code != 0 ]; then
builder_die "Build of $component failed! Error: [$ret_code] when executing command: '$cmnd'"
Expand Down
13 changes: 11 additions & 2 deletions resources/build/mac/mac.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,16 @@ function _mac_generate_xcode_environment_definition_script() {
# If there is no logfile, then this function will not emit anything.
#
mac_print_xcode_build_script_logs() {
local ret_code="$1"
local SCRIPT_LOG="$KEYMAN_ROOT/xcodebuild-scripts.log"
if [ -f "$SCRIPT_LOG" ]; then
builder_echo "mac_print_xcode_build_script_logs: reporting script results from previous xcode build"
builder_echo "mac_print_xcode_build_script_logs: reporting script results from previous xcode build (exit code $ret_code)"
cat "$SCRIPT_LOG"
rm "$SCRIPT_LOG"
builder_echo "mac_print_xcode_build_script_logs: done"
echo
elif [[ $1 != 0 ]]; then
builder_echo error "mac_print_xcode_build_script_logs: build failed with $ret_code; expected $SCRIPT_LOG to exist"
fi
}

Expand All @@ -133,6 +136,9 @@ mac_print_xcode_build_script_logs() {
mac_xcodebuild() {
typeset cmnd="$*"
typeset ret_code

builder_echo "mac_xcodebuild: start xcodebuild $cmnd"

local hasSetErrExit=false
if [ -o errexit ]; then
hasSetErrExit=true
Expand All @@ -144,7 +150,10 @@ mac_xcodebuild() {
set -e
fi

mac_print_xcode_build_script_logs
mac_print_xcode_build_script_logs $ret_code

builder_echo "mac_xcodebuild: finish xcodebuild $cmnd"

if [ $ret_code != 0 ]; then
builder_die "Build failed! Error: [$ret_code] when executing command: 'xcodebuild $cmnd'"
fi
Expand Down
1 change: 1 addition & 0 deletions resources/build/mac/xcode-utils.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ function phaseSentryDsymUpload() {
function logScriptsToFile() {
local SCRIPT_LOG="$KEYMAN_ROOT/xcodebuild-scripts.log"
exec >> "$SCRIPT_LOG" 2>&1
echo "Logging xcode build phase script to $KEYMAN_ROOT/xcodebuild-scripts.log"
}

logScriptsToFile
Loading