1# Copyright 2018 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
15"""Attributes."""
16
17load(
18    "@rules_android//rules:attrs.bzl",
19    _attrs = "attrs",
20)
21
22ATTRS = _attrs.add(
23    dict(
24        deps = attr.label_list(
25            providers = [
26                [CcInfo],
27                [JavaInfo],
28            ],
29        ),
30        enable_data_binding = attr.bool(default = False),
31        exported_plugins = attr.label_list(
32            allow_rules = [
33                "java_plugin",
34            ],
35            cfg = "host",
36        ),
37        exports = attr.label_list(
38            providers = [
39                [CcInfo],
40                [JavaInfo],
41            ],
42        ),
43        exports_manifest =
44            _attrs.tristate.create(default = _attrs.tristate.no),
45        idl_import_root = attr.string(),
46        idl_parcelables = attr.label_list(allow_files = [".aidl"]),
47        idl_preprocessed = attr.label_list(allow_files = [".aidl"]),
48        idl_srcs = attr.label_list(allow_files = [".aidl"]),
49        neverlink = attr.bool(default = False),
50        proguard_specs = attr.label_list(allow_files = True),
51        srcs = attr.label_list(
52            allow_files = [".java", ".srcjar"],
53        ),
54        # TODO(b/127517031): Remove these entries once fixed.
55        _defined_assets = attr.bool(default = False),
56        _defined_assets_dir = attr.bool(default = False),
57        _defined_idl_import_root = attr.bool(default = False),
58        _defined_idl_parcelables = attr.bool(default = False),
59        _defined_idl_srcs = attr.bool(default = False),
60        _defined_local_resources = attr.bool(default = False),
61        _java_toolchain = attr.label(
62            cfg = "host",
63            default = Label("//tools/jdk:toolchain_android_only"),
64        ),
65        # TODO(str): Remove when fully migrated to android_instrumentation_test
66        _android_test_migration = attr.bool(default = False),
67        _flags = attr.label(
68            default = "@rules_android//rules/flags",
69        ),
70    ),
71    _attrs.COMPILATION,
72    _attrs.DATA_CONTEXT,
73)
74