The following is a suggested workflow for new Pico developers. Related information is available in the following resources:
Programming involves a collection of tools, often referred to as the "tool chain" since they are used more or less in sequence. Here's a graphical representation of the tool chain for programming picos, noting each stage. We'll use this to organize the remainder of this document.
To develop KRL for picos, you can use Git (or another versioning tool) and your favorite editor. There are plug ins for several popular editors.
Create a directory for your project
$ mkdir workflow $ cd workflow/ |
Initialize the project directory as a Git repository
$ git init |
The build process for rulesets primarily involves parsing to ensure it is correctly formatted. The preferred way to do this is using a Git pre-commit hook.
Follow the directions in Setting Up a Git Pre-Commit Hook to Parse KRL to set up the KRL parser and ensure that KRL files are parsed before they are committed.
Add the file to the repository and commit it.
$ git add hello_world.krl $ git commit -a -m "initial commit" Flushing com.windley.hello_world [master (root-commit) 4a2f95c] initial commit 1 file changed, 34 insertions(+) create mode 100644 hello_world.krl |
With the pre-commit hook in place, you're assured that there are no parse errors in your ruleset if it commits.
Deploying
Also, the pre-commit hook flushes rulesets in a local engine.
file:///Users/pjw/prog/picolabs/pico_lessons/workflow/hello_world.krl
You'll now see the ruleset listed in the installed rulesets in the pico. If you click on the "Engine Rulesets" link, you'll navigate to a page that shows the rulesets registered with the engine.
ruleset
in the code) is used as the ruleset identifier (RID) by the engine.