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 Debug for Target

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Target

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl JsonSchema for Target

source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
source§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
source§

impl Serialize for Target

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,