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)
Sourcenew(commands : String, outputs : Array(String) = [] of String, dependencies : Array(String) = [] of String, shell : String | Nil = nil)
Sourcenew(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
SourceInstance methods
commands
Sourcecommands=(commands : String)
Sourcedependencies
Sourcedependencies=(dependencies : Array(String))
Sourcedependencies_for(stem : String) : Array(String)
Dependencies with '%' placeholders replaced by stem. Dependencies without a placeholder pass through unchanged.
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".
outputs
Sourceoutputs=(outputs : Array(String))
Sourceshell
Sourceshell=(shell : String | Nil)
Sourcevalidate!(index : Int32) : Nil
Structural checks that YAML parsing cannot express. Raises with a message identifying the offending pattern.