I enjoy the env targeting paradigm that platformio current presents
Sometimes I develop for multiple targets, i.e. test on the Uno, try it out on a Pro Micro then end up moving it to an attiny later.
What I’ve been doing is symbolic linking platformio.ini to a platformio.uno.ini or a platformio.promicro.ini, so that I can switch what the “default” target platformio run and platformio upload command executes.
if I have all my env’s in one platformio.ini, then it tries to upload them all at once when I do a platformio upload!
What would be neat is if something like this was built in; like a platformio.default.ini acting as a king of soft symbolic link (so that it can be .gitignored).
It’s very similar. For my use case, having “platform run” default to a particular env (instead of default to all envs) is useful, rather than explicitly specify it.
I suppose I could have said just that above, instead of the big paragraph huh? =)
I see what you mean, I definitely don’t want to contribute to too much complexity.
For this scenario, I use the old atom platformio plugin that came before your IDE (don’t shoot me please!). I really like your IDE but it doesn’t work for all my scenarios.
Idea#1:
Do exactly what you’ve suggested. Being that “default” is an optional parameter, this implies that if someone doesn’t know about it, they won’t be impacted - suggesting it doesn’t add (much) complexity
Idea#2:
Externalize outside of platformio.ini. Make like a .piodefaults file or something. This has a downside of being potentially more complicated, but the upside is that:
a) it can be .gitignored
b) it doesn’t add complexity to platformio.ini itself
Idea#3:
Hang defaults off of an environment variable like PIO_ENV_DEFAULT or something. This particular one would be not quite as ideal for me, but still satisfy the requirement.
atom points at “root folder”. In this case, official PlatformIO IDE only seems to compile against root folder , which fails since it’s not actually a project folder
This is not good argument. I don’t want to force you to use our IDE. If you take a look at a few professional IDEs you will see that they have deal with PROJECT where the only one business logic reflected in it. Ok, I’ll try explain you why we can’t propose user to use “one opened folder” for multiple projects. Having 1 projected opened within PlatformIO IDE:
Allows to integrate Code Linter and Code Completion. If you have multiple “virtual projects” under real project, these instruments will not work properly.
You always see the current active project when edit multiple files form the different opened projects.
You have ability to re-run the latest target from build panel
PlatformIO Terminal opens with CWD from the current project. It allows to use PlatformIO CLI /IDE in the same place with the all functionality.
No argument! For the record, I am absolutely not requesting that atom behavior. Only the default environment behavior – I only brought it up 'cause you asked … ! =)
I seem to understand what the author wants to tell you.
In the Java development world, there are some analogue of the make utility. It is called Apache Maven https://maven.apache.org/
At the root of each project is pom.xml file
The parent directory can have a pom.xml file. ordering of the modules listed in this file.
There are several similar systems in Ruby and other languages.
The most important thing in maven - a repository of the collected components.
In the project file, we indicate dependence on another project. Maven takes from his vault with the library, based versions.
PlatformIO Arduino IDE and have a system of external libraries.
Maven is a project build system and library catalog management system.
During assembly, you can specify the name of the current profile. You can specify a set of variables and specific libraries in the profile.
You can can explain PlatformIO what it should build. You can have multiple environments with the different libraries dependencies. PlatformIO CLI allows to run specific environments. However, author requested feature to have influence on default platformio run command because it process all envs by default.
If some functionality is missed in PlatformIO don’t hesitate to write here. I’m open for discussion and are interested to make PlatformIO really professional ecosystem.
It would be very convenient to have functionality of registration of the project as a library.
It is necessary, make changes to the project. Further, the command is sent project to library directory.
In this regard, there is in the maven project structure