Skip to main content

Build files

Every project has a build.markup.code at its top. It says what the project builds, names it, and lists the libraries it depends on. This is a program's, as New Project writes it with the Raspberry Pi library chosen:

build.markup.code
(IsolateAssemblyBuild
name={"robot"}
group={"com.me"}
version={"0.1.0"}

(+dependencies : RepositoryDependency coordinate={"com.grandtheorem:raspberry-pi:0.1.0"} /)
/IsolateAssemblyBuild)

A build file is markup: a tag in parentheses, with attributes, and tags inside it. Every attribute's value is a string in braces, name={"robot"}.

What it builds​

The outer tag says what the project makes:

  • IsolateAssemblyBuild builds a program, which runs as an isolate.
  • LibraryAssemblyBuild builds a library, for other projects to use.
build.markup.code
(LibraryAssemblyBuild
name={"sensors"}
group={"com.me"}
version={"0.1.0"}
/LibraryAssemblyBuild)

Naming it​

  • name, group and version are required. Together they're the project's coordinate, com.me:robot:0.1.0, which is how a library is found and named.
  • version is a semantic version: three numbers, such as 0.1.0.
  • description is optional.

Dependencies​

Each dependency is a +dependencies tag. Four kinds say where the library comes from:

  • RepositoryDependency, with coordinate: from the library repository, by its coordinate.
  • GitDependency, with url, at most one of branch, tag or commit, and an optional path: from a Git repository, built from source.
  • ProjectDependency, with path: another project on your computer, built from source.
  • FileDependency, with path: a library file that's already built.

You rarely write these by hand: Tools | Nylon | Add Nylon Library… writes the line for you. Libraries has the details.

Modules​

A project has one module, main, at src/main, unless the build file names its modules itself:

build.markup.code
(IsolateAssemblyBuild
name={"robot"}
group={"com.me"}
version={"0.1.0"}

(+modules let main : IsolateAssemblyModule /)
/IsolateAssemblyBuild)

A module's code is at src/<name>/code, or at the folder its path attribute names. In a library, a module is a LibraryAssemblyModule.