Add license rules (#150)
Needed for bureaucratic compliance reasons.
diff --git a/BUILD b/BUILD
index 00af466..ef68dea 100644
--- a/BUILD
+++ b/BUILD
@@ -1,3 +1,13 @@
+load("@rules_license//rules:license.bzl", "license")
+
+package(default_applicable_licenses = [":license"])
+
+license(
+ name = "license",
+ package_name = "bazelbuild/stardoc",
+ license_kinds = ["@rules_license//licenses/spdx:Apache-2.0"],
+)
+
licenses(["notice"])
exports_files([
diff --git a/distro/BUILD b/distro/BUILD
index a947465..84a670e 100644
--- a/distro/BUILD
+++ b/distro/BUILD
@@ -2,6 +2,7 @@
load("@rules_pkg//:pkg.bzl", "pkg_tar")
package(
+ default_applicable_licenses = ["//:license"],
default_visibility = ["//visibility:private"],
)
diff --git a/setup.bzl b/setup.bzl
index dd39565..807cf6f 100644
--- a/setup.bzl
+++ b/setup.bzl
@@ -40,3 +40,12 @@
],
sha256 = "34b41ec683e67253043ab1a3d1e8b7c61e4e8edefbcad485381328c934d072fe",
)
+ _include_if_not_defined(
+ http_archive,
+ name = "rules_license",
+ urls = [
+ "https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz",
+ "https://github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz",
+ ],
+ sha256 = "6157e1e68378532d0241ecd15d3c45f6e5cfd98fc10846045509fb2a7cc9e381",
+ )
diff --git a/stardoc/BUILD b/stardoc/BUILD
index d11e157..1992806 100644
--- a/stardoc/BUILD
+++ b/stardoc/BUILD
@@ -4,7 +4,10 @@
licenses(["notice"])
-package(default_visibility = ["//visibility:public"])
+package(
+ default_applicable_licenses = ["//:license"],
+ default_visibility = ["//visibility:public"],
+)
exports_files(glob(["templates/**"]))
diff --git a/stardoc/proto/BUILD b/stardoc/proto/BUILD
index ff06c3b..6e3782c 100644
--- a/stardoc/proto/BUILD
+++ b/stardoc/proto/BUILD
@@ -1,6 +1,9 @@
licenses(["notice"])
-package(default_visibility = ["//visibility:public"])
+package(
+ default_applicable_licenses = ["//:license"],
+ default_visibility = ["//visibility:public"],
+)
exports_files(["stardoc_output.proto"])
diff --git a/test/BUILD b/test/BUILD
index c97b5a4..d8d9a31 100644
--- a/test/BUILD
+++ b/test/BUILD
@@ -1,5 +1,7 @@
load(":stardoc_test.bzl", "stardoc_test")
+package(default_applicable_licenses = ["//:license"])
+
licenses(["notice"]) # Apache 2.0
sh_test(