Hey folks!
First I want to say a big thank you to the developers, contributors and the community of PlatformIO. It’s just awesome what you have built. Last night I was awake till 4:00 am reading the documentation. I am a newbie embedded programmer with experience in web development.
Question:
How can I make PlatformIO automatically pull a dependency library from git by adding the dependency to platform.ini?
Am I wrong to assume there should be a way to call a CLI command that will resolve all dependencies (similar to npm install
)?
My Attempt 1
I could install the library manually with this command.
pio lib install https://github.com/vedderb/bldc_uart_comm_stm32f4_discovery.git
However this way my ./lib
directory still remains empty. I need to have the user of my code to have access to read the library source file.
My Attempt 2
Add my dependency library through git submodule add https://github.com/vedderb/bldc_uart_comm_stm32f4_discovery.git --path ./lib
The problem is that PlatformIO adds .lib/
to .gitignore
and thus does not let me install the submodule. I understand that the ./lib
should be ignored by git.
Here are some excerpts from my project.
platform.ini
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
lib_extra_dirs = ./lib
lib_deps = https://github.com/vedderb/bldc_uart_comm_stm32f4_discovery.git
./lib
➜ faraday-vesc git:(master) ✗ ll -al lib total 8
drwxr-xr-x 3 cc staff 102B Jan 13 18:08 .
drwxr-xr-x 13 cc staff 442B Jan 13 18:28 ..
-rw-r--r-- 1 cc staff 868B Jan 13 17:52 readme.txt
Any hints will be much appreciated!