Skip to content

Developer Setup

Daniel Lasry edited this page Jun 5, 2020 · 14 revisions

First, fork the repo and clone it locally. When done, return here.

Software

Install:

Installing Processing On Windows:

There are a few extra steps to be able to run the GUI from VSCode:

  1. Open the "System Properties" window:
    1. Type "Advanced System Settings" in the windows search bar
    2. Select "View advanced system settings"
  2. In the "System Properties" window, click on the Advanced tab.
  3. In the "Advanced" section, click the Environment Variables button.
  4. Edit the "Path" variable. Append the processing path (Example: C:\Program Files\Processing-3.0.1\) to the variable value. Each entry is separated with a semicolon.

Installing Processing on Mac:

There are a few extra steps to be able to run the GUI from VSCode:

  1. Launch Processing
  2. Go to the menu Tools -> Install "processing-java"
  3. Click OK and enter your password.

Installing Processing on Linux:

This is an excellent guide for installing Processing on Linux

To build from VSCode, you also have to add processing-java to your PATH:

sudo su -c "ln -s /opt/processing-3.0.2/processing-java /usr/local/bin/processing-java"

Learn more about VSCode:

Visual Studio Code Set Up

Open the project

  1. Open VSCode
  2. Click "Open folder..."
  3. Select your OpenBCI_GUI folder. (NOT OpenBCI_GUI/OpenBCI_GUI)

Now you should see all the files in the explorer on the left.

Launching the GUI from VSCode

Install Libraries

  • Go to the OpenBCI_GUI folder you cloned.

  • Copy the contents of OpenBCI_GUI/OpenBCI_GUI/libraries to Processing's libraries folder:

    • On Mac: /Users/<username>/Documents/Processing/libraries
    • On Windows: C:\Users\<username>\Documents\Processing\libraries
  • If you get Duplicate libraries found for com.sun.jna., delete the jna library in Processing folder you just copied to. Keeping this library in the project folder fixes LSL networking in GUI Standalone for all OS.

  • Even better if you don't want to copy libraries every time: make a symbolic link.

    • On Windows: mklink /D C:\Users\<username>\Documents\Processing\libraries C:\Users\<username>\git\OpenBCI_GUI\OpenBCI_GUI\libraries

Install the Processing Extension

  1. Switch to the Extensions manager with Ctrl+ Shift + X or click the icon on the left.
  2. Search for Processing and install the Processing Language extension.
  3. Click "reload" after it installs. Or relaunch VSCode.

Set up your tasks.json file

  1. With the GUI project open, Hit Ctrl + Shift + B on Windows, or Cmd + Shift + B on Mac.
  2. Click on the message No build task to run found. Configure Build Task...
  3. Click Create tasks.json file from template then Others

This will create a tasks.json file under a .vscode directory. Open it, and replace it with this file. Text here:

{
    "version": "2.0.0",
    "tasks": [
      {
        "label": "Run Sketch",
        "type": "shell",
        "group": {
          "kind": "build",
          "isDefault": true
        },
        "command": "${config:processing.path}",
        "presentation": {
          "echo": true,
          "reveal": "always",
          "focus": false,
          "panel": "dedicated"
        },
        "args": [
          "--force",
          "--sketch=${workspaceRoot}/OpenBCI_GUI",
          "--output=${workspaceRoot}/OpenBCI_GUI/build",
          "--run"
        ],
        "windows": {
          "args": [
            "--force",
            "--sketch=\"${workspaceRoot}\\OpenBCI_GUI\"",
            "--output=${workspaceRoot}\\OpenBCI_GUI\\build",
            "--run"
          ]
        }
      }
    ]
  }

Now you can launch the GUI with Ctrl+ Shift + B.

On Windows, git conveniently provides the Git Bash, which can be used from VSCode as pictured below. It's a great way to run git commands, such as branching, fetching, pushing, etc.

VSCode has lots of great functionality, hidden from plain sight. It can help you with github commits, staging files, handling merge conflics, and much more. There are many extensions to discover. If you find something useful, please share it here!

Troubleshooting

Linux

If you get Error: Could not find build output: ......./application.linux64 when running make-release.py, there may be an issue with permissions. This can be fixed by using built-in Linux repair tools. Try sudo touch /forcefsck to force Ubuntu to check the filesystem on next boot.