Project files - OutbreakInc/Galago GitHub Wiki

A Galago project, whether created inside the IDE or not, has a project file that defines it. This file is named module.json and is stored in JSON notation. To create a project from scratch, use the template available below, or invoke SDK.js with the option --init, as described in the command-line section of the getting started guide. The directory that contains a project file is a project directory, and that is what the build tools use to locate sources and build them.

Example

This is an example of a very simple project file usable by the Logiblock IDE and command-line tools:

{
  "name": "test",
  "version": "0.1",
  "files":
  [
    {
      "name": "main.cpp"
    }
  ],
  "compatibleWith":
  [
    "Galago4"
  ]
}

The compatibleWith property is a list of platforms the code can be built for. Currently, only the first entry is interpreted, and it refers to a node on the settings inheritance tree defined by the targets.json file in the Logiblock Platform module (currently undocumented.)

You may specify multiple source files by appending objects containing name properties to the files property:

"files":
[
  {
    "name": "main.cpp"
  },
  {
    "name": "other.c"
  },
  {
    "name": "lowlevel.S"
  }
],

Documentation

name - module/project name

string; must contain only alphanumeric characters, '_' and '-'.

version - module/project version

string, required; a sequence of integers separated by '.' characters, such as "0.1.2.3". There are no restrictions on the number of digits between '.' characters, nor on the number of digit groups. When two version strings are compared, both are left-justified and compared group-by-group. Inductively, this produces the following results:

  • "0.5" > "0.4"
  • "0.5" > "0.4.0"
  • "0.5" > "0.4.10"
  • "0.1" < "1"
  • "1.9" < "1.10"
  • "0.0.0.100" < "0.1"
  • "0.1" == "0.1.0.0.0"

files - project files

array of objects, required; each object can contain the following fields:

  • name: string, required; name of the file. Should be a leaf name, like main.cpp and not include a directory
  • dir: string, optional; directory relative to the base that contains the file
  • base: string, optional; one of: "project", "platform" or "sdk", declaring that the file is relative to the project root (the location of the module.json file), the current platform upon which it is built (i.e. Galago library code), or the underlying SDK (i.e. gcc toolchain). If not specified taken to be "project".

settings - project build settings

object, optional; the following fields are supported:

  • gaunt: boolean, optional; if true, omits the C standard library (stdlib) from the build. This is the default. Including stdlib is not currently recommended on Galago for code-size reasons.
  • debug: boolean, optional; if true, enables debugging support in the built ELF binary. There is no reason to disable this, as there's no difference to the firmware installed on a device.

compatibleWith - supported platforms

array of strings, required; defines the hardware platforms (e.g. Galago) that the project can build on. Currently, the only meaningful value is "Galago4". For more insight, look at the targets.json file in the logiblock/platform module.

otherCompilerFlags - gcc flags

array of strings, optional; any gcc command-line argument is permitted, such as the following taken from the underlying target definitions in the Galago platform code:

  • "-mcpu=cortex-m3"
  • "-mthumb"
  • "-fno-exceptions"