Apply licenses with rules_license

This commit is contained in:
2025-03-02 01:25:07 +01:00
parent 62cc4b468b
commit 8604c98df5
20 changed files with 103 additions and 7 deletions

View File

@ -2,11 +2,15 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # 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( license(
name = "refresh_clangd", name = "license",
targets = "//...", license_kinds = [
"@rules_license//licenses/spdx:BSD-3-Clause",
],
license_text = "LICENSE.txt",
package_name = "ASL",
) )
platform( platform(

View File

@ -6,6 +6,7 @@ module(name = "asl")
bazel_dep(name = "platforms", version = "0.0.10") bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_cc", version = "0.0.17") 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) bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override( git_override(

View File

@ -2,6 +2,10 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
package(
default_applicable_licenses = ["//:license"],
)
cc_library( cc_library(
name = "base", name = "base",
hdrs = [ hdrs = [

View File

@ -2,6 +2,10 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
package(
default_applicable_licenses = ["//:license"],
)
cc_library( cc_library(
name = "buffer", name = "buffer",
hdrs = [ hdrs = [

View File

@ -2,6 +2,10 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
package(
default_applicable_licenses = ["//:license"],
)
cc_library( cc_library(
name = "formatting", name = "formatting",
hdrs = [ hdrs = [

View File

@ -2,6 +2,10 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
package(
default_applicable_licenses = ["//:license"],
)
cc_library( cc_library(
name = "hashing", name = "hashing",
hdrs = [ hdrs = [
@ -14,6 +18,9 @@ cc_library(
"//asl/base", "//asl/base",
"//asl/types:span", "//asl/types:span",
], ],
applicable_licenses = [
"//vendor/cityhash:license",
],
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )

View File

@ -2,6 +2,10 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
package(
default_applicable_licenses = ["//:license"],
)
cc_library( cc_library(
name = "writer", name = "writer",
hdrs = [ hdrs = [

View File

@ -2,6 +2,10 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
package(
default_applicable_licenses = ["//:license"],
)
cc_library( cc_library(
name = "logging", name = "logging",
srcs = [ srcs = [

View File

@ -27,6 +27,6 @@ ASL_TEST(custom_writer)
ASL_LOG_INFO("Hello"); ASL_LOG_INFO("Hello");
auto sv = string_writer.as_string_view(); 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");
} }

View File

@ -2,6 +2,10 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
package(
default_applicable_licenses = ["//:license"],
)
cc_library( cc_library(
name = "memory", name = "memory",
hdrs = [ hdrs = [

View File

@ -2,6 +2,10 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
package(
default_applicable_licenses = ["//:license"],
)
cc_library( cc_library(
name = "string_view", name = "string_view",
hdrs = [ hdrs = [

View File

@ -2,6 +2,10 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
package(
default_applicable_licenses = ["//:license"],
)
cc_library( cc_library(
name = "atomic", name = "atomic",
hdrs = [ hdrs = [

View File

@ -2,6 +2,10 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
package(
default_applicable_licenses = ["//:license"],
)
cc_library( cc_library(
name = "testing", name = "testing",
hdrs = [ hdrs = [

View File

@ -2,6 +2,10 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
package(
default_applicable_licenses = ["//:license"],
)
cc_library( cc_library(
name = "utils", name = "utils",
hdrs = [ hdrs = [

View File

@ -2,6 +2,10 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
package(
default_applicable_licenses = ["//:license"],
)
cc_library( cc_library(
name = "box", name = "box",
hdrs = [ hdrs = [

View File

@ -1 +1 @@
bazel run //:refresh_clangd --config=windows -- --config=windows bazel run //tools:refresh_clangd --config=windows -- --config=windows

View File

@ -1 +1 @@
bazel run //:refresh_clangd --config=linux -- --config=linux bazel run //tools:refresh_clangd --config=linux -- --config=linux

View File

@ -3,6 +3,11 @@
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
load("@rules_python//python:py_binary.bzl", "py_binary") 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( py_binary(
name = "fix_line_endings", name = "fix_line_endings",
@ -11,3 +16,8 @@ py_binary(
], ],
visibility = ["//:__subpackages__"], visibility = ["//:__subpackages__"],
) )
refresh_compile_commands(
name = "refresh_clangd",
targets = "//...",
)

15
vendor/cityhash/BUILD.bazel vendored Normal file
View File

@ -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",
)

View File

@ -2,9 +2,24 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # 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( cc_library(
name = "dragonbox", name = "dragonbox",
hdrs = ["dragonbox.h"], hdrs = ["dragonbox.h"],
includes = ["."], includes = ["."],
visibility = ["//:__subpackages__"], visibility = ["//:__subpackages__"],
applicable_licenses = [
":license",
],
) )