| # Copyright 2023 The Bazel Authors. All rights reserved. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| """Provides access to all rule adapters with a simple interface.""" |
| |
| load(":adapters_base.bzl", _ADAPTERS = "ADAPTERS", _get = "get", _get_all_aspect_attrs = "get_all_aspect_attrs") |
| |
| ADAPTERS = _ADAPTERS |
| |
| def get(kind): |
| return _get(kind, adapters = ADAPTERS) |
| |
| def get_all_aspect_attrs(): |
| """The union of all the aspect attrs required by all rule adapters. |
| |
| The list is used by the aspect to determine the set of attributes to apply on. |
| |
| Returns: |
| A sorted list of strings, containing the union of all attribute names |
| required by the all the rule adapters. |
| """ |
| return _get_all_aspect_attrs(adapters = ADAPTERS) |
| |
| adapters = struct( |
| get = get, |
| get_all_aspect_attrs = get_all_aspect_attrs, |
| ) |