forked from platformio/platformio-core
Add support for PLATFORMIO_DEFAULT_ENVS system environment variable // Resolve #1967
This commit is contained in:
@@ -19,6 +19,7 @@ PlatformIO 4.0
|
|||||||
- Added support for Unix shell-style wildcards for `monitor_port <http://docs.platformio.org/page/projectconf/section_env_monitor.html#monitor-port>`__ option (`issue #2541 <https://github.com/platformio/platformio-core/issues/2541>`_)
|
- Added support for Unix shell-style wildcards for `monitor_port <http://docs.platformio.org/page/projectconf/section_env_monitor.html#monitor-port>`__ option (`issue #2541 <https://github.com/platformio/platformio-core/issues/2541>`_)
|
||||||
- Added new `monitor_flags <http://docs.platformio.org/page/projectconf/section_env_monitor.html#monitor-flags>`__ option which allows passing extra flags and options to `platformio device monitor <http://docs.platformio.org/page/userguide/cmd_device.html#cmd-device-monitor>`__ command (`issue #2165 <https://github.com/platformio/platformio-core/issues/2165>`_)
|
- Added new `monitor_flags <http://docs.platformio.org/page/projectconf/section_env_monitor.html#monitor-flags>`__ option which allows passing extra flags and options to `platformio device monitor <http://docs.platformio.org/page/userguide/cmd_device.html#cmd-device-monitor>`__ command (`issue #2165 <https://github.com/platformio/platformio-core/issues/2165>`_)
|
||||||
- Override default development platform upload command with a custom `upload_command <http://docs.platformio.org/page/projectconf/section_env_upload.html#upload-command>`__ (`issue #2599 <https://github.com/platformio/platformio-core/issues/2599>`_)
|
- Override default development platform upload command with a custom `upload_command <http://docs.platformio.org/page/projectconf/section_env_upload.html#upload-command>`__ (`issue #2599 <https://github.com/platformio/platformio-core/issues/2599>`_)
|
||||||
|
- Added support for `PLATFORMIO_DEFAULT_ENVS <http://docs.platformio.org/page/envvars.html#envvar-PLATFORMIO_DEFAULT_ENVS>`__ system environment variable (`issue #1967 <https://github.com/platformio/platformio-core/issues/1967>`_)
|
||||||
- Fixed an issue when ``-U`` in ``build_flags`` does not remove macro previously defined via ``-D`` flag (`issue #2508 <https://github.com/platformio/platformio-core/issues/2508>`_)
|
- Fixed an issue when ``-U`` in ``build_flags`` does not remove macro previously defined via ``-D`` flag (`issue #2508 <https://github.com/platformio/platformio-core/issues/2508>`_)
|
||||||
|
|
||||||
* **Library Management**
|
* **Library Management**
|
||||||
|
2
docs
2
docs
Submodule docs updated: c030b967a5...84973be53b
2
examples
2
examples
Submodule examples updated: 89963fed9e...b5ae9ea1bb
@@ -284,7 +284,7 @@ class ProjectConfig(object):
|
|||||||
return [s[4:] for s in self._parser.sections() if s.startswith("env:")]
|
return [s[4:] for s in self._parser.sections() if s.startswith("env:")]
|
||||||
|
|
||||||
def default_envs(self):
|
def default_envs(self):
|
||||||
return self.get("platformio", "env_default", [])
|
return self.get("platformio", "default_envs", [])
|
||||||
|
|
||||||
def validate(self, envs=None, silent=False):
|
def validate(self, envs=None, silent=False):
|
||||||
if not isfile(self.path):
|
if not isfile(self.path):
|
||||||
|
@@ -48,9 +48,10 @@ ProjectOptions = OrderedDict([
|
|||||||
# [platformio]
|
# [platformio]
|
||||||
#
|
#
|
||||||
ConfigPlatformioOption(name="description"),
|
ConfigPlatformioOption(name="description"),
|
||||||
ConfigPlatformioOption(name="env_default",
|
ConfigPlatformioOption(name="default_envs",
|
||||||
|
oldnames=["env_default"],
|
||||||
multiple=True,
|
multiple=True,
|
||||||
sysenvvar="PLATFORMIO_ENV_DEFAULT"),
|
sysenvvar="PLATFORMIO_DEFAULT_ENVS"),
|
||||||
ConfigPlatformioOption(name="extra_configs", multiple=True),
|
ConfigPlatformioOption(name="extra_configs", multiple=True),
|
||||||
|
|
||||||
# Dirs
|
# Dirs
|
||||||
|
@@ -74,8 +74,8 @@ def test_real_config(tmpdir):
|
|||||||
with tmpdir.as_cwd():
|
with tmpdir.as_cwd():
|
||||||
config = ProjectConfig(tmpdir.join("platformio.ini").strpath)
|
config = ProjectConfig(tmpdir.join("platformio.ini").strpath)
|
||||||
assert config
|
assert config
|
||||||
assert len(config.warnings) == 1
|
assert len(config.warnings) == 2
|
||||||
assert "lib_install" in config.warnings[0]
|
assert "lib_install" in config.warnings[1]
|
||||||
|
|
||||||
config.validate(["extra_2", "base"], silent=True)
|
config.validate(["extra_2", "base"], silent=True)
|
||||||
with pytest.raises(UnknownEnvNames):
|
with pytest.raises(UnknownEnvNames):
|
||||||
|
Reference in New Issue
Block a user