1# Copyright 2022 Google LLC 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# https://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# Example license kind definitions. 15 16# We expect that all license_kind rules used by an organization exist in a 17# central place in their source repository. 18# 19# - This allows centralized audit and, with suport from the SCM, an assurance 20# that individual developers are not adding new license kinds to the code 21# base without authorization. 22# - When third party packages are used, they might come with license rules 23# pointing to well known license_kinds from @rules_license/licenses. 24# At import time, users can mechanically transform those target paths from 25# @rules_license to their own license_kind repository. 26# - The conditions for each license_kind may be customized for the organzation's 27# needs, and not match the conditions used by the canonical versions from 28# @rules_license. 29# - In rare cases, a third_party project will define their own license_kinds. 30# There is no reasonable automatic handling of that. Organizations will have 31# to hand inspect the license text to see if it matches the conditions, and 32# then will have to hand import it to their private license_kind repository. 33 34load("@rules_license//rules:license_kind.bzl", "license_kind") 35 36package(default_visibility = ["//examples:__subpackages__"]) 37 38# license_kind rules generally appear in a central location per workspace. They 39# are intermingled with normal target build rules 40license_kind( 41 name = "generic_notice", 42 conditions = [ 43 "notice", 44 ], 45) 46 47license_kind( 48 name = "generic_restricted", 49 conditions = [ 50 "restricted", 51 ], 52) 53 54license_kind( 55 name = "unencumbered", 56 conditions = [], # none 57) 58 59license_kind( 60 name = "lgpl_like", 61 conditions = [ 62 "restricted_if_statically_linked", 63 ], 64) 65 66license_kind( 67 name = "acme_corp_paid", 68 conditions = [ 69 "allowlist:acme_corp_paid", 70 ], 71) 72