mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ci: support building examples with external components
This commit is contained in:
parent
aa692b3483
commit
d4ef2135f0
5
tools/ci/build_example_dirs.txt
Normal file
5
tools/ci/build_example_dirs.txt
Normal file
@ -0,0 +1,5 @@
|
||||
# Each line specifies the location of project makefile, and the corresponding
|
||||
# directory which should be used as example root directory when copying the
|
||||
# example for building it out of tree.
|
||||
#
|
||||
examples/system/unit_test/test/Makefile examples/system/unit_test
|
@ -109,10 +109,23 @@ build_example () {
|
||||
local EXAMPLE_DIR=$(dirname "${MAKE_FILE}")
|
||||
local EXAMPLE_NAME=$(basename "${EXAMPLE_DIR}")
|
||||
|
||||
# Check if the example needs a different base directory.
|
||||
# Path of the Makefile relative to $IDF_PATH
|
||||
local MAKE_FILE_REL=${MAKE_FILE#"${IDF_PATH}/"}
|
||||
# Look for it in build_example_dirs.txt:
|
||||
local COPY_ROOT_REL=$(sed -n -E "s|${MAKE_FILE_REL}[[:space:]]+(.*)|\1|p" < ${IDF_PATH}/tools/ci/build_example_dirs.txt)
|
||||
if [[ -n "${COPY_ROOT_REL}" && -d "${IDF_PATH}/${COPY_ROOT_REL}/" ]]; then
|
||||
local COPY_ROOT=${IDF_PATH}/${COPY_ROOT_REL}
|
||||
else
|
||||
local COPY_ROOT=${EXAMPLE_DIR}
|
||||
fi
|
||||
|
||||
echo "Building ${EXAMPLE_NAME} as ${ID}..."
|
||||
mkdir -p "example_builds/${ID}"
|
||||
cp -r "${EXAMPLE_DIR}" "example_builds/${ID}"
|
||||
pushd "example_builds/${ID}/${EXAMPLE_NAME}"
|
||||
cp -r "${COPY_ROOT}" "example_builds/${ID}"
|
||||
local COPY_ROOT_PARENT=$(dirname ${COPY_ROOT})
|
||||
local EXAMPLE_DIR_REL=${EXAMPLE_DIR#"${COPY_ROOT_PARENT}"}
|
||||
pushd "example_builds/${ID}/${EXAMPLE_DIR_REL}"
|
||||
# be stricter in the CI build than the default IDF settings
|
||||
export EXTRA_CFLAGS="-Werror -Werror=deprecated-declarations"
|
||||
export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
|
||||
@ -142,7 +155,7 @@ build_example () {
|
||||
|
||||
EXAMPLE_NUM=0
|
||||
|
||||
find ${IDF_PATH}/examples/ -type f -name Makefile | sort | \
|
||||
find ${IDF_PATH}/examples -type f -name Makefile | sort | \
|
||||
while read FN
|
||||
do
|
||||
if [[ $EXAMPLE_NUM -lt $START_NUM || $EXAMPLE_NUM -ge $END_NUM ]]
|
||||
|
Loading…
x
Reference in New Issue
Block a user