-
-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: list custom targets via --list-targets #3573
Comments
The API has been changed. Please upgrade to PIO Core 4.4 and use https://docs.platformio.org/en/latest/projectconf/advanced_scripting.html#custom-targets |
Thanks! I could've sworn I searched the page... It also covers another use-case very nicely: diff --git a/code/scripts/espurna_utils/lwip.py b/code/scripts/espurna_utils/lwip.py
index a742fcd7..2ed1bd6e 100644
--- a/code/scripts/espurna_utils/lwip.py
+++ b/code/scripts/espurna_utils/lwip.py
@@ -48,9 +48,7 @@ def lwip_inject_patcher(env):
"Rebuilding lwip",
)
- patcher = env.Alias("patch-lwip", None, patch_action)
- builder = env.Alias("build-lwip", patcher, build_action)
+ patcher = env.AddCustomTarget("patch-lwip", None, patch_action, always_build=True)
+ builder = env.AddCustomTarget("build-lwip", patcher, build_action, always_build=True)
if os.environ.get("ESPURNA_PIO_PATCH_ISSUE_1610"):
env.Depends("$BUILD_DIR/${PROGNAME}.elf", builder)
- env.AlwaysBuild(patcher)
- env.AlwaysBuild(builder) Can't comment on the IDE extension as it is still in development, but CLI --list-targets works as intended! |
You can try the latest beta. It's ery stable https://community.platformio.org/t/platformio-ide-for-vscode-2-0-beta-help-us-with-testing/14097 We don't plan to have more changes and we don't release PlatformIO IDE extension for VSCode because still wait on release of PIO Core 4.4. |
I did try it, and it works! Thanks. Sorry for the delay though. As I never installed the dev extension on the PC I tested with, I never noticed that |
After #3544 it is possible to list IDE targets, but not the custom ones that come from user scripts.
For example, https://github.com/xoseperez/espurna/blob/dev/code/scripts/pio_main.py defines a new
release
target via env.Alias() call:However, --list-targets only lists PIO built-in results, as there are some targets missing:
Some observations based on the source:
env.AddTarget()
platformio-core/platformio/builder/tools/piotarget.py
Line 91 in 5dadb87
platformio-core/platformio/builder/tools/piotarget.py
Line 61 in 5dadb87
https://docs.platformio.org/en/latest/projectconf/advanced_scripting.html has no mention of the method, so I am not really sure if this is a public method or something internal.
Which shows a more complete list:
The text was updated successfully, but these errors were encountered: