Override platformio dir options in env sections
- [X ] Feature Request.
There are some options, currently at the platform level, that would be useful at the env level. I can sometimes work around it with scripting, but it would be easier not to have to do that. The behavior I envision is to allow options to appear at any level, with lower-level appearances overriding higher-level ones - similar to the way that CSS tags on more-specific elements override more-general ones.
As a concrete example, consider data_dir. It would be useful to have a different data_dir per env. Our software has envs for "wifi" and "bluetooth" build versions. The data_dir contains files that should go into a SPIFFS filesystem on the MCUs local FLASH. Those files differ between wifi and bluetooth. If data_dir could appear at the env level, the solution to this problem would be straightforward and obvious.
One current solution to the example above is to write
[platformio]
data_dir = ${PROJECT_DIR}/data-${PIOENV}
but it would be more obvious, and more flexible, if one could simply override at the env level, as with
[env:wifi]
data_dir = data-wifi