pub enum Target {
Build {
dependencies: Dependencies,
build: String,
input: InputResources,
output: OutputResources,
},
Service {
dependencies: Dependencies,
service: String,
input: InputResources,
},
Aggregate {
dependencies: Dependencies,
},
}
Expand description
A target is a command or a set of commands to run as part of your build flow.
Targets run in parallel by default.
To force targets to run sequentially, you can define dependencies
on other targets.
Variants§
Build
Fields
dependencies: Dependencies
Dependencies of the target.
build: String
The shell script to run in order to build this target.
It should be a string. This string can be multi-line, in case of scripts with multiple commands.
Example
targets:
create_file_deep:
build: |
mkdir -p deep/dir
touch deep/dir/file
output:
- paths: [deep/dir/file]
In this example, running zinoma create_file_deep
will execute the commands mkdir -p deep/dir
and touch deep/dir/my_file
sequentially.
input: InputResources
Input resources of the target.
output: OutputResources
Output resources of the target.
A build target represents a shell script to run as part of your build flow.
This build script is expected to eventually complete,
as opposed to the run script of a service
target.
Service
Fields
dependencies: Dependencies
Dependencies of the target.
service: String
Shell script starting a long-lasting service.
It should be a string.
If zinoma
has no service target to run, it will automatically exit after all build targets ran to completion.
On the contrary, if at least one service target is specified in the command line,
zinoma
will keep running even after all build targets completed, so that the services can remain alive.
In watch mode (when the --watch
flag is passed to zinoma
), services are restarted when the relevant paths are modified.
Example
targets:
npm_server:
input:
- paths: [package.json, index.js]
service: npm start
In this example, zinoma npm_server --watch
will run npm start
,
and will restart this process every time package.json
or index.js
are updated.
input: InputResources
Input resources of the target.
Service targets are useful to run scripts that do not complete.
They enable the execution of long-lasting commands, such as servers.
Aggregate
Fields
dependencies: Dependencies
Dependencies of the target.
Aggregates other targets.
Example
targets:
fmt:
build: cargo fmt -- --check
lint:
build: cargo clippy
test:
build: cargo test
check:
dependencies: [fmt, lint, test]
In this example, the target named check
aggregates the 3 other targets.
zinoma check
is equivalent to running zinoma fmt lint test
.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Target
impl<'de> Deserialize<'de> for Target
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl JsonSchema for Target
impl JsonSchema for Target
source§fn schema_name() -> String
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read more