2
0
Fork 0
mirror of https://github.com/bazelbuild/bazel-skylib synced 2024-11-27 05:43:25 +00:00
bazel-skylib/docs/common_settings_doc.md
Alexandre Rostovtsev 6e30a77347
Update internal dependencies to modern versions. Bazel Federation repo is deprecated. (#327)
See https://github.com/bazelbuild/bazel-federation/pull/127

In particular, this allows us to use a modern Stardoc release to fix generated md docs.

And we can remove internal_deps.bzl/internal_setup.bzl - it's unnecessary complexity
needed only for deprecated Federation setup.
2021-10-27 09:13:59 -04:00

5.2 KiB
Executable file

Common build setting rules

These rules return a BuildSettingInfo with the value of the build setting. For label-typed settings, use the native label_flag and label_setting rules.

More documentation on how to use build settings at https://docs.bazel.build/versions/main/skylark/config.html#user-defined-build-settings

bool_flag

bool_flag(name)

A bool-typed build setting that can be set on the command line

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required

bool_setting

bool_setting(name)

A bool-typed build setting that cannot be set on the command line

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required

int_flag

int_flag(name)

An int-typed build setting that can be set on the command line

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required

int_setting

int_setting(name)

An int-typed build setting that cannot be set on the command line

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required

string_flag

string_flag(name, values)

A string-typed build setting that can be set on the command line

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
values The list of allowed values for this setting. An error is raised if any other value is given. List of strings optional []

string_list_flag

string_list_flag(name)

A string list-typed build setting that can be set on the command line

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required

string_list_setting

string_list_setting(name)

A string list-typed build setting that cannot be set on the command line

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required

string_setting

string_setting(name, values)

A string-typed build setting that cannot be set on the command line

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
values The list of allowed values for this setting. An error is raised if any other value is given. List of strings optional []

BuildSettingInfo

BuildSettingInfo(value)

A singleton provider that contains the raw value of a build setting

FIELDS

Name Description
value The value of the build setting in the current configuration. This value may come from the command line or an upstream transition, or else it will be the build setting's default.