Skip to content

Commit

Permalink
Migration of applicable_licenses to package_metadata.
Browse files Browse the repository at this point in the history
Data gathering aspects will look for either version of the name.

After a Bazel release or two we can delete the lookup on `applicable_license`

RELNOTES: None
PiperOrigin-RevId: 579835543
Change-Id: I9b962dd41d4c318081ac2a891d2ec53892d48e3e
  • Loading branch information
aiuto authored and copybara-github committed Nov 6, 2023
1 parent 358bec8 commit e1df5cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/compliance/gather_packages.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ def gather_package_common(target, ctx, provider_factory, metadata_providers, fil
licenses.append(dep[LicenseInfo])
if PackageInfo in dep:
package_info.depend(dep[LicenseInfo])
elif hasattr(ctx.rule.attr, "package_metadata"):
for dep in ctx.rule.attr.package_metadata:
if LicenseInfo in dep:
licenses.append(dep[LicenseInfo])
if PackageInfo in dep:
package_info.depend(dep[LicenseInfo])

# Record all the external repos anyway.
target_name = str(target.label)
Expand Down

0 comments on commit e1df5cd

Please sign in to comment.