Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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. Image Removed

...

Develop

To develop KRL for picos, you can use Git (or another versioning tool) and your favorite editor. There are old plug ins for several popular editors.

  1. Create a directory for your project 

    Code Block
    languagebash
    $ mkdir myproject
    $ cd myproject/


  2. Initialize the project directory as a Git repository

    Code Block
    languagebash
    $ git init


  3. Create a KRL ruleset as a file in the repository using your favorite editor. There may be a KRL plugin for your editor

Build

The build process for rulesets primarily involves editing them and then parsing them to ensure it is they are correctly formatted. The preferred way to do this ensure they parse is using a Git pre-commit hook. 

  1. 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. 

  2. Add the file to the repository and commit it. 

    Code Block
    languagebash
    $ git add hello_world.krl
    $ git commit -a -m "initial commit"
    All rulessets parse
    [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

    .

...

  1. .

...

file:///Users/pjw/prog/picolabs/pico_lessons/workflow/hello_world.krl

...

File-based URLs work great for development where quick turnaround is needed. If you want to host rulesets somewhere else, please be sure to read the tips for hosting rulesets

Again, you only need a register a ruleset once on any engine, even if the source code changes. The only reason to re-register a ruleset is if its RID or URL change.  

Deploy

Deploying consists of installing the ruleset in any picos it needs to run in. If the ruleset has already been installed, then it will just need to be flushed. 

...

Once the ruleset is installed, it will show up in the Installed Rulesets section of this page. 

Flushing

Because the engine compiles and caches the ruleset, whenever you make changes to the source, you need to flush the ruleset. For development and testing, you can do that manually from the Installed Rulesets section of the develop interface. 

...

This will flush the ruleset for all picos on this instance of the pico-engine. The hash will change with each new version of the file and is unique for every version of the file

If you have not parsed your rulesets when you commit them (as described above) then the developer interface will show you any errors when you install or flush the ruleset

Test 

The developer interface includes support for testing your rulesets. See the detailed instructions for more information on how to configure and use that feature. 

...