mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 00:15:32 +00:00
chore(ios): add extra logging to xcodebuild
Attempt to get more logs that help us to trace issues in build script phases. Test-bot: skip
This commit is contained in:
parent
40ee518d54
commit
c07b40947b
3 changed files with 13 additions and 3 deletions
|
|
@ -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'"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Reference in a new issue