1# Copyright 2021 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 for android_application.""" 16 17load( 18 "//rules:attrs.bzl", 19 _attrs = "attrs", 20) 21 22ANDROID_APPLICATION_ATTRS = _attrs.add( 23 dict( 24 application_id = attr.string(), 25 base_module = attr.label(allow_files = False), 26 bundle_config_file = attr.label( 27 allow_single_file = [".pb.json"], 28 doc = ("Path to config.pb.json file, see " + 29 "https://github.com/google/bundletool/blob/master/src/main/proto/config.proto " + 30 "for definition.\n\nNote: this attribute is subject to changes which may " + 31 "require teams to migrate their configurations to a build target."), 32 ), 33 app_integrity_config = attr.label( 34 allow_single_file = [".binarypb"], 35 doc = "Configuration of the integrity protection options. " + 36 "Provide a path to a binary .binarypb instance of " + 37 "https://github.com/google/bundletool/blob/master/src/main/proto/app_integrity_config.proto", 38 ), 39 rotation_config = attr.label( 40 allow_single_file = [".textproto"], 41 default = None, 42 ), 43 custom_package = attr.string(), 44 feature_modules = attr.label_list(allow_files = False), 45 _bundle_deploy = attr.label( 46 allow_single_file = True, 47 default = ":bundle_deploy.sh_template", 48 ), 49 _bundle_keystore_properties = attr.label( 50 allow_single_file = True, 51 default = "//rules:bundle_keystore_properties.tmpl", 52 ), 53 _feature_manifest_script = attr.label( 54 allow_single_file = True, 55 cfg = "exec", 56 executable = True, 57 default = ":gen_android_feature_manifest.sh", 58 ), 59 _java_toolchain = attr.label( 60 default = Label("//tools/jdk:toolchain_android_only"), 61 ), 62 _merge_manifests = attr.label( 63 default = ":merge_feature_manifests.par", 64 allow_single_file = True, 65 cfg = "exec", 66 executable = True, 67 ), 68 _priority_feature_manifest_script = attr.label( 69 allow_single_file = True, 70 cfg = "exec", 71 executable = True, 72 default = ":gen_priority_android_feature_manifest.sh", 73 ), 74 _host_javabase = attr.label( 75 cfg = "exec", 76 default = Label("//tools/jdk:current_java_runtime"), 77 ), 78 ), 79 _attrs.ANDROID_SDK, 80) 81 82ANDROID_FEATURE_MODULE_ATTRS = dict( 83 binary = attr.label(), 84 feature_name = attr.string(), 85 library = attr.label( 86 allow_rules = ["android_library"], 87 cfg = android_common.multi_cpu_configuration, 88 mandatory = True, 89 doc = "android_library target to include as a feature split.", 90 ), 91 manifest = attr.label(allow_single_file = True), 92 title_id = attr.string(), 93 title_lib = attr.string(), 94 _feature_module_validation_script = attr.label( 95 allow_single_file = True, 96 cfg = "exec", 97 executable = True, 98 default = ":feature_module_validation.sh", 99 ), 100) 101