Skip to content

Commit

Permalink
add pre-build checks that ensure the GSDK submodule has been pulled p…
Browse files Browse the repository at this point in the history
…roperly
  • Loading branch information
lmnotran committed Feb 8, 2024
1 parent 141e147 commit 80337be
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion script/build
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ else
fi
script_dir="$(realpath "$(dirname "${script_path}")")"
repo_dir="$(dirname "${script_dir}")"
gsdk_dir="${repo_dir}/third_party/silabs/gecko_sdk"

# shellcheck source=script/efr32-definitions
source "${repo_dir}/script/efr32-definitions"
Expand All @@ -46,6 +47,39 @@ source "${repo_dir}/script/util"

set -euxo pipefail

# ==============================================================================
# Pre-build checks

set +x
echo "========================================================================================================="
echo "Check if the Git LFS package is installed"
echo "========================================================================================================="
set -x
if ! git lfs >/dev/null; then
set +x
echo "ERROR: Git LFS is not installed"
echo
echo "Please run './script/bootstrap packages'" to install it
exit 3
fi

set +x
echo "========================================================================================================="
echo "Ensure Git LFS has been initialized for the GSDK"
echo "========================================================================================================="
set -x
if [ ! -f "$(git -C "${gsdk_dir}" rev-parse --git-dir)/hooks/pre-push" ]; then
git -C "${gsdk_dir}" lfs install
fi

set +x
echo "========================================================================================================="
echo "Ensure GSDK submodule has been initialized and LFS objects have been pulled"
echo "========================================================================================================="
set -x
git submodule update --init "${gsdk_dir}"
git -C "${gsdk_dir}" lfs pull

# ==============================================================================
OT_CMAKE_NINJA_TARGET=${OT_CMAKE_NINJA_TARGET-}

Expand Down Expand Up @@ -299,7 +333,7 @@ main()
before_flags+=("--skip-generation")
fi

"${repo_dir}"/script/build_example_apps "${before_flags[@]}" "${board}" "${after_flags[@]}" "$@"
"${repo_dir}"/script/build_example_apps "${before_flags[@]-}" "${board}" "${after_flags[@]-}" "$@"

fi

Expand Down

0 comments on commit 80337be

Please sign in to comment.