check_examples_cmake_make.sh 819 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. # While we support GNU Make & CMake together, check the same examples are present for both
  3. CMAKE_EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name CMakeLists.txt | grep -v "/components/" | grep -v "/common_components/" | grep -v "/main/" | grep -v "/build_system/cmake/" | grep -v "/mb_example_common/")
  4. MAKE_EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name Makefile | grep -v "/build_system/cmake/")
  5. CMAKE_EXAMPLE_PATHS="$(/usr/bin/dirname $CMAKE_EXAMPLE_PATHS | sort -n)"
  6. MAKE_EXAMPLE_PATHS="$(/usr/bin/dirname $MAKE_EXAMPLE_PATHS | sort -n)"
  7. MISMATCH=$(comm -3 <(echo "$MAKE_EXAMPLE_PATHS") <(echo "$CMAKE_EXAMPLE_PATHS"))
  8. if [ -n "$MISMATCH" ]; then
  9. echo "Some examples are not in both CMake and GNU Make:"
  10. echo "$MISMATCH"
  11. exit 1
  12. fi
  13. echo "Example lists match"
  14. exit 0