Skip to content
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

Advertise upload target as platform target / Fix Jetbrains Clion upload integration #59

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

episource
Copy link

1. General Improvement
Currently only platform targets are included in pio project metadata output. This output is backed by __PIO_TARGETS environment variable, which currently only includes explicit targets (e.g. added using env.AddPlatformTarget). Builtin targets are not included in this list. With one notable exception: For embedded platforms without explicit platform targets, the upload target is added to the list.

There is already an platformio/platformio-core#4477 issue related to the pio run --list-targets output, which is backed by the metadata. The tickets requests a more complete output.

Nevertheless, the upload target is highly platform specific. So makes sense to not include this target if platform defines its own targets.

Therefore I'd like to request the raspberrypi platform to explicitly advertise its upload target by using AddPlatformTarget("upload, ...) instead of Alias("upload", ...).

 
2. Side effect: Fixes Jetbrains Clion integration
This also fixes broken Jetbrains Clion integration for the upload target of projects based on this raspberrypi platform:

Clion uses pio project metadata to figure out available targets. The play button of platformio run configurations is bound to the existance of the upload target in the metadata. If upload target is missing in pio project metadata, clicking the play button leads to error message PlatformIO: Upload action is not available for this PlatformIO env. Additionally the upload target and dependent actions won't show up in Clions PlatformIO pane.

@maxgerhardt
Copy link
Owner

That would be extremely concerning if true, because the

AlwaysBuild(env.Alias("upload", upload_source, upload_actions))

construct comes from the standard PlatformIO platforms, like in platform-ststm32. If that's wrong, everything else is wrong too, and I don't yet see this being fixed in all other platforms. Can you push platformio/platformio-core#4477 again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants