Improved build scripts

This commit is contained in:
WolverinDEV 2020-01-24 14:20:35 +01:00
parent 0bde0844e0
commit 18ae8e736c

View File

@ -24,22 +24,6 @@ source ${build_helper_file}
begin_task "build_third_party" "Building libraries" begin_task "build_third_party" "Building libraries"
function exec_script() {
name=$(echo "$1" | sed -n -E 's:^build_(.*)\.sh:\1:p')
begin_task "build_$name" "Building $name"
echo -e "Building library with script $color_green${1}$color_normal"
./${1}
if [[ $? -ne 0 ]]; then
echo "Failed to build library $name. Status code: $?"
exit 1
fi
#Log the result
end_task "build_$name" "Finished $name"
echo ""
}
function exec_script_external() { function exec_script_external() {
name=$(echo "$1" | sed -n -E 's:^build_(.*)\.sh:\1:p') name=$(echo "$1" | sed -n -E 's:^build_(.*)\.sh:\1:p')
begin_task "build_$name" "Building $name" begin_task "build_$name" "Building $name"
@ -47,8 +31,9 @@ function exec_script_external() {
echo -e "Building library with script $color_green${1}$color_normal" echo -e "Building library with script $color_green${1}$color_normal"
_prefix="library_path=\"$2\" ${*:3}" _prefix="library_path=\"$2\" ${*:3}"
eval $_prefix ./${build_helper_scripts}/"${1}" eval $_prefix ./${build_helper_scripts}/"${1}"
if [[ $? -ne 0 ]]; then code=$?
echo "Failed to build library $name. Status code: $?" if [[ $code -ne 0 ]]; then
echo "Failed to build library $name. Status code: $code"
exit 1 exit 1
fi fi