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 # Dynamic resources field 73 resource_apks = "A depset of resource only apk files", 74 75 # Resource related fields 76 resource_files = "A depset of files, resource files of the target", 77 compiled_resources = "A file, the compiled resources", 78 r_txt = "A file, the R.txt file", 79 manifest = "A file, the AndroidManifest.xml", 80 # TODO(ostonge): Add the manifest if it's exported, otherwise leave empty 81 exports_manifest = "Boolean, whether the manifest is exported", 82 ), 83) 84 85StarlarkAndroidResourcesInfo = provider( 86 doc = "Provides information about direct and transitive resources", 87 fields = dict( 88 direct_resources_nodes = "Depset of ResourcesNodeInfo providers, can contain multiple providers due to exports", 89 transitive_resources_nodes = "Depset of transitive ResourcesNodeInfo providers, not including directs", 90 transitive_assets = "Depset of transitive assets files", 91 transitive_assets_symbols = "Depset of transitive merged assets", 92 transitive_compiled_assets = "Depset of transitive compiled assets", 93 direct_compiled_resources = "Depset of direct compiled_resources, can contain multiple files due to exports", 94 transitive_compiled_resources = "Depset of transitive compiled resources", 95 transitive_manifests = "Depset of transitive manifests", 96 transitive_r_txts = "Depset of transitive R.txt files", 97 transitive_resource_files = "Depset of transitive resource files", 98 packages_to_r_txts = "Map of packages to depset of r_txt files", 99 transitive_resource_apks = "Depset of transitive resource only apk files", 100 ), 101) 102 103AndroidLintRulesInfo = provider( 104 doc = "Provides extra lint rules to use with AndroidLint.", 105 fields = dict( 106 lint_jars = "A depset of lint rule jars found in AARs and exported by a target.", 107 ), 108) 109 110AndroidFeatureModuleInfo = provider( 111 doc = "Contains data required to build an Android feature split.", 112 fields = dict( 113 binary = "String, target of the underlying split android_binary target", 114 feature_name = "String, the name of the feature module. If unspecified, the target name will be used.", 115 fused = "Boolean, whether the split is \"fused\" for the system image and for pre-L devices.", 116 library = "String, target of the underlying split android_library target", 117 manifest = "Optional AndroidManifest.xml file to use for this feature.", 118 min_sdk_version = "String, the min SDK version for this feature.", 119 title_id = "String, resource identifier for the split title.", 120 title_lib = "String, target of the split title android_library.", 121 ), 122) 123 124 125Dex2OatApkInfo = provider( 126 doc = "Contains data about artifacts generated through host dex2oat.", 127 fields = dict( 128 signed_apk = "Signed APK", 129 oat_file = "Oat file generated through dex2oat.", 130 vdex_file = "Vdex file generated through dex2oat.", 131 art_file = "ART file generated through dex2oat.", 132 ), 133) 134 135InstrumentedAppInfo = provider( 136 doc = "Contains data about an android_binary's instrumented android_binary.", 137 fields = dict( 138 android_ide_info = "AndroidIdeInfo provider from the instrumented android_binary.", 139 ), 140) 141 142FailureInfo = provider( 143 fields = dict( 144 error = "Error message", 145 ), 146) 147 148AndroidBundleInfo = provider( 149 doc = "Provides .aab outputs from a rule.", 150 fields = dict( 151 unsigned_aab = "File, the unsigned .aab", 152 ), 153) 154 155StarlarkAndroidDexInfo = provider( 156 doc = "Internal provider used to collect transitive dex info.", 157 fields = dict( 158 dex_archives_dict = ( 159 "A dictionary of all the transitive dex archives for all dexopts." 160 ), 161 ), 162) 163