Skip to content

Commit

Permalink
Start license attestations for third_party code with LICENSE but no p…
Browse files Browse the repository at this point in the history
…rivate BUILD

This is the first of many PRs to add license attestations.  It is the lowest of the low hanging fruit.

The non-third_party piece of #15592.  The other half needs a different approval process. Fortunately, they cleanly separate.

PiperOrigin-RevId: 461271339
Change-Id: Ib2ebba42b858756f3f6e6a0ba484c54be7a4b5d5
  • Loading branch information
aiuto authored and copybara-github committed Jul 16, 2022
1 parent 7ff3aca commit 86b800e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
11 changes: 11 additions & 0 deletions tools/compliance/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,14 @@ check_license(
"//src:bazel-bin_nojdk",
],
)

check_license(
name = "check_srcs",
check_conditions = False,
copyright_notices = "srcs_copyrights.txt",
license_texts = "srcs_licenses.txt",
report = "srcs_report",
deps = [
"//:bazel-srcs",
],
)
12 changes: 11 additions & 1 deletion tools/distributions/distribution_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,17 @@ def distrib_java_import(name, visibility = None, enable_distributions = [], **kw
if "debian" in enable_distributions:
conditions["//src/conditions:debian_build"] = "@debian_java_deps//:" + name

native.alias(name = name, actual = select(conditions), visibility = visibility)
if "applicable_licenses" in kwargs:
licenses = kwargs["applicable_licenses"]
else:
licenses = None

native.alias(
name = name,
actual = select(conditions),
visibility = visibility,
applicable_licenses = licenses,
)

def distrib_cc_library(name, visibility = None, enable_distributions = [], **kwargs):
"""A macro for cc_library rule to support distributions build (eg. Debian)"""
Expand Down

0 comments on commit 86b800e

Please sign in to comment.