Skip to content

config_file

Required: No
Type: List of configuration files
Condition: Yes

List of configuration files to be included in the project. Configuration files may reside anywhere in the project, and are copied to the config/ directory upon project generation. The config/ directory is automatically added as an include path in exported IDE projects if not empty.

The project may register a file that already exists in the output config directory as a configuration file. In this case, the path property starts with config/, and the tool implementation may choose to elide copying the file, since it is already in the right place.

If a configuration file with the same name as one provided by the project is provided by a component, it is implementation-defined how this is handled.

See the description of configuration files for more details.

A configuration file entry may have the following keys:

Key Required Type Description
path Yes String Path to configuration file
directory No String Copy the file to the given subdirectory of the config directory.
file_id No String ID of this configuration file. If multiple configuration files have the same ID, they are assumed to have mutually exclusive conditions.
override No Override map Map containing information about another configuration file to override
condition No List of features The configuration file is added if all the given features are present
unless No List of features The configuration file is added unless any of the given features are present
1
2
3
config_file:
  - path: path/to/app_config.h
    file_id: app_config

Configuration Override

The override entry may have the following keys:

Key Required Type Description
file_id Yes String ID of the configuration file to override
component Yes String ID of the component containing the original configuration file
instance No String Instance name of the instance whose configuration file shall be overridden
vendor No String The vendor of the SDK extension the component is from. Only the vendors listed under extension/vendor or sdk/vendor key may be used.
package No String The ID of the SDK extension the component is from. Only SDK extensions listed using the extension/id or sdk/id key may be used.

The id, package, and vendor fields together form a component reference. For details on what a component reference is, and how the package and vendor fields affect resolution, see the component reference.

When the override property is set, the configuration file is treated as an overriding configuration file. This file is only included in the generated project if the file it overrides -- identified by the combination of file_id, instance, and the component's id, optionally with package and/or vendor fields -- is also being added to the project. In such cases, the overriding configuration file replaces the original.

Overriding a configuration file that does not have a file_id is not supported.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
config_file:
  - path: config/marlin_hunt.h
    override:
      # Fully implicit reference; Search across all SDKs and extensions available to the project
      component: marlin
      file_id: hunt_control
  - path: config/tuna_speed.h
    override:
      # Fully qualified reference; Limit search to atlantic package by vendor fishmonger
      component: tuna
      file_id: speed_settings
      vendor: fishmonger
      package: atlantic
  - path: config/cod_school.h
    override:
      # Vendor-specific reference; Limit search to vendor's specific SDK/extension
      component: cod
      file_id: school_config
      vendor: fishmonger
  - path: config/salmon_swim.h
    override:
      # Package-specific reference; Limit search to package ID by any vendor
      component: salmon
      file_id: swim_style
      package: pacific