forked from platformio/platformio-core
Fixed an issue with project generator for CLion IDE when 2 environments were used // Resolve #2824
This commit is contained in:
@@ -6,6 +6,11 @@ Release Notes
|
|||||||
PlatformIO 4.0
|
PlatformIO 4.0
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
4.0.4 (2019-??-??)
|
||||||
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
* Fixed an issue with project generator for `CLion IDE <http://docs.platformio.org/page/ide/clion.html>`__ when 2 environments were used (`issue #2824 <https://github.com/platformio/platformio-core/issues/2824>`_)
|
||||||
|
|
||||||
4.0.3 (2019-08-30)
|
4.0.3 (2019-08-30)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@ if (CMAKE_BUILD_TYPE MATCHES "{{ env_name }}")
|
|||||||
%end
|
%end
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
% leftover_envs = set(envs) ^ set([env_name])
|
% leftover_envs = list(set(envs) ^ set([env_name]))
|
||||||
%
|
%
|
||||||
% ide_data = {}
|
% ide_data = {}
|
||||||
% if leftover_envs:
|
% if leftover_envs:
|
||||||
|
@@ -194,10 +194,11 @@ def compute_project_checksum(config):
|
|||||||
return checksum.hexdigest()
|
return checksum.hexdigest()
|
||||||
|
|
||||||
|
|
||||||
def load_project_ide_data(project_dir, envs):
|
def load_project_ide_data(project_dir, env_or_envs):
|
||||||
from platformio.commands.run import cli as cmd_run
|
from platformio.commands.run import cli as cmd_run
|
||||||
assert envs
|
assert env_or_envs
|
||||||
if not isinstance(envs, (list, tuple, set)):
|
envs = env_or_envs
|
||||||
|
if not isinstance(envs, list):
|
||||||
envs = [envs]
|
envs = [envs]
|
||||||
args = ["--project-dir", project_dir, "--target", "idedata"]
|
args = ["--project-dir", project_dir, "--target", "idedata"]
|
||||||
for env in envs:
|
for env in envs:
|
||||||
@@ -217,6 +218,6 @@ def load_project_ide_data(project_dir, envs):
|
|||||||
_data = json.loads(line)
|
_data = json.loads(line)
|
||||||
if "env_name" in _data:
|
if "env_name" in _data:
|
||||||
data[_data['env_name']] = _data
|
data[_data['env_name']] = _data
|
||||||
if len(envs) == 1 and envs[0] in data:
|
if not isinstance(env_or_envs, list) and env_or_envs in data:
|
||||||
return data[envs[0]]
|
return data[env_or_envs]
|
||||||
return data or None
|
return data or None
|
||||||
|
Reference in New Issue
Block a user