class
Hace::PatternRule
- Hace::PatternRule
- Reference
- Object
Overview
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.
Included Modules
- YAML::Serializable
- YAML::Serializable::Strict
Defined in:
hace.crConstructors
- .new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
- .new(commands : String, outputs : Array(String) = [] of String, dependencies : Array(String) = [] of String, shell : String | Nil = nil)
Instance Method Summary
- #commands : String
- #commands=(commands : String)
- #dependencies : Array(String)
- #dependencies=(dependencies : Array(String))
-
#dependencies_for(stem : String) : Array(String)
Dependencies with '%' placeholders replaced by stem.
-
#match_stem(name : String) : String | Nil
The stem with which name matches this pattern's output, or nil when there is no match.
- #outputs : Array(String)
- #outputs=(outputs : Array(String))
- #shell : String | Nil
- #shell=(shell : String | Nil)
-
#validate!(index : Int32) : Nil
Structural checks that YAML parsing cannot express.
Constructor Detail
Instance Method Detail
Dependencies with '%' placeholders replaced by stem. Dependencies without a placeholder pass through unchanged.
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".
Structural checks that YAML parsing cannot express. Raises with a message identifying the offending pattern.