Skip to content

Commit d4c9dcc

Browse files
authored
Properly handle default_package_metadata attribute. (#1217)
* Update buildozer to account for the renaming the global attribute `applicable_licenses` to `package_metadata`. The previous code assumed that `applicable_licenses` existed, and used it to set the type for `default_applicable_licenses`. Now we simply assume that `default_applicable_licenses` and `default_package_metadata` are label lists. * Might as well do the attribute too
1 parent 433ea85 commit d4c9dcc

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

generatetables/generate_tables.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,19 @@ func generateTable(rules []*buildpb.RuleDefinition) map[string]buildpb.Attribute
7474
types["default_copts"] = types["copts"]
7575
types["default_deprecation"] = types["deprecation"]
7676
types["default_testonly"] = types["testonly"]
77-
types["default_applicable_licenses"] = types["applicable_licenses"]
77+
types["default_applicable_licenses"] = buildpb.Attribute_LABEL_LIST
78+
types["default_package_metadata"] = buildpb.Attribute_LABEL_LIST
7879
types["features"] = buildpb.Attribute_STRING_LIST
7980

8081
types["extra_srcs"] = types["srcs"]
8182
types["pytype_deps"] = types["deps"]
8283

84+
// Make sure we always have this.
85+
_, ok := types["package_metadata"]
86+
if ! ok {
87+
types["package_metadata"] = buildpb.Attribute_LABEL_LIST
88+
}
89+
8390
return types
8491
}
8592

lang/tables.gen.go

+2
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ var TypeOf = map[string]buildpb.Attribute_Discriminator{
187187
"default_hdrs_check": buildpb.Attribute_STRING,
188188
"default_ios_sdk_version": buildpb.Attribute_STRING,
189189
"default_macos_sdk_version": buildpb.Attribute_STRING,
190+
"default_package_metadata": buildpb.Attribute_LABEL_LIST,
190191
"default_properties": buildpb.Attribute_LABEL,
191192
"default_testonly": buildpb.Attribute_BOOLEAN,
192193
"default_tvos_sdk_version": buildpb.Attribute_STRING,
@@ -325,6 +326,7 @@ var TypeOf = map[string]buildpb.Attribute_Discriminator{
325326
"output_to_bindir": buildpb.Attribute_BOOLEAN,
326327
"outs": buildpb.Attribute_STRING_LIST,
327328
"package_configuration": buildpb.Attribute_LABEL_LIST,
329+
"package_metadata": buildpb.Attribute_LABEL_LIST,
328330
"packages": buildpb.Attribute_LABEL_LIST,
329331
"parents": buildpb.Attribute_LABEL_LIST,
330332
"path": buildpb.Attribute_STRING,

0 commit comments

Comments
 (0)