class Hace::CommandTask

Overview

A task that runs a shell command

Included Modules

Defined in:

hace.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

[View source]
def self.new(commands : String, outputs : Array(String) = [] of String, dependencies : Array(String) = [] of String, phony : Bool = false, default : Bool = false, always_run : Bool = false, cwd : String | Nil = nil, description : String | Nil = nil, shell : String | Nil = nil, stem : String | Nil = nil) #

Plain keyword constructor used when synthesizing tasks from patterns. It coexists with the YAML::Serializable-generated parser initializer.


[View source]

Instance Method Detail

def always_run? : Bool #

[View source]
def commands : String #

Read-only accessors so callers don't have to reach into instance vars.


[View source]
def cwd : String | Nil #

[View source]
def default? : Bool #

[View source]
def dependencies : Array(String) #

[View source]
def description : String | Nil #

[View source]
def expand(task_name : String) #

We want to support variables and environment variables also in things like dependencies, outputs, etc. so we need to do some post-processing

Besides the global VARIABLES, they also have access to self, which is rebuilt after each stage so it always reflects the current state.


[View source]
def gen_task(name, hacefile : HaceFile, dry_run : Bool = false) #

ameba:disable Metrics/CyclomaticComplexity


[View source]
def outputs : Array(String) #

[View source]
def phony? : Bool #

[View source]
def shell : String | Nil #

[View source]
def stem : String | Nil #

[View source]