Commit Graph

2 Commits (820d79d84bf0cb31ab8bcecfd9e7090cdb6872cc)

Author SHA1 Message Date
Bogdan Marinescu 6f1298b02b Added support for viewing the configuration
get_config.py can be used to view the configuration of the mbed project
that's being compiled:

- without '-v' it displays a simple list of configuration parameters and
  their values
- with '-v' it displays additional data for each configuration parameter
  (like the place of definition and the last place that set a value for
   the configuration parameter).

Tested by running "get_config.py" on a few tests from
tools/test/config_test.
2016-06-03 19:06:21 +03:00
Bogdan Marinescu d83dc27fcf Add configuration mechanism
This commit adds the implementation of the configuration mechanism and
applies it for two uses cases:

- building a program (build_project in build_api.py)
- building a library (build_library in build_api.py)

There's also a new method 'get_config' in build_api.py that's used to
return the configuration of a project. Currently, it's used only for
testing, the intention is to use it for the implementation of the 'mbed
config' command.

Tested with various test configurations on the "blinky" example and also
with its own set of tests (to be added in a separate commit).

'make.py' was modified to send the target *name* to build_project, as
opposed to the target *instance*. This is needed because the
coniguration mechanism allows for creating custom targets, but these
targets are not available until the configuration file
mbed_app_config.json is parsed, which happens in build_project (so
before make.py calls 'build_project'). The API of build_project didn't
change, it now accepts both target names and target instances for the
'target' argument.

Known issues:

- doesn't currently work when doing binary builds of the SDK. Currently,
  building the SDK is broken in mbed-os, so this will be added later.
- when building tests, the build process ends up calling
  'build_project', so the configuration mechanism should play well with
  tests. However, this wasn't tested.

A later commit will all documentation for the configuration mechanism.
2016-06-02 15:09:52 +03:00