xref: /aosp_15_r20/external/bazelbuild-rules_rust/wasm_bindgen/private/transitions.bzl (revision d4726bddaa87cc4778e7472feed243fa4b6c267f)
1"""Transition implementations for wasm-bindgen rust Rules"""
2
3def _wasm_bindgen_transition(_settings, _attr):
4    """The implementation of the `wasm_bindgen_transition` transition
5
6    Args:
7        _settings (dict): A dict {String:Object} of all settings declared
8            in the inputs parameter to `transition()`
9        _attr (dict): A dict of attributes and values of the rule to which
10            the transition is attached
11
12    Returns:
13        dict: A dict of new build settings values to apply
14    """
15    return {"//command_line_option:platforms": str(Label("//rust/platform:wasm"))}
16
17wasm_bindgen_transition = transition(
18    implementation = _wasm_bindgen_transition,
19    inputs = [],
20    outputs = ["//command_line_option:platforms"],
21)
22