From 0da1a38df53ebaeb4bd4774b12f7ff1590450cab Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 15 Jul 2023 15:31:01 +0300 Subject: [PATCH] Replace "idedata" target with "pio project metadata" command --- platformio/builder/main.py | 5 ++++- platformio/builder/tools/piointegration.py | 2 +- platformio/project/helpers.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/platformio/builder/main.py b/platformio/builder/main.py index ea8b202b..50667d4c 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -229,7 +229,10 @@ if env.IsIntegrationDump(): encoding="utf8", ) as fp: json.dump(data, fp) - click.echo("\n%s\n" % json.dumps(data)) # pylint: disable=undefined-variable + click.echo( + "Data has been saved to the following location %s" + % projenv.subst(os.path.join("$BUILD_DIR", "idedata.json")) + ) env.Exit(0) if "sizedata" in COMMAND_LINE_TARGETS: diff --git a/platformio/builder/tools/piointegration.py b/platformio/builder/tools/piointegration.py index 6f0a972e..e98a9bd3 100644 --- a/platformio/builder/tools/piointegration.py +++ b/platformio/builder/tools/piointegration.py @@ -23,7 +23,7 @@ from platformio.proc import exec_command, where_is_program def IsIntegrationDump(_): - return set(["__idedata", "idedata"]) & set(COMMAND_LINE_TARGETS) + return "__idedata" in COMMAND_LINE_TARGETS def DumpIntegrationIncludes(env): diff --git a/platformio/project/helpers.py b/platformio/project/helpers.py index cb004d23..e75167f7 100644 --- a/platformio/project/helpers.py +++ b/platformio/project/helpers.py @@ -179,7 +179,7 @@ def _load_build_metadata(project_dir, env_names, debug=False): result.exception, exception.ReturnErrorCode ): raise result.exception - if '"includes":' not in result.output: + if "Data has been saved to the following location" not in result.output: raise exception.UserSideException(result.output) return _get_cached_build_metadata(project_dir, env_names)