Fixed an issue when booleans in "platformio.ini" are not parsed properly // Resolve #3022

This commit is contained in:
Ivan Kravets
2019-10-24 19:43:13 +03:00
parent 70b484a2c2
commit 3177aaf591
3 changed files with 10 additions and 3 deletions

View File

@ -28,6 +28,7 @@ PlatformIO Core 4.0
* Fixed an issue with linking process when ``$LDSCRIPT`` contains a space in path
* Fixed security issue when extracting items from TAR archive (`issue #2995 <https://github.com/platformio/platformio-core/issues/2995>`_)
* Fixed an issue with project generator when ``src_build_flags`` were not respected (`issue #3137 <https://github.com/platformio/platformio-core/issues/3137>`_)
* Fixed an issue when booleans in "platformio.ini" are not parsed properly (`issue #3022 <https://github.com/platformio/platformio-core/issues/3022>`_)
4.0.3 (2019-08-30)
~~~~~~~~~~~~~~~~~~

2
docs

Submodule docs updated: 1f833f5725...46b1dee7f1

View File

@ -93,8 +93,14 @@ def LoadPioPlatform(env):
# update board manifest with overridden data from INI config
board_config = env.BoardConfig()
for option, value in env.GetProjectOptions():
if option.startswith("board_"):
board_config.update(option.lower()[6:], value)
if not option.startswith("board_"):
continue
option = option.lower()[6:]
if isinstance(board_config.get(option), bool):
value = str(value).lower() in ("1", "yes", "true")
elif isinstance(board_config.get(option), int):
value = int(value)
board_config.update(option, value)
# load default variables from board config
for option_meta in ProjectOptions.values():