1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---@meta
local
--- Registers a callback function associated with a specific build feature or set of features.
--- - Features represent specific steps or capabilities within the build process, and each feature can have associated callbacks.
--- - This allows modular steps to be registered for execution when the given feature(s) are triggered.
---
---@param feature string|string[] A single feature or list of features that this callback is associated with.
---@param name string The name of this step, used for dependency management.
---@param callback fun(generator:Generator):void The function to execute when this feature is triggered.
---@return Feature A new Feature object that allows setting dependency order.
--- Represents a feature in the build system, allowing configuration of its execution order in relation to other features.
---@class Feature
Feature =
--- Specifies steps that must be completed before this feature can execute.
--- - Attempts to set up a dependency cycle will cause an error, preventing any dependencies from being added.
---
---@param predecessors string[] An optional list of steps that must complete before this step runs.
---@return Feature The same Feature object for chaining further configurations.
--- Specifies steps that will run after this feature, making this step a prerequisite.
--- - Attempts to set up a dependency cycle will cause an error, preventing any dependencies from being added.
---
---@param successors string[] An optional list of steps that must execute after this step completes.
---@return Feature The same Feature object for chaining further configurations.
--- Posts a generator, triggering execution of all callbacks associated with the generator's features.
--- - Each registered feature callback for the generator is called in dependency order, potentially creating tasks or posting other generators.
--- - Posting the same generator multiple times has no additional effect.
---
---@param generator Generator The generator to post for execution.