1# Copyright 2023 The Bazel Authors. All rights reserved. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14"""Provides access to all rule adapters with a simple interface.""" 15 16load(":adapters_base.bzl", _ADAPTERS = "ADAPTERS", _get = "get", _get_all_aspect_attrs = "get_all_aspect_attrs") 17 18ADAPTERS = _ADAPTERS 19 20def get(kind): 21 return _get(kind, adapters = ADAPTERS) 22 23def get_all_aspect_attrs(): 24 """The union of all the aspect attrs required by all rule adapters. 25 26 The list is used by the aspect to determine the set of attributes to apply on. 27 28 Returns: 29 A sorted list of strings, containing the union of all attribute names 30 required by the all the rule adapters. 31 """ 32 return _get_all_aspect_attrs(adapters = ADAPTERS) 33 34adapters = struct( 35 get = get, 36 get_all_aspect_attrs = get_all_aspect_attrs, 37) 38