2018-08-27 23:10:48 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# While we support GNU Make & CMake together, check the same examples are present for both
|
|
|
|
|
2020-02-17 23:48:57 -05:00
|
|
|
CMAKE_EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name CMakeLists.txt | grep -v "/components/" | grep -v "/common_components/" | grep -v "/cxx/experimental/experimental_cpp_component/" | grep -v "/main/" | grep -v "/build_system/cmake/" | grep -v "/mb_example_common/")
|
2018-11-07 02:19:56 -05:00
|
|
|
MAKE_EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name Makefile | grep -v "/build_system/cmake/")
|
2018-08-27 23:10:48 -04:00
|
|
|
|
|
|
|
CMAKE_EXAMPLE_PATHS="$(/usr/bin/dirname $CMAKE_EXAMPLE_PATHS | sort -n)"
|
|
|
|
MAKE_EXAMPLE_PATHS="$(/usr/bin/dirname $MAKE_EXAMPLE_PATHS | sort -n)"
|
|
|
|
|
|
|
|
MISMATCH=$(comm -3 <(echo "$MAKE_EXAMPLE_PATHS") <(echo "$CMAKE_EXAMPLE_PATHS"))
|
|
|
|
|
|
|
|
if [ -n "$MISMATCH" ]; then
|
|
|
|
echo "Some examples are not in both CMake and GNU Make:"
|
|
|
|
echo "$MISMATCH"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Example lists match"
|
|
|
|
exit 0
|