Skip to content

Latest commit

 

History

History
87 lines (64 loc) · 3.97 KB

README.md

File metadata and controls

87 lines (64 loc) · 3.97 KB

Scripts

This project uses mixture of bash and python scripts. Structure of this directory is as follows:

  • common - directory containing common bash scripts used by a top level scripts.

    • build_example.sh - script building an example from ./ci/examples directory.
    • build_library.sh - script building a library test from ./ci/libraries_tests directory.
    • check_deps.sh - script which checks if required binary dependencies are installed globally in the system.
    • consts.sh - file containing constants and common paths.
    • download.sh - file containing code which downloads tools and SDK in tree.
    • python.sh - file calling python scripts using virtual env.
    • utils.sh - bash utilities.
  • python - directory containing python scitps. They are called via coresponding bash scripts.

    • nrf5_cmake - directory conataining common code for python scripts.
    • *.py - intermediate python scripts. They are described below as bash scripts.
  • build_all_examples.sh - this script builds all examples from ./ci/examples directory for all nRF SDKs downloaded into ./ci/sdks directory. You can pass custom list of SDK versions as an argument to the script (e.g. "16.0.0").

  • build_all_libraries.sh - this script builds all libraries from ./ci/libraries_tests directory for all nRF SDKs downloaded into ./ci/sdks directory. You can pass custom list of SDK versions as an argument to the script (e.g. "16.0.0").

  • build_example.sh - builds single example. Following options are defined:

    • --example= relative path to SDK example (e.g. peripheral/blinky).
    • --sdk_version= nRF SDK version (e.g. 16.0.0).
    • --board= nRF board (e.g. pca10056).
    • --sd_variant= nRF SoftDevice variant (e.g. blank, s140).
  • build_library.sh - builds single library test. Following options are defined:

    • --library= library name as defined in the ./ci/libraries/*.json files.
    • --sdk_version= nRF SDK version (e.g. 16.0.0).
    • --board= nRF board (e.g. pca10056).
    • --sd_variant= nRF SoftDevice variant (e.g. blank, s140).
  • check_coverage.sh - checks current libraries and examples coverage; provides a lists of libraries with least amount of remaining dependencies and examples with least amount of remaining source files. Make sure to execute scrape_makefiles.sh and generate_libraries.sh before calling this script.

    • --example_pattern= - show only example candidates matching a pattern
    • --top=N - show only top N candidate libraries and examples
  • clean.sh - cleans build and autogenerated artifacts.

  • generate_cmake_tests.sh - generates tests for object libraries defined inside ./ci/libraries. Generated CMakeLists.txt file is placed in the ./ci/libraries_tests/XXX directory where XXX is a library name. User is expected to add main.c and sdk_version.h files manually.

  • generate_cmake.sh - generates CMake files into ./cmake folder from the definitions located at ./ci/libraries.

  • generate_example.sh - automatically generates example's template from the Makefiles found in the ./ci/sdks directory. A result is located inside ./ci/examples/*/CMakeLists.txt file. You can use it as a guide for adding new examples.

    • --example= relative path to SDK example (e.g. peripheral/blinky).
  • generate_libraries.sh - automatically generates libraries definitions from the SDKs downloaded inside ./ci/sdks directory. A result in located inside ./ci/generated/libraries.json file. You can use them as a guide for adding new libraries.

  • prepare.sh - downloads nRF SDKs, toolchain and tools to their corresponding files.

  • run_tests.sh - run all local python scripts' tests.

  • scrape_cmake.sh - legacy script, which was parsing existing CMake files and generating JSON definitions from them.

  • scrape_makefiles.sh - script parsing Makefiles from all examples contained in the downlaoded SDKs. A result is a ./ci/generated/examples.json file.