aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Aiuto <aiuto@google.com>2022-12-07 16:52:06 -0500
committerTony Aiuto <aiuto@google.com>2022-12-07 16:52:06 -0500
commit0176b8dc7b2e7586fee71d6ab5e5729cca7067be (patch)
treea3c5e22630434bd462c3e3fc7d7fce6f34bed1b7
parent3fbc687756043fb58a407c2ea8c944bc2fe1d922 (diff)
downloadbazelbuild-platforms-0176b8dc7b2e7586fee71d6ab5e5729cca7067be.tar.gz
Add rules_license style declaration.
- Done for both WORKSPACE and bzlmod styles - The dependency is different because rules_license is not up to date in the BCR. I'll correct that at the next rules_license release.
-rw-r--r--BUILD15
-rw-r--r--MODULE.bazel4
-rw-r--r--WORKSPACE8
-rw-r--r--WORKSPACE.bzlmod4
4 files changed, 28 insertions, 3 deletions
diff --git a/BUILD b/BUILD
index c38493e..7aea923 100644
--- a/BUILD
+++ b/BUILD
@@ -1,6 +1,17 @@
-package(default_visibility = ["//visibility:public"])
+load("@rules_license//rules:license.bzl", "license")
-licenses(["notice"])
+package(
+ default_applicable_licenses = [":license"],
+ default_visibility = ["//visibility:public"],
+)
+
+license(
+ name = "license",
+ license_kinds = [
+ "@rules_license//licenses/spdx:Apache-2.0"
+ ],
+ license_text = "LICENSE",
+)
exports_files(["LICENSE"])
diff --git a/MODULE.bazel b/MODULE.bazel
index e4f4cfd..34badd4 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -1,5 +1,7 @@
module(
name = "platforms",
- version = "0.0.6", # keep in sync with version.bzl
+ version = "0.0.8", # keep in sync with version.bzl
compatibility_level = 1,
)
+
+bazel_dep(name = "rules_license", version = "0.0.3")
diff --git a/WORKSPACE b/WORKSPACE
index f1874ea..28137ef 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -1 +1,9 @@
workspace(name = "platforms")
+
+http_archive(
+ name = "rules_license",
+ urls = [
+ "https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.3/rules_license-0.0.3.tar.gz",
+ ],
+ # sha256 = "4865059254da674e3d18ab242e21c17f7e3e8c6b1f1421fffa4c5070f82e98b5",
+)
diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod
new file mode 100644
index 0000000..59c0af4
--- /dev/null
+++ b/WORKSPACE.bzlmod
@@ -0,0 +1,4 @@
+# Include dependencies which are only needed for development here.
+#
+# Even if this is empty, you need it with bzlmod enable to prevent
+# bzlmod from bringing in WORKSPACE too.