fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
03d1d5e4
0.9.0
1"""Test transitions to test extra_exec_rustc_flags.""" 2 3def _extra_exec_rustc_flags_transition_impl ( _settings , attr ): 4return { 5"//:extra_exec_rustc_flag" : attr . extra_exec_rustc_flag , 6"//:extra_exec_rustc_flags" : attr . extra_exec_rustc_flags , 7} 8 9_extra_exec_rustc_flags_transition = transition ( 10implementation = _extra_exec_rustc_flags_transition_impl , 11inputs = [], 12outputs = [ "//:extra_exec_rustc_flags" , "//:extra_exec_rustc_flag" ], 13) 14 15def _with_extra_exec_rustc_flags_cfg_impl ( ctx ): 16return [ DefaultInfo ( files = depset ( ctx . files . srcs ))] 17 18with_extra_exec_rustc_flags_cfg = rule ( 19implementation = _with_extra_exec_rustc_flags_cfg_impl , 20attrs = { 21"extra_exec_rustc_flag" : attr . string_list ( 22mandatory = True , 23), 24"extra_exec_rustc_flags" : attr . string_list ( 25mandatory = True , 26), 27"srcs" : attr . label_list ( 28allow_files = True , 29cfg = _extra_exec_rustc_flags_transition , 30), 31"_allowlist_function_transition" : attr . label ( 32default = Label ( "//tools/allowlists/function_transition_allowlist" ), 33), 34}, 35) 36 37def _with_exec_cfg_impl ( ctx ): 38return [ DefaultInfo ( files = depset ( ctx . files . srcs ))] 39 40with_exec_cfg = rule ( 41implementation = _with_exec_cfg_impl , 42attrs = { 43"srcs" : attr . label_list ( 44allow_files = True , 45cfg = "exec" , 46), 47}, 48)