I am experimenting with deploying some teaching materials to my students. The idea is that I have a bunch of firmware files that are somewhat related which I'd like them to play around with (they represent different projects). I thought at first that I'd create N new projects, work on the file associated with my project as in myprojectname.cpp and then have then open one at a time. Does this seem right, or would it make more sense to simply distribute the cpp files on their own and have them create the projects themselves, or by copy/pasting things into a single demo project?
Or maybe people prefer to simply distribute the projects without any of the build folders and instruct people to build the projects on their local machines?
There isn't a specific right way to do this, however you should avoid multi-root projects, as they can be confusing.
A normal single-root project opens only to that folder and has the project.properties file and src directory within it.
A multi-root project contains multiple projects, typically because you opened a directory containing multiple projects. The confusion arises because Workbench does not use the currently open file in determining what to build, and will either build everything, or prompt you to select a project every time you build, which is annoying.
Whether you have your students use Particle: Create New Project and paste the code into a new project or distribute pre-created projects, each with a project.properties, src directory, and source file, is up to you.
Thanks all! I think for the "open box experience" it might make most sense to copy/paste. My feeling is that people get hung up with forgetting to select the deviceOS, device target, and finding the name, etc.
My understanding is that they would still have to configure each one of these projects to assign them to the target device, OS, and platform, yes? In which case, it seems like a stumbling point.
You still need to Particle: Configure Project for Device whether you create a new project or import an existing one.
The exception is that you could include the .vscode directory and the settings.json file in your prepared project. This would cause the device type and Device OS version to be pre-set. Make sure you don't set the device name or ID, however. Just press Esc when prompted. If the device name is not set, it will use the currently connected device, or prompt if more than one is connected.
Are the students able to git clone from GitHub?
If so, you could have a public repo with all the configs (.vscode directory and the settings.json for instance) and demo files ready to be copy-pasted around (stored under the lib folder I know they do not get compiled) so everyone gets the skeleton of the project with one command.