forked from platformio/platformio-core
Fixed an issue when `"libArchive": false
` in "library.json" does not work // Resolve #3403
This commit is contained in:
@ -12,7 +12,8 @@ PlatformIO Core 4
|
|||||||
* Added support for Arm Mbed "module.json" ``dependencies`` field (`issue #3400 <https://github.com/platformio/platformio-core/issues/3400>`_)
|
* Added support for Arm Mbed "module.json" ``dependencies`` field (`issue #3400 <https://github.com/platformio/platformio-core/issues/3400>`_)
|
||||||
* Fixed an issue when quitting from PlatformIO IDE does not shutdown PIO Home server
|
* Fixed an issue when quitting from PlatformIO IDE does not shutdown PIO Home server
|
||||||
* Fixed an issue "the JSON object must be str, not 'bytes'" when PIO Home is used with Python 3.5 (`issue #3396 <https://github.com/platformio/platformio-core/issues/3396>`_)
|
* Fixed an issue "the JSON object must be str, not 'bytes'" when PIO Home is used with Python 3.5 (`issue #3396 <https://github.com/platformio/platformio-core/issues/3396>`_)
|
||||||
* Fixed an issue when Python 2 does not keep encoding when converting .INO file (`issue #3393 <https://github.com/platformio/platformio-core/issues/3393>`_)
|
* Fixed an issue when Python 2 does not keep encoding when converting ".ino" (`issue #3393 <https://github.com/platformio/platformio-core/issues/3393>`_)
|
||||||
|
* Fixed an issue when ``"libArchive": false`` in "library.json" does not work (`issue #3403 <https://github.com/platformio/platformio-core/issues/3403>`_)
|
||||||
|
|
||||||
4.2.1 (2020-02-17)
|
4.2.1 (2020-02-17)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -717,9 +717,11 @@ class PlatformIOLibBuilder(LibBuilderBase):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def lib_archive(self):
|
def lib_archive(self):
|
||||||
unique_value = "_not_declared_%s" % id(self)
|
missing = object()
|
||||||
global_value = self.env.GetProjectOption("lib_archive", unique_value)
|
global_value = self.env.GetProjectConfig().getraw(
|
||||||
if global_value != unique_value:
|
"env:" + self.env["PIOENV"], "lib_archive", missing
|
||||||
|
)
|
||||||
|
if global_value != missing:
|
||||||
return global_value
|
return global_value
|
||||||
return self._manifest.get("build", {}).get(
|
return self._manifest.get("build", {}).get(
|
||||||
"libArchive", LibBuilderBase.lib_archive.fget(self)
|
"libArchive", LibBuilderBase.lib_archive.fget(self)
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from platformio.project.config import ProjectConfig, ProjectOptions
|
from platformio.project.config import MISSING, ProjectConfig, ProjectOptions
|
||||||
|
|
||||||
|
|
||||||
def GetProjectConfig(env):
|
def GetProjectConfig(env):
|
||||||
@ -25,7 +25,7 @@ def GetProjectOptions(env, as_dict=False):
|
|||||||
return env.GetProjectConfig().items(env=env["PIOENV"], as_dict=as_dict)
|
return env.GetProjectConfig().items(env=env["PIOENV"], as_dict=as_dict)
|
||||||
|
|
||||||
|
|
||||||
def GetProjectOption(env, option, default=None):
|
def GetProjectOption(env, option, default=MISSING):
|
||||||
return env.GetProjectConfig().get("env:" + env["PIOENV"], option, default)
|
return env.GetProjectConfig().get("env:" + env["PIOENV"], option, default)
|
||||||
|
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ class ProjectConfigBase(object):
|
|||||||
value = envvar_value
|
value = envvar_value
|
||||||
|
|
||||||
if value == MISSING:
|
if value == MISSING:
|
||||||
value = option_meta.default or default
|
value = default if default != MISSING else option_meta.default
|
||||||
if value == MISSING:
|
if value == MISSING:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -123,6 +123,8 @@ def test_defaults(config):
|
|||||||
)
|
)
|
||||||
assert config.get("env:extra_2", "lib_compat_mode") == "soft"
|
assert config.get("env:extra_2", "lib_compat_mode") == "soft"
|
||||||
assert config.get("env:extra_2", "build_type") == "release"
|
assert config.get("env:extra_2", "build_type") == "release"
|
||||||
|
assert config.get("env:extra_2", "build_type", None) is None
|
||||||
|
assert config.get("env:extra_2", "lib_archive", "no") is False
|
||||||
|
|
||||||
|
|
||||||
def test_sections(config):
|
def test_sections(config):
|
||||||
|
Reference in New Issue
Block a user