Skip to content

Commit

Permalink
[script] add pre-build checks that ensure the GSDK submodule has been…
Browse files Browse the repository at this point in the history
… pulled properly
  • Loading branch information
lmnotran committed Feb 7, 2024
1 parent 10d7e90 commit 84b349c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
4 changes: 3 additions & 1 deletion script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ install_packages_brew()
coreutils \
openjdk@11 \
grep \
wget
wget \
git \
git-lfs
}

install_packages_source()
Expand Down
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 /Users/mason/repos/ot-efr32/.git/modules/third_party/silabs/gecko_sdk/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 84b349c

Please sign in to comment.