Target

Info

Used to create an target; can only be placed into the top-level block (file).

Usage:

target "name" {
    # Target commands
}
Arguments
# Name Type Info
0 name str

The name of the target to define

Expanded?: ❌

Known core Subcommands

lang

Sets the language of an target. First argument must be an registered language; everything after it depends on the language selected. See the languages documentation for that.

Usage: lang "name"

Arguments
# Name Type Info
0 name str

The name of the language

Expanded?: ✅

desc

Sets a description for the target. This is purely visual.

Usage: desc "Some description"

Arguments
# Name Type Info
0 value str

The description of the target

Expanded?: ✅

type

Sets the type of the target. Required.

Example: type bin

Arguments
# Name Type Info
0 type sym

The type the of the target

Allowed values:
  • bin
  • binary
  • lib
  • library

source

Adds a source to the project. This can either be a glob (like ./src/*.cpp) or an directory, in which case the language you’ve set will determine the files included. The string can also be in the form of accessor://remote to use an remote source. For more informations about accessors, see its documentation.

use "./src"

use "./src/**/*.cpp"

use "git://myrepo.com/my/repo"
Arguments
# Name Type Info
0 source str Expanded?: ✅

use

Adds a dependency to the current target. There are two kinds of dependencies: local and remote:

  • local dependecies are simply dependencies to other targets. They are done by simply writing the name of it: use "mylib"
  • remote dependencies are whre nitto’s repository system comes in. They are build like an url: accessor://remote, like: mvn://some/maven/dependency. For more informations about accessors, see its documentation.

Examples:

use "mylib"

use "mvn://some/maven/dependency"

There is however a optional second argument: static. With it, you can express that the connection to the dependency should be static, which for example means to c/c++ to link statically.

Arguments
# Name Type Info
0 remote str Expanded?: ✅
1 static (optional) sym Allowed values:
  • static

set_data

The set_data command is used to manipulate the target’s datastore. There are two ways to use this command:

  • simple: set_data <key> <value>
  • complex: set_data <type> <key> <operation> <values ...>

simple

When using this variant, keys set with this are only containing strings.

Example: set_data "my.key" "123456"

Arguments
# Name Type Info
0 key str

The key to set

Expanded?: ✅
1 value str

The value to set the key to

Expanded?: ✅

complex

When using this variant, you can choose better what data to store and better manipulate it.

Type Operation Description
str_list clear Clears the list
append Appends to the end of the list
path_str set Sets a path; allows for both build:// and out:// prefixed paths!
Arguments
# Name Type Info
0 type sym

The type of the key; see table above

1 key str

The key to set

Expanded?: ✅
2 operation sym

The operation to do; see table above

3 val str

The value to use as input for the operation

Expanded?: ✅