Skip to content

Latest commit

 

History

History
executable file
·
100 lines (63 loc) · 5.82 KB

rules_and_macros_overview.md

File metadata and controls

executable file
·
100 lines (63 loc) · 5.82 KB

Rules and Macros

The rules and macros described below are used to update source files from output files.

On this page:

updatesrc_update

updatesrc_update(name, deps, srcs, outs)

Updates the source files in the workspace directory using the specified output files.

There are two ways to specify the update mapping for this rule.

Option #1: You can specify a list of source files and output files using the srcs and outs attributes, respectively. The source file at index 'n' in the srcs list will be updated by the output file at index 'n' in the outs list.

Option #2: Rules that provide UpdateSrcsInfo can be specified in the deps attribute.

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
deps Build targets that output UpdateSrcsInfo. List of labels optional []
srcs Source files that will be updated by the files listed in the outs attribute. Every file listed in the srcs attribute must have a corresponding output file listed in the outs attribute. List of labels optional []
outs Output files that will be used to update the files listed in the srcs attribute. Every file listed in the outs attribute must have a corresponding source file list in the srcs attribute. List of labels optional []

updatesrc_diff_and_update

updatesrc_diff_and_update(srcs, outs, name, update_name, diff_test_prefix, diff_test_suffix,
                          update_visibility, diff_test_visibility, kwargs)

Defines an updatesrc_update for the package and diff_test targets for each src-out pair.

PARAMETERS

Name Description Default Value
srcs Source files that will be updated by the files listed in the outs attribute. Every file listed in the srcs attribute must have a corresponding output file listed in the outs attribute. none
outs Output files that will be used to update the files listed in the srcs attribute. Every file listed in the outs attribute must have a corresponding source file list in the srcs attribute. none
name Optional. The name of the updatesrc_update target. None
update_name Deprecated. The name of the updatesrc_update target. "update"
diff_test_prefix Optional. The prefix to be used for the diff_test target names. ""
diff_test_suffix Optional. The suffix to be used for the diff_test target names. "_difftest"
update_visibility Optional. The visibility declarations for the updatesrc_update target. None
diff_test_visibility Optional. The visibility declarations for the diff_test targets. None
kwargs Common attributes that are applied to the underlying rules. none

updatesrc_update_all

updatesrc_update_all(name, targets_to_run, targets_to_run_before)

Defines a runnable target that will query for updatesrc_update targets and run them.

The utility queries for all of the updatesrc_update rules in the workspace and executes each one. Hence, source files that are mapped in these targets will be updated.

Additional targets to execute can be specified using the targets_to_run and targets_to_run_before attributes.

PARAMETERS

Name Description Default Value
name The name of the target. none
targets_to_run A list of labels to execute after the updatesrc_update targets. []
targets_to_run_before A list of labels to execute before the updatesrc_update targets. []

RETURNS

None.