forked from platformio/platformio-core
Expanded support for SCons variables declared in the legacy format `${SCONS_VARNAME}
` // Resolve #4828
This commit is contained in:
@ -20,6 +20,8 @@ test-driven methodologies, and modern toolchains for unrivaled success.
|
|||||||
6.1.13 (2024-??-??)
|
6.1.13 (2024-??-??)
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
* Expanded support for SCons variables declared in the legacy format ``${SCONS_VARNAME}`` (`issue #4828 <https://github.com/platformio/platformio-core/issues/4828>`_)
|
||||||
|
|
||||||
6.1.12 (2024-01-10)
|
6.1.12 (2024-01-10)
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -164,6 +164,7 @@ class ProjectConfigBase:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_section_scope(section):
|
def get_section_scope(section):
|
||||||
|
assert section
|
||||||
return section.split(":", 1)[0] if ":" in section else section
|
return section.split(":", 1)[0] if ":" in section else section
|
||||||
|
|
||||||
def walk_options(self, root_section):
|
def walk_options(self, root_section):
|
||||||
@ -343,8 +344,11 @@ class ProjectConfigBase:
|
|||||||
section, option = match.group(1), match.group(2)
|
section, option = match.group(1), match.group(2)
|
||||||
|
|
||||||
# handle built-in variables
|
# handle built-in variables
|
||||||
if section is None and option in self.BUILTIN_VARS:
|
if section is None:
|
||||||
return self.BUILTIN_VARS[option]()
|
if option in self.BUILTIN_VARS:
|
||||||
|
return self.BUILTIN_VARS[option]()
|
||||||
|
# SCons varaibles
|
||||||
|
return f"${option}"
|
||||||
|
|
||||||
# handle system environment variables
|
# handle system environment variables
|
||||||
if section == "sysenv":
|
if section == "sysenv":
|
||||||
|
@ -657,7 +657,9 @@ build_dir = /tmp/pio-$PROJECT_HASH
|
|||||||
data_dir = $PROJECT_DIR/assets
|
data_dir = $PROJECT_DIR/assets
|
||||||
|
|
||||||
[env:myenv]
|
[env:myenv]
|
||||||
build_flags = -D UTIME=${UNIX_TIME}
|
build_flags =
|
||||||
|
-D UTIME=${UNIX_TIME}
|
||||||
|
-I ${PROJECTSRC_DIR}/hal
|
||||||
test_testing_command =
|
test_testing_command =
|
||||||
${platformio.packages_dir}/tool-simavr/bin/simavr
|
${platformio.packages_dir}/tool-simavr/bin/simavr
|
||||||
-m
|
-m
|
||||||
@ -672,6 +674,7 @@ test_testing_command =
|
|||||||
os.path.join("$PROJECT_DIR", "assets")
|
os.path.join("$PROJECT_DIR", "assets")
|
||||||
)
|
)
|
||||||
assert config.get("env:myenv", "build_flags")[0][-10:].isdigit()
|
assert config.get("env:myenv", "build_flags")[0][-10:].isdigit()
|
||||||
|
assert config.get("env:myenv", "build_flags")[1] == "-I $PROJECTSRC_DIR/hal"
|
||||||
testing_command = config.get("env:myenv", "test_testing_command")
|
testing_command = config.get("env:myenv", "test_testing_command")
|
||||||
assert "$" not in " ".join(testing_command)
|
assert "$" not in " ".join(testing_command)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user