Skip to content

Commit

Permalink
Document how to skip running extra script in the IsIntegrationDump
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Dec 13, 2024
1 parent dfa6be6 commit 9f64f54
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripting/launch_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,20 @@ If there is no prefix specified, the ``post:`` will be used automatically.
pre:pre_extra_script.py
post:post_extra_script1.py
post_extra_script2.py
.. note::
PlatformIO includes a service stage during runtime where it re-executes extra
scripts to gather integration information intended for IDE plugins. If you want
your scripts to run exclusively for the "build" target, include the following
hook at the beginning of your script:

.. code-block:: python
Import("env")
if env.IsIntegrationDump():
# stop the current script execution
Return()
# code below runs for the "build" and other targets
env.Append(CPPDEFINES=["MACRO_NAME"])

0 comments on commit 9f64f54

Please sign in to comment.