rules/imp/generate/index.js
Developer reference: this page includes exported implementation details. BUILD authors should prefer the User API reference.
planGeneratedOutputs()
planGeneratedOutputs(api, { tools, inputs, outputPaths, argv })
Validate the authoring surface that generatedFiles() and //rules/imp/codegen's codegen() have in common, and name one action output slot per output path. The two differ only in where their outputs go — the workspace, or the graph — so they share one set of rules about what a caller may declare. Internal to the two generator entrypoints; not part of the public rule API.
| Parameter | Type | Description |
|---|---|---|
| api | string | Caller name, for error messages. |
Returns: {toolNames: string[], inputNames: string[], slots: string[]}
generatedFileIsStale()
generatedFileIsStale(path, digest)
Report whether the generated content at digest differs from the file currently at path in the workspace. A missing file counts as stale.
| Parameter | Type | Description |
|---|---|---|
| path | string | Workspace-relative output path. |
| digest | string | Digest of the tree holding the generated path. |
Returns: boolean