Sending additional files to cloud compiler

Here are a couple of updates to the CLI cloud compile command.

The CLI 3.11.1 includes support to send additional files to the cloud compiler when doing particle compile (and by extension when using the "Particle: Cloud Compile" command in Workbench). Here are the docs on this feature.

Create a file called particle.include and list the file patterns that should be included. Here are some examples:

# include all the .def files anywhere in the project or libraries
**/*.def
# include one specific file
src/resource.hex
# include some files from the same directory as the particle.include
*.txt

As noted in the docs, you can add a particle.include in any subdirectory of a project, even in a published Particle library so that projects that install the library will get that particle.include file.

There is also a particle.ignore file that does the opposite: prevent sending irrelevant files to the cloud compiler. Those can also be added to libraries that contain extra documentation files.

The CLI will also now send src/build.mk to the cloud compiler. That's an advanced feature that allows overriding Device OS makefile variables so it requires digging through Device OS to properly utilize (not for the faint of heart!). Here's an example from the Tracker Edge repo

One last note is that we strongly recomend anyone who is still using the legacy project structure with all the files in one directory without an src directory to move to the standard structure created by Workbench "Create new project" or particle project create. This structure has better support for libraries. While we still support the legacy format now, we may deprecate it in the future (with a proper announcement).

4 Likes