class

Hace::PatternRule

Inherits YAML::Serializable::Strict < YAML::Serializable < Reference < Object

A template rule that synthesizes concrete tasks for dependencies not covered by explicit tasks, mirroring make's pattern rules ("%.o: %.c"). Patterns live in the Hacefile under a top-level patterns: key and are expanded at load time, before the task graph is built.

Constructors

new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Source
new(commands : String, outputs : Array(String) = [] of String, dependencies : Array(String) = [] of String, shell : String | Nil = nil)
Source
new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Source

Instance methods

commands
Source
commands=(commands : String)
Source
dependencies
Source
dependencies=(dependencies : Array(String))
Source
dependencies_for(stem : String) : Array(String)

Dependencies with '%' placeholders replaced by stem. Dependencies without a placeholder pass through unchanged.

Source
match_stem(name : String) : String | Nil

The stem with which name matches this pattern's output, or nil when there is no match. Empty stems are rejected so "%.o" does not match a file literally named ".o".

Source
outputs
Source
outputs=(outputs : Array(String))
Source
shell
Source
shell=(shell : String | Nil)
Source
validate!(index : Int32) : Nil

Structural checks that YAML parsing cannot express. Raises with a message identifying the offending pattern.

Source