Lines Matching full:attrs
17 load(":attrs.bzl", _ATTRS = "ATTRS")
20 "@rules_android//rules:attrs.bzl",
21 _attrs = "attrs",
45 attrs = _ATTRS,
52 attrs: A dict. The attributes for the rule.
59 attrs = attrs,
83 def _is_defined(name, attrs):
84 return name in attrs and attrs[name] != None
86 def attrs_metadata(attrs):
87 """Adds additional metadata for specific android_library attrs.
89 Bazel native rules have additional capabilities when inspecting attrs that
97 attrs: The attributes passed to the android_library rule.
104 attrs["$defined_local_resources"] = bool(
105 attrs.get("assets") or
106 attrs.get("assets_dir") or
107 attrs.get("assets_dir") == "" or
108 attrs.get("export_manifest") or
109 attrs.get("manifest") or
110 attrs.get("resource_files"),
114 if _is_defined("exports_manifest", attrs):
115 attrs["exports_manifest"] = _attrs.tristate.normalize(
116 attrs.get("exports_manifest"),
120 attrs["$defined_assets"] = _is_defined("assets", attrs)
121 attrs["$defined_assets_dir"] = _is_defined("assets_dir", attrs)
122 attrs["$defined_idl_import_root"] = _is_defined("idl_import_root", attrs)
123 attrs["$defined_idl_parcelables"] = _is_defined("idl_parcelables", attrs)
124 attrs["$defined_idl_srcs"] = _is_defined("idl_srcs", attrs)
125 return attrs
127 def android_library_macro(**attrs):
133 **attrs: Rule attributes
135 android_library(**attrs_metadata(attrs))