use rules_license for defining the license of this repository

- this helps with generating better SBOMs than the old built-in
  `licenses` attribute
This commit is contained in:
Nenad Mikša 2025-08-31 10:57:21 +02:00
parent eb2d85edd0
commit 3b7b31fa4b
2 changed files with 17 additions and 1 deletions

View File

@ -30,12 +30,23 @@
#
# Bazel Build for Google C++ Testing Framework(Google Test)
package(default_visibility = ["//visibility:public"])
load("@rules_license//rules:license.bzl", "license")
package(
default_applicable_licenses = [":license"],
default_visibility = ["//visibility:public"],
)
licenses(["notice"])
exports_files(["LICENSE"])
license(
name = "license",
license_kinds = ["@rules_license//licenses/spdx:BSD-3-Clause"],
license_text = "LICENSE",
)
config_setting(
name = "qnx",
constraint_values = ["@platforms//os:qnx"],

View File

@ -58,6 +58,11 @@ bazel_dep(
dev_dependency = True,
)
bazel_dep(
name = "rules_license",
version = "1.0.0",
)
# https://rules-python.readthedocs.io/en/stable/toolchains.html#library-modules-with-dev-only-python-usage
python = use_extension(
"@rules_python//python/extensions:python.bzl",