xref: /aosp_15_r20/external/bazelbuild-rules_license/docs/latest.md (revision f578df4fd057ffe2023728444759535685631548)
1<!-- Generated with Stardoc: http://skydoc.bazel.build -->
2
3Rules for declaring the compliance licenses used by a package.
4
5
6
7<a id="license"></a>
8
9## license
10
11<pre>
12license(<a href="#license-name">name</a>, <a href="#license-copyright_notice">copyright_notice</a>, <a href="#license-license_kinds">license_kinds</a>, <a href="#license-license_text">license_text</a>, <a href="#license-namespace">namespace</a>, <a href="#license-package_name">package_name</a>, <a href="#license-package_url">package_url</a>,
13         <a href="#license-package_version">package_version</a>)
14</pre>
15
16
17
18**ATTRIBUTES**
19
20
21| Name  | Description | Type | Mandatory | Default |
22| :------------- | :------------- | :------------- | :------------- | :------------- |
23| <a id="license-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |  |
24| <a id="license-copyright_notice"></a>copyright_notice |  Copyright notice.   | String | optional | <code>""</code> |
25| <a id="license-license_kinds"></a>license_kinds |  License kind(s) of this license. If multiple license kinds are listed in the LICENSE file, and they all apply, then all should be listed here. If the user can choose a single one of many, then only list one here.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | <code>[]</code> |
26| <a id="license-license_text"></a>license_text |  The license file.   | <a href="https://bazel.build/concepts/labels">Label</a> | optional | <code>LICENSE</code> |
27| <a id="license-namespace"></a>namespace |  A human readable name used to organize licenses into categories. This is used in google3 to differentiate third party licenses used for compliance versus internal licenses used by SLAsan for internal teams' SLAs.   | String | optional | <code>""</code> |
28| <a id="license-package_name"></a>package_name |  A human readable name identifying this package. This may be used to produce an index of OSS packages used by an applicatation.   | String | optional | <code>""</code> |
29| <a id="license-package_url"></a>package_url |  The URL this instance of the package was download from. This may be used to produce an index of OSS packages used by an applicatation.   | String | optional | <code>""</code> |
30| <a id="license-package_version"></a>package_version |  A human readable version string identifying this package. This may be used to produce an index of OSS packages used by an applicatation.  It should be a value that increases over time, rather than a commit hash.   | String | optional | <code>""</code> |
31
32
33
34<!-- Generated with Stardoc: http://skydoc.bazel.build -->
35
36Proof of concept. License restriction.
37
38<a id="license_kind"></a>
39
40## license_kind
41
42<pre>
43license_kind(<a href="#license_kind-name">name</a>, <a href="#license_kind-canonical_text">canonical_text</a>, <a href="#license_kind-conditions">conditions</a>, <a href="#license_kind-long_name">long_name</a>, <a href="#license_kind-url">url</a>)
44</pre>
45
46
47
48**ATTRIBUTES**
49
50
51| Name  | Description | Type | Mandatory | Default |
52| :------------- | :------------- | :------------- | :------------- | :------------- |
53| <a id="license_kind-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |  |
54| <a id="license_kind-canonical_text"></a>canonical_text |  File containing the canonical text for this license. Must be UTF-8 encoded.   | <a href="https://bazel.build/concepts/labels">Label</a> | optional | <code>None</code> |
55| <a id="license_kind-conditions"></a>conditions |  Conditions to be met when using software under this license.  Conditions are defined by the organization using this license.   | List of strings | required |  |
56| <a id="license_kind-long_name"></a>long_name |  Human readable long name of license.   | String | optional | <code>""</code> |
57| <a id="license_kind-url"></a>url |  URL pointing to canonical license definition   | String | optional | <code>""</code> |
58
59
60
61<!-- Generated with Stardoc: http://skydoc.bazel.build -->
62
63Rules for declaring metadata about a package.
64
65<a id="package_info"></a>
66
67## package_info
68
69<pre>
70package_info(<a href="#package_info-name">name</a>, <a href="#package_info-package_name">package_name</a>, <a href="#package_info-package_url">package_url</a>, <a href="#package_info-package_version">package_version</a>)
71</pre>
72
73
74
75**ATTRIBUTES**
76
77
78| Name  | Description | Type | Mandatory | Default |
79| :------------- | :------------- | :------------- | :------------- | :------------- |
80| <a id="package_info-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |  |
81| <a id="package_info-package_name"></a>package_name |  A human readable name identifying this package. This may be used to produce an index of OSS packages used by an applicatation.   | String | optional | <code>""</code> |
82| <a id="package_info-package_url"></a>package_url |  The URL this instance of the package was download from. This may be used to produce an index of OSS packages used by an applicatation.   | String | optional | <code>""</code> |
83| <a id="package_info-package_version"></a>package_version |  A human readable version string identifying this package. This may be used to produce an index of OSS packages used by an applicatation.  It should be a value that increases over time, rather than a commit hash.   | String | optional | <code>""</code> |
84
85
86
87<!-- Generated with Stardoc: http://skydoc.bazel.build -->
88
89Providers for license rules.
90
91<a id="LicenseInfo"></a>
92
93## LicenseInfo
94
95<pre>
96LicenseInfo(<a href="#LicenseInfo-copyright_notice">copyright_notice</a>, <a href="#LicenseInfo-label">label</a>, <a href="#LicenseInfo-license_kinds">license_kinds</a>, <a href="#LicenseInfo-license_text">license_text</a>, <a href="#LicenseInfo-namespace">namespace</a>, <a href="#LicenseInfo-package_name">package_name</a>,
97            <a href="#LicenseInfo-package_url">package_url</a>, <a href="#LicenseInfo-package_version">package_version</a>)
98</pre>
99
100Provides information about a license instance.
101
102**FIELDS**
103
104
105| Name  | Description |
106| :------------- | :------------- |
107| <a id="LicenseInfo-copyright_notice"></a>copyright_notice |  string: Human readable short copyright notice    |
108| <a id="LicenseInfo-label"></a>label |  Label: label of the license rule    |
109| <a id="LicenseInfo-license_kinds"></a>license_kinds |  list(LicenseKindInfo): License kinds    |
110| <a id="LicenseInfo-license_text"></a>license_text |  string: The license file path    |
111| <a id="LicenseInfo-namespace"></a>namespace |  string: namespace of the license rule    |
112| <a id="LicenseInfo-package_name"></a>package_name |  string: Human readable package name    |
113| <a id="LicenseInfo-package_url"></a>package_url |  URL from which this package was downloaded.    |
114| <a id="LicenseInfo-package_version"></a>package_version |  Human readable version string    |
115
116
117
118<!-- Generated with Stardoc: http://skydoc.bazel.build -->
119
120Providers for license rules.
121
122<a id="LicenseKindInfo"></a>
123
124## LicenseKindInfo
125
126<pre>
127LicenseKindInfo(<a href="#LicenseKindInfo-conditions">conditions</a>, <a href="#LicenseKindInfo-label">label</a>, <a href="#LicenseKindInfo-long_name">long_name</a>, <a href="#LicenseKindInfo-name">name</a>)
128</pre>
129
130Provides information about a license_kind instance.
131
132**FIELDS**
133
134
135| Name  | Description |
136| :------------- | :------------- |
137| <a id="LicenseKindInfo-conditions"></a>conditions |  list(string): List of conditions to be met when using this packages under this license.    |
138| <a id="LicenseKindInfo-label"></a>label |  Label: The full path to the license kind definition.    |
139| <a id="LicenseKindInfo-long_name"></a>long_name |  string: Human readable license name    |
140| <a id="LicenseKindInfo-name"></a>name |  string: Canonical license name    |
141
142
143
144<!-- Generated with Stardoc: http://skydoc.bazel.build -->
145
146Providers for license rules.
147
148<a id="PackageInfo"></a>
149
150## PackageInfo
151
152<pre>
153PackageInfo(<a href="#PackageInfo-type">type</a>, <a href="#PackageInfo-label">label</a>, <a href="#PackageInfo-package_name">package_name</a>, <a href="#PackageInfo-package_url">package_url</a>, <a href="#PackageInfo-package_version">package_version</a>)
154</pre>
155
156Provides information about a package.
157
158**FIELDS**
159
160
161| Name  | Description |
162| :------------- | :------------- |
163| <a id="PackageInfo-type"></a>type |  string: How to interpret data    |
164| <a id="PackageInfo-label"></a>label |  Label: label of the package_info rule    |
165| <a id="PackageInfo-package_name"></a>package_name |  string: Human readable package name    |
166| <a id="PackageInfo-package_url"></a>package_url |  string: URL from which this package was downloaded.    |
167| <a id="PackageInfo-package_version"></a>package_version |  string: Human readable version string    |
168
169
170
171