Closed hfudev closed 9 months ago
There is another usage case, can you consider supporting something like base_depends
?
examples/wifi: # or anchor
base_depends_components:
esp_hw_support
esp_rom
esp_wifi
examples/wifi/coexist:
add_components:
esp_coex
@ydc-0 I think we should avoid adding more and more keywords. Maybe we can support a new feature that enhance the original yaml? That could help make the yaml anchor more useful.
For example
.base_depends_components: &base-depends-components
depends_components:
- esp_hw_support
- esp_rom
- esp_wifi
examples/wifi/coexist:
<<: *base-depends-components
depends_components+:
- esp_coex
depends_components-:
- esp_rom
Will be interpreted into
examples/wifi/coexist:
depends_components:
- esp_hw_support
- esp_wifi
- esp_coex
The +
and -
here could be used on all keywords that could be used as a dict key, like depends_components
, depends_filepatterns
, disable
, enable
, ...
Creating another ticket for this feature. Created here: https://github.com/espressif/idf-build-apps/issues/106
This use case is more practical.
Assume we're testing an ota related example, one config sdkconfig.eth
is using ethernet, another config sdkconfig.wifi
is using wifi
folder_foo:
depends_components:
- if: CONFIG_NAME == "eth"
components: ["esp_eth"]
- if: CONFIG_NAME == "wifi":
components: ["esp_wifi"]
For example
To keep the similarity with others, here the folder rule should also apply the first matched
if
statement. but on extra, we support one more "default" switch case.explanation:
depends_filepatterns
should be something alike.This is also helpful when one folder contains different sdkconfig file. For example