summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2025-03-02 01:25:07 +0100
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2025-03-02 01:39:34 +0100
commit8604c98df53486208cdc15424aae9d9b2fef2d8e (patch)
treed7a8564846316028294a906d654db38b5313413d
parent62cc4b468b4e8653d8ef523fc4081572c6c1c7d8 (diff)
Apply licenses with rules_license
-rw-r--r--BUILD.bazel12
-rw-r--r--MODULE.bazel1
-rw-r--r--asl/base/BUILD.bazel4
-rw-r--r--asl/containers/BUILD.bazel4
-rw-r--r--asl/formatting/BUILD.bazel4
-rw-r--r--asl/hashing/BUILD.bazel7
-rw-r--r--asl/io/BUILD.bazel4
-rw-r--r--asl/logging/BUILD.bazel4
-rw-r--r--asl/logging/logging_tests.cpp2
-rw-r--r--asl/memory/BUILD.bazel4
-rw-r--r--asl/strings/BUILD.bazel4
-rw-r--r--asl/synchronization/BUILD.bazel4
-rw-r--r--asl/testing/BUILD.bazel4
-rw-r--r--asl/tests/BUILD.bazel4
-rw-r--r--asl/types/BUILD.bazel4
-rw-r--r--refresh_clangd.bat2
-rwxr-xr-xrefresh_clangd.sh2
-rw-r--r--tools/BUILD.bazel10
-rw-r--r--vendor/cityhash/BUILD.bazel15
-rw-r--r--vendor/dragonbox/BUILD.bazel15
20 files changed, 103 insertions, 7 deletions
diff --git a/BUILD.bazel b/BUILD.bazel
index 7adc1f3..9014daa 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -2,11 +2,15 @@
#
# SPDX-License-Identifier: BSD-3-Clause
-load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")
+load("@rules_license//rules:license.bzl", "license")
-refresh_compile_commands(
- name = "refresh_clangd",
- targets = "//...",
+license(
+ name = "license",
+ license_kinds = [
+ "@rules_license//licenses/spdx:BSD-3-Clause",
+ ],
+ license_text = "LICENSE.txt",
+ package_name = "ASL",
)
platform(
diff --git a/MODULE.bazel b/MODULE.bazel
index 005fbbf..5d3777f 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -6,6 +6,7 @@ module(name = "asl")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_cc", version = "0.0.17")
+bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override(
diff --git a/asl/base/BUILD.bazel b/asl/base/BUILD.bazel
index cd05e00..32ea47f 100644
--- a/asl/base/BUILD.bazel
+++ b/asl/base/BUILD.bazel
@@ -2,6 +2,10 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+package(
+ default_applicable_licenses = ["//:license"],
+)
+
cc_library(
name = "base",
hdrs = [
diff --git a/asl/containers/BUILD.bazel b/asl/containers/BUILD.bazel
index feb5711..a8d6b4e 100644
--- a/asl/containers/BUILD.bazel
+++ b/asl/containers/BUILD.bazel
@@ -2,6 +2,10 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+package(
+ default_applicable_licenses = ["//:license"],
+)
+
cc_library(
name = "buffer",
hdrs = [
diff --git a/asl/formatting/BUILD.bazel b/asl/formatting/BUILD.bazel
index 836585e..06f0ec7 100644
--- a/asl/formatting/BUILD.bazel
+++ b/asl/formatting/BUILD.bazel
@@ -2,6 +2,10 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+package(
+ default_applicable_licenses = ["//:license"],
+)
+
cc_library(
name = "formatting",
hdrs = [
diff --git a/asl/hashing/BUILD.bazel b/asl/hashing/BUILD.bazel
index 18be389..ff23400 100644
--- a/asl/hashing/BUILD.bazel
+++ b/asl/hashing/BUILD.bazel
@@ -2,6 +2,10 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+package(
+ default_applicable_licenses = ["//:license"],
+)
+
cc_library(
name = "hashing",
hdrs = [
@@ -14,6 +18,9 @@ cc_library(
"//asl/base",
"//asl/types:span",
],
+ applicable_licenses = [
+ "//vendor/cityhash:license",
+ ],
visibility = ["//visibility:public"],
)
diff --git a/asl/io/BUILD.bazel b/asl/io/BUILD.bazel
index b25f2fe..fc971b9 100644
--- a/asl/io/BUILD.bazel
+++ b/asl/io/BUILD.bazel
@@ -2,6 +2,10 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+package(
+ default_applicable_licenses = ["//:license"],
+)
+
cc_library(
name = "writer",
hdrs = [
diff --git a/asl/logging/BUILD.bazel b/asl/logging/BUILD.bazel
index 1ddefff..f565916 100644
--- a/asl/logging/BUILD.bazel
+++ b/asl/logging/BUILD.bazel
@@ -2,6 +2,10 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+package(
+ default_applicable_licenses = ["//:license"],
+)
+
cc_library(
name = "logging",
srcs = [
diff --git a/asl/logging/logging_tests.cpp b/asl/logging/logging_tests.cpp
index b4c9fa6..ec47a8a 100644
--- a/asl/logging/logging_tests.cpp
+++ b/asl/logging/logging_tests.cpp
@@ -27,6 +27,6 @@ ASL_TEST(custom_writer)
ASL_LOG_INFO("Hello");
auto sv = string_writer.as_string_view();
- ASL_TEST_EXPECT(sv == "[ INFO ] asl/logging/logging_tests.cpp:23: Hello\n");
+ ASL_TEST_EXPECT(sv == "[ INFO ] asl/logging/logging_tests.cpp:27: Hello\n");
}
diff --git a/asl/memory/BUILD.bazel b/asl/memory/BUILD.bazel
index 1d90c3b..7305da0 100644
--- a/asl/memory/BUILD.bazel
+++ b/asl/memory/BUILD.bazel
@@ -2,6 +2,10 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+package(
+ default_applicable_licenses = ["//:license"],
+)
+
cc_library(
name = "memory",
hdrs = [
diff --git a/asl/strings/BUILD.bazel b/asl/strings/BUILD.bazel
index bb84495..79fc631 100644
--- a/asl/strings/BUILD.bazel
+++ b/asl/strings/BUILD.bazel
@@ -2,6 +2,10 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+package(
+ default_applicable_licenses = ["//:license"],
+)
+
cc_library(
name = "string_view",
hdrs = [
diff --git a/asl/synchronization/BUILD.bazel b/asl/synchronization/BUILD.bazel
index 5c11b28..ccc3860 100644
--- a/asl/synchronization/BUILD.bazel
+++ b/asl/synchronization/BUILD.bazel
@@ -2,6 +2,10 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+package(
+ default_applicable_licenses = ["//:license"],
+)
+
cc_library(
name = "atomic",
hdrs = [
diff --git a/asl/testing/BUILD.bazel b/asl/testing/BUILD.bazel
index 1e1c0f0..96c265d 100644
--- a/asl/testing/BUILD.bazel
+++ b/asl/testing/BUILD.bazel
@@ -2,6 +2,10 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+package(
+ default_applicable_licenses = ["//:license"],
+)
+
cc_library(
name = "testing",
hdrs = [
diff --git a/asl/tests/BUILD.bazel b/asl/tests/BUILD.bazel
index 6b8509c..016f037 100644
--- a/asl/tests/BUILD.bazel
+++ b/asl/tests/BUILD.bazel
@@ -2,6 +2,10 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+package(
+ default_applicable_licenses = ["//:license"],
+)
+
cc_library(
name = "utils",
hdrs = [
diff --git a/asl/types/BUILD.bazel b/asl/types/BUILD.bazel
index e5f8158..b60bb27 100644
--- a/asl/types/BUILD.bazel
+++ b/asl/types/BUILD.bazel
@@ -2,6 +2,10 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+package(
+ default_applicable_licenses = ["//:license"],
+)
+
cc_library(
name = "box",
hdrs = [
diff --git a/refresh_clangd.bat b/refresh_clangd.bat
index 26004ec..dcba47d 100644
--- a/refresh_clangd.bat
+++ b/refresh_clangd.bat
@@ -1 +1 @@
-bazel run //:refresh_clangd --config=windows -- --config=windows
+bazel run //tools:refresh_clangd --config=windows -- --config=windows
diff --git a/refresh_clangd.sh b/refresh_clangd.sh
index 309edd2..f1bae0d 100755
--- a/refresh_clangd.sh
+++ b/refresh_clangd.sh
@@ -1 +1 @@
-bazel run //:refresh_clangd --config=linux -- --config=linux
+bazel run //tools:refresh_clangd --config=linux -- --config=linux
diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel
index b517e1f..1b4d8fb 100644
--- a/tools/BUILD.bazel
+++ b/tools/BUILD.bazel
@@ -3,6 +3,11 @@
# SPDX-License-Identifier: BSD-3-Clause
load("@rules_python//python:py_binary.bzl", "py_binary")
+load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")
+
+package(
+ default_applicable_licenses = ["//:license"],
+)
py_binary(
name = "fix_line_endings",
@@ -11,3 +16,8 @@ py_binary(
],
visibility = ["//:__subpackages__"],
)
+
+refresh_compile_commands(
+ name = "refresh_clangd",
+ targets = "//...",
+)
diff --git a/vendor/cityhash/BUILD.bazel b/vendor/cityhash/BUILD.bazel
new file mode 100644
index 0000000..5e5349d
--- /dev/null
+++ b/vendor/cityhash/BUILD.bazel
@@ -0,0 +1,15 @@
+# Copyright 2025 Steven Le Rouzic
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+load("@rules_license//rules:license.bzl", "license")
+
+license(
+ name = "license",
+ license_kinds = [
+ "@rules_license//licenses/spdx:MIT",
+ ],
+ license_text = "LICENSE.txt",
+ package_name = "CityHash",
+ package_url = "https://github.com/google/cityhash",
+)
diff --git a/vendor/dragonbox/BUILD.bazel b/vendor/dragonbox/BUILD.bazel
index b3092a7..5028819 100644
--- a/vendor/dragonbox/BUILD.bazel
+++ b/vendor/dragonbox/BUILD.bazel
@@ -2,9 +2,24 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+load("@rules_license//rules:license.bzl", "license")
+
+license(
+ name = "license",
+ license_kinds = [
+ "@rules_license//licenses/spdx:Apache-2.0",
+ ],
+ license_text = "LICENSE.txt",
+ package_name = "Dragonbox",
+ package_url = "https://github.com/jk-jeon/dragonbox",
+)
+
cc_library(
name = "dragonbox",
hdrs = ["dragonbox.h"],
includes = ["."],
visibility = ["//:__subpackages__"],
+ applicable_licenses = [
+ ":license",
+ ],
)