Contoh: aturan berikut ditandai sebagai setelan build dengan menetapkan parameter build_setting dari fungsi rule(). Secara khusus, ini adalah setelan build berjenis int dan merupakan flag yang berarti setelan build ini dapat dipanggil di command line.
my_rule = rule(
implementation = _impl,
build_setting = config.int(flag = True),
...
)Anggota
bool
BuildSetting config.bool(*, flag=False)
Parameter
| Parameter | Deskripsi |
|---|---|
flag
|
bool;
default is FalseWhether or not this build setting is callable on the command line. |
exec
ExecTransitionFactory config.exec(exec_group=None)
Parameter
| Parameter | Deskripsi |
|---|---|
exec_group
|
string; or None;
default is NoneThe name of the exec group whose execution platform this transition will use. If not provided, this exec transition will use the target's default execution platform. |
int
BuildSetting config.int(*, flag=False)
Parameter
| Parameter | Deskripsi |
|---|---|
flag
|
bool;
default is FalseWhether or not this build setting is callable on the command line. |
none
transition config.none()
string
BuildSetting config.string(*, flag=False, allow_multiple=False)
Parameter
| Parameter | Deskripsi |
|---|---|
flag
|
bool;
default is FalseWhether or not this build setting is callable on the command line. |
allow_multiple
|
bool;
default is FalseDeprecated, use a string_list setting with repeatable = True instead. If set, this flag is allowed to be set multiple times on the command line. The Value of the flag as accessed in transitions and build setting implementation function will be a list of strings. Insertion order and repeated values are both maintained. This list can be post-processed in the build setting implementation function if different behavior is desired.
|
string_list
BuildSetting config.string_list(*, flag=False, repeatable=False)
--//my/setting=foo,bar.
Parameter
| Parameter | Deskripsi |
|---|---|
flag
|
bool;
default is FalseWhether or not this build setting is callable on the command line. |
repeatable
|
bool;
default is FalseIf set, instead of expecting a comma-separated value, this flag is allowed to be set multiple times on the command line with each individual value treated as a single string to add to the list value. Insertion order and repeated values are both maintained. This list can be post-processed in the build setting implementation function if different behavior is desired. |
string_set
BuildSetting config.string_set(*, flag=False, repeatable=False)
--//my/setting=foo,bar.Tidak seperti string_list, urutan elemen tidak menjadi masalah dan hanya satu instance dari setiap elemen yang dipertahankan. Hal ini direkomendasikan daripada string_list untuk flag yang tidak memerlukan properti ini karena dapat meningkatkan performa build dengan menghindari konfigurasi yang tidak perlu.
Parameter
| Parameter | Deskripsi |
|---|---|
flag
|
bool;
default is FalseWhether or not this build setting is callable on the command line. |
repeatable
|
bool;
default is FalseIf set, instead of expecting a comma-separated value, this flag is allowed to be set multiple times on the command line with each individual value treated as a single string to add to the set value. Only a single instance of repeated values is maintained and the insertion order does not matter. |
target
transition config.target()
cfg = "target" di attr.label().