• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2022 The Bazel Authors. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#    http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15"""license_kind()s for generic license identifiers."""
16
17# This is a set of license_kind declarations based on the legacy Bazel license
18# identifiers.
19#
20# Projects using one of these licenses may reference the license_kind targets
21# here.  For example, their BUILD file might contain:
22#
23#   package(default_applicable_licenses = [":license"])
24#
25#   license(
26#       name = "license",
27#       license_kinds = ["@rules_license//licenses/generic:notice"],
28#       license_text = "LICENSE",
29#   )
30#
31
32# These licenses represent the LicenseType enum originally baked into Bazel. See
33# https://github.com/bazelbuild/bazel/blob/fcfca6157b6de903ab942cef2fc460bf8c8da6ed/src/main/java/com/google/devtools/build/lib/packages/License.java#L59
34#
35# Packages may create license rules that use these license_kinds when the
36# package has provided a LICENSE file, but the text in it  does not match any
37# of the well known licenses in @rules_license//licenses/spdx:*
38load("@rules_license//rules:license_kind.bzl", "license_kind")
39
40package(
41    default_applicable_licenses = ["//:license"],
42    default_visibility = ["//visibility:public"],
43)
44
45licenses(["notice"])
46
47filegroup(
48    name = "standard_package",
49    srcs = ["BUILD"],
50)
51
52# "none" should be used for packages which are distributed with no license of
53# any kind. You can use this no-op license as a positive indication that the
54# code's license terms were reviewed, so that linters will not flag it later as
55# unreviewed.
56license_kind(
57    name = "none",
58)
59
60# See: https://opensource.google/docs/thirdparty/licenses/#unencumbered
61license_kind(
62    name = "unencumbered",
63)
64
65# See: https://opensource.google/docs/thirdparty/licenses/#notice
66license_kind(
67    name = "notice",
68    conditions = [
69        "notice",
70    ],
71)
72
73# See: https://opensource.google/docs/thirdparty/licenses/#permissive
74license_kind(
75    name = "permissive",
76    conditions = [
77        "permissive",
78    ],
79)
80
81# See: https://opensource.google/docs/thirdparty/licenses/#reciprocal
82license_kind(
83    name = "reciprocal",
84    conditions = [
85        "reciprocal",
86    ],
87)
88
89# See: https://opensource.google/docs/thirdparty/licenses/#restricted
90license_kind(
91    name = "restricted",
92    conditions = [
93        "restricted",
94    ],
95)
96
97# See: https://opensource.google/docs/thirdparty/licenses/#ByExceptionOnly
98license_kind(
99    name = "by_exception_only",
100    conditions = [
101        "by_exception_only",
102    ],
103)
104