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"""Bazel providers for Android rules."""
16
17
18
19AndroidAppsInfo = provider(
20    doc = "Provides information about app to install.",
21    fields = dict(
22        apps = "List of app provider artifacts.",
23    ),
24)
25
26
27
28
29
30
31
32
33AndroidJavaInfo = provider(
34    doc = "Provides outputs for the Android Java Compilation",
35    fields = dict(
36        aidl = "AndroidIdlInfo",
37        aide = "AndroidIdeInfo",
38        java = "JavaInfo",
39    ),
40)
41
42AndroidFilteredJdepsInfo = provider(
43    doc = "Provides a filtered jdeps proto.",
44    fields = dict(
45        jdeps = "Filtered jdeps",
46    ),
47)
48
49
50StarlarkApkInfo = provider(
51    doc = "Provides APK outputs of a rule.",
52    fields = dict(
53        keystore = "Keystore used to sign the APK. Deprecated, prefer signing_keys.",
54        signing_keys = "List of keys used to sign the APK",
55        signing_lineage = "Optional sigining lineage file",
56        signed_apk = "Signed APK",
57        unsigned_apk = "Unsigned APK",
58    ),
59)
60
61ResourcesNodeInfo = provider(
62    doc = "Provides information for building ResourceProcessorBusyBox flags",
63    fields = dict(
64        label = "A label, the target's label",
65
66        # Assets related fields
67        assets = "A depset of files, assets files of the target",
68        assets_dir = "A string, the name of the assets directory",
69        assets_symbols = "A file, the merged assets",
70        compiled_assets = "A file, the compiled assets",
71
72        # Resource related fields
73        resource_files = "A depset of files, resource files of the target",
74        compiled_resources = "A file, the compiled resources",
75        r_txt = "A file, the R.txt file",
76        manifest = "A file, the AndroidManifest.xml",
77        # TODO(ostonge): Add the manifest if it's exported, otherwise leave empty
78        exports_manifest = "Boolean, whether the manifest is exported",
79    ),
80)
81
82StarlarkAndroidResourcesInfo = provider(
83    doc = "Provides information about direct and transitive resources",
84    fields = dict(
85        direct_resources_nodes = "Depset of ResourcesNodeInfo providers, can contain multiple providers due to exports",
86        transitive_resources_nodes = "Depset of transitive ResourcesNodeInfo providers, not including directs",
87        transitive_assets = "Depset of transitive assets files",
88        transitive_assets_symbols = "Depset of transitive merged assets",
89        transitive_compiled_assets = "Depset of transitive compiled assets",
90        direct_compiled_resources = "Depset of direct compiled_resources, can contain multiple files due to exports",
91        transitive_compiled_resources = "Depset of transitive compiled resources",
92        transitive_manifests = "Depset of transitive manifests",
93        transitive_r_txts = "Depset of transitive R.txt files",
94        transitive_resource_files = "Depset of transitive resource files",
95    ),
96)
97
98AndroidLintRulesInfo = provider(
99    doc = "Provides extra lint rules to use with AndroidLint.",
100    fields = dict(
101        lint_jar = "A file, a lint jar found in an aar.",
102    ),
103)
104
105
106
107FailureInfo = provider(
108    fields = dict(
109        error = "Error message",
110    ),
111)
112
113AndroidBundleInfo = provider(
114    doc = "Provides .aab outputs from a rule.",
115    fields = dict(
116        unsigned_aab = "File, the unsigned .aab",
117    ),
118)
119