class Hace::PatternRule

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

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, shell : String | Nil = nil) #

[View source]

Instance Method Detail

def commands : String #

[View source]
def commands=(commands : String) #

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

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

[View source]
def dependencies_for(stem : String) : Array(String) #

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


[View source]
def 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".


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

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

[View source]
def shell : String | Nil #

[View source]
def shell=(shell : String | Nil) #

[View source]
def validate!(index : Int32) : Nil #

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


[View source]