I have added support for Atom Build shortcuts for po-util. The shortcuts are interpreted by the atom build package, and the corresponding po-util command is run.
Atom Build Shortcuts:
Build CTRL-ALT-1 These shortcuts allow you This requires the
Flash CTRL-ALT-2 to run common po-util "build" package for
Clean CTRL-ALT-3 commands quickly while Atom. Get it with:
DFU CTRL-ALT-4 using Atom. "apm install build"
OTA CTRL-ALT-5
I have updated the library manager commands to automatically add and remove includes to and from the firmware/main.cpp file when a library is added to a project, just like how the Web IDE adds includes when libraries are added.
Hi,
First, thanks a lot for this amazing tool. I finally managed to get everything as I wanted : to be able to work off-line.
Three requests/questions regarding your tool:
When adding a library that has more than one set of .cpp/.h, only the files named by the library is imported. Example: I’m fetching Adafruit_SSD1306 from https://github.com/pkourany/Adafruit_SSD1306.git and I had to manually add the symbolic links to the Adafruit_GFX.* files.
Not sure if you can do something about this one. The following library: Adafruit_GFX has its file within a firware directory which doesnt’t seem to be consistent with what you’re expecting. As I want to kept the “git” update available, I don’t want to mess with the directory in ~.po-util/lib.
Adding automatically the header may be fine for some user but in my case, and I shouldn’t be the only one ;), the main.cpp is not where I want to add the headers. So maybe keep this as an option ?
Once again, your tools is pretty amazing, and really usefull !
po-util can now download libraries from Particle Libraries 2.0 using particle-cli.
Libraries can be downloaded using the po lib get command, supplying the name of the library instead of a URL to a repository.
Libraries are added to the central library folder ~/.po-util/lib just like Git libraries.
Example:
$ po lib get neopixel
po-util will use particle-cli to download the library because the argument is not a URL.
If you enter an invalid library name, po-util will use particle-cli to search for libraries instead, so that you can find the library you want.
Example:
$ po lib get liquid
Attempting to download liquid using Particle Libraries 2.0...
Checking library liquid...
Library liquid not found
> Found 4 libraries matching liquid
LiquidCrystal 0.0.3 1121 LiquidCrystal on Spark Core
LiquidCrystal_I2C_Spark 1.1.0 816 LiquidCrystal_I2C ported for Spark Core
Adafruit_LiquidCrystal 1.0.2 125 A fork of Adafruit LiquidCrystal library that support i2c / SPI character LCD backpack.
liquid-crystal-spi 0.0.1 88 A Hardware and Software SPI driven LiquidCrystal library for Spark Core.
You can add a library to a project the same way you would add a Git library:
@jaza_tom
It could be that it doesn’t like that your folder has a space in it. Never really seen this error before but I would definitely try renaming JazaHub Controller.
Update:
I just confirmed this on my machine, a directory path with a space in it will produce this error. I’ll try to find a fix for this. In the meantime I think po-util will work if you rename the JazaHub Controller directory to something more friendly like JazaHub-Controller.
Hope you enjoy using po-util for your projects! I’d recomend looking into the library manager. It’s pretty slick, and it can use libraries from GitHub or Particle Libraries 2.0.
Not that I know of really. Po-util will intelligently create the #include "folder1/folder1.h" statements when adding a library to a project however. I’m not sure how to flatten the file structure without making po-util do unnecessary work.
Might be getting a bit off this thread’s topic but how would I go about making a file structure like this work if files in one subfolder need to include files in another subfolder?
For example
firmware
folder1
folder1.h
folder1.cpp
-folder2
folder2.h
folder2.cpp
main.cpp
and then in folder2.cpp I have:
#include "../folder1/folder1.h"
but I sense that doing things this way with the “…/” appended to the front of the file path is frowned upon. What is the correct way?
Even more awesome is that po-util will automatically try to download libraries that a library or project depends on. Also it has an example manager that will list avaliable examples for an installed library and allow you to load them into your project.
$ po init DEVICE_TYPE BNO055
$ cd BNO055
$ po lib get https://github.com/nrobinson2000/particle-BNO055
$ po lib ex ls particle-BNO055
$ po lib ex load particle-BNO055 simple