nrfconnect_example.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/usr/bin/env bash
  2. #
  3. # Copyright (c) 2020 Project CHIP Authors
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. cd "$(dirname "$0")/../../examples"
  18. APP="$1"
  19. BOARD="$2"
  20. shift 2
  21. # Disable debug symbols and firmware build time to increase ccache hit ratio in CI
  22. COMMON_CI_FLAGS=(-DCONFIG_CHIP_DEBUG_SYMBOLS=n)
  23. if [[ ! -f "$APP/nrfconnect/CMakeLists.txt" || -z "$BOARD" ]]; then
  24. echo "Usage: $0 <application> <board>" >&2
  25. echo "Applications:" >&2
  26. ls */nrfconnect/CMakeLists.txt | awk -F/ '{print " "$1}' >&2
  27. exit 1
  28. fi
  29. set -x
  30. # Activate Matter environment
  31. source "../scripts/activate.sh"
  32. # Activate Zephyr environment
  33. [[ -n $ZEPHYR_BASE ]] && source "$ZEPHYR_BASE/zephyr-env.sh"
  34. # Use toolchain from Pigweed CIPD
  35. export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR"
  36. # Set ccache base directory to improve the cache hit ratio
  37. export CCACHE_BASEDIR="$PWD/$APP/nrfconnect"
  38. env
  39. west build -p auto -b "$BOARD" -d "$APP/nrfconnect/build" "$APP/nrfconnect" -- "${COMMON_CI_FLAGS[@]}" "$@"