What is an executor ?
An executor is a way to execute a target. Technically speaking, it is just a piece of code which takes specific options as an input. This code is called when running a target that uses this executor.
Each target defined in any project must reference an executor.
There are two different kinds of executors :
Standard executors​
Some executors are provided out of the box :
commands
, used in order to run system commands, possibly in parallel.exec
, similar to thecommands
standard executor, but for executing a single program, or shell script.
These standard executors can be referenced in any target using the std
scheme, like shown above :
{
"targets": {
"say-hello": {
"executor": "std:commands",
"options": {
"commands": [
{
"program": "echo",
"arguments": ["Hello world!"]
}
],
}
}
}
}
The goal of standard executors is to remain as generic as possible and serve all basic use cases.
Custom executors allows you to write executors that can be resolved from different sources like the filesystem or the network.
Custom executors​
In some cases, it is required to replicate the same logic across multiple targets. Standard executors may not be suitable for this purpose.
You can create your own executors and use them in project inside your workspace.
You can also publish an executor if you want to make it available everywhere.
Blaze supports writing custom executors in different languages/runtimes :
Executor resolvers​
There are multiple ways to resolve a custom executor within your target configuration.
Executor references are provided as URL strings.
Multiple locations are supported :