With the eye on integrating PlatformIO into Embeetle IDE, we need to have more control over the project structure of a PlatformIO project. More in particular, all libraries and framework code needs to be inside the project folder, such that the whole project is self-contained.
@maxgerhardt helped substantially to achieve this (see PlatformIO integration into Embeetle IDE). He gave the following example of a
platformio.ini file that redirects all packages and libraries into the project folder:
[platformio] ; redirect *all* packages, so e.g. framework-arduino-avr. ; this would however also redirect compiler packages, like toolchain-atmelavr, which ; you might want to .gitignore.. (they're OS & arch specific anyways) packages_dir = $PROJECT_DIR/packages ; redirect the standard `.pio\lideps` directory if needed for better visibility libdeps_dir = $PROJECT_DIR/libdeps ; redirect global libraries which normall go into <home dir>/.platformio/libs globallib_dir = $PROJECT_DIR/global_libs [env:uno] platform = atmelavr board = uno framework = arduino lib_deps = bblanchon/ArduinoJson @ ^6.18.0
Unfortunately, this also redirects the compiler toolchain and flash tools (eg.
avrdude) into the project folder.
Can one have more fine-grained control over which packages get redirected? This way, we could redirect only the framework and library packages into the project folder, making an exception for compiler toolchains and flash tools.