• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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-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-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> |
28| <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> |
29| <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> |
30
31
32
33<!-- Generated with Stardoc: http://skydoc.bazel.build -->
34
35Proof of concept. License restriction.
36
37<a id="license_kind"></a>
38
39## license_kind
40
41<pre>
42license_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>)
43</pre>
44
45
46
47**ATTRIBUTES**
48
49
50| Name  | Description | Type | Mandatory | Default |
51| :------------- | :------------- | :------------- | :------------- | :------------- |
52| <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 |  |
53| <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> |
54| <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 |  |
55| <a id="license_kind-long_name"></a>long_name |  Human readable long name of license.   | String | optional | <code>""</code> |
56| <a id="license_kind-url"></a>url |  URL pointing to canonical license definition   | String | optional | <code>""</code> |
57
58
59
60<!-- Generated with Stardoc: http://skydoc.bazel.build -->
61
62Rules for declaring metadata about a package.
63
64<a id="package_info"></a>
65
66## package_info
67
68<pre>
69package_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>)
70</pre>
71
72
73
74**ATTRIBUTES**
75
76
77| Name  | Description | Type | Mandatory | Default |
78| :------------- | :------------- | :------------- | :------------- | :------------- |
79| <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 |  |
80| <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> |
81| <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> |
82| <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> |
83
84
85
86<!-- Generated with Stardoc: http://skydoc.bazel.build -->
87
88Basic providers for license rules.
89
90This file should only contain the basic providers needed to create
91license and package_info declarations. Providers needed to gather
92them are declared in other places.
93
94
95<a id="LicenseInfo"></a>
96
97## LicenseInfo
98
99<pre>
100LicenseInfo(<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-package_name">package_name</a>, <a href="#LicenseInfo-package_url">package_url</a>,
101            <a href="#LicenseInfo-package_version">package_version</a>)
102</pre>
103
104Provides information about a license instance.
105
106**FIELDS**
107
108
109| Name  | Description |
110| :------------- | :------------- |
111| <a id="LicenseInfo-copyright_notice"></a>copyright_notice |  string: Human readable short copyright notice    |
112| <a id="LicenseInfo-label"></a>label |  Label: label of the license rule    |
113| <a id="LicenseInfo-license_kinds"></a>license_kinds |  list(LicenseKindInfo): License kinds    |
114| <a id="LicenseInfo-license_text"></a>license_text |  string: The license file path    |
115| <a id="LicenseInfo-package_name"></a>package_name |  string: Human readable package name    |
116| <a id="LicenseInfo-package_url"></a>package_url |  URL from which this package was downloaded.    |
117| <a id="LicenseInfo-package_version"></a>package_version |  Human readable version string    |
118
119
120
121<!-- Generated with Stardoc: http://skydoc.bazel.build -->
122
123Basic providers for license rules.
124
125This file should only contain the basic providers needed to create
126license and package_info declarations. Providers needed to gather
127them are declared in other places.
128
129
130<a id="LicenseKindInfo"></a>
131
132## LicenseKindInfo
133
134<pre>
135LicenseKindInfo(<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>)
136</pre>
137
138Provides information about a license_kind instance.
139
140**FIELDS**
141
142
143| Name  | Description |
144| :------------- | :------------- |
145| <a id="LicenseKindInfo-conditions"></a>conditions |  list(string): List of conditions to be met when using this packages under this license.    |
146| <a id="LicenseKindInfo-label"></a>label |  Label: The full path to the license kind definition.    |
147| <a id="LicenseKindInfo-long_name"></a>long_name |  string: Human readable license name    |
148| <a id="LicenseKindInfo-name"></a>name |  string: Canonical license name    |
149
150
151
152<!-- Generated with Stardoc: http://skydoc.bazel.build -->
153
154Basic providers for license rules.
155
156This file should only contain the basic providers needed to create
157license and package_info declarations. Providers needed to gather
158them are declared in other places.
159
160
161<a id="PackageInfo"></a>
162
163## PackageInfo
164
165<pre>
166PackageInfo(<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>)
167</pre>
168
169Provides information about a package.
170
171**FIELDS**
172
173
174| Name  | Description |
175| :------------- | :------------- |
176| <a id="PackageInfo-type"></a>type |  string: How to interpret data    |
177| <a id="PackageInfo-label"></a>label |  Label: label of the package_info rule    |
178| <a id="PackageInfo-package_name"></a>package_name |  string: Human readable package name    |
179| <a id="PackageInfo-package_url"></a>package_url |  string: URL from which this package was downloaded.    |
180| <a id="PackageInfo-package_version"></a>package_version |  string: Human readable version string    |
181
182
183
184<!-- Generated with Stardoc: http://skydoc.bazel.build -->
185
186Rules and macros for collecting LicenseInfo providers.
187
188<a id="gather_metadata_info"></a>
189
190## gather_metadata_info
191
192<pre>
193gather_metadata_info(<a href="#gather_metadata_info-name">name</a>)
194</pre>
195
196Collects LicenseInfo providers into a single TransitiveMetadataInfo provider.
197
198**ASPECT ATTRIBUTES**
199
200
201| Name | Type |
202| :------------- | :------------- |
203| *| String |
204
205
206**ATTRIBUTES**
207
208
209| Name  | Description | Type | Mandatory | Default |
210| :------------- | :------------- | :------------- | :------------- | :------------- |
211| <a id="gather_metadata_info-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |   |
212
213
214
215<!-- Generated with Stardoc: http://skydoc.bazel.build -->
216
217Rules and macros for collecting LicenseInfo providers.
218
219<a id="gather_metadata_info_and_write"></a>
220
221## gather_metadata_info_and_write
222
223<pre>
224gather_metadata_info_and_write(<a href="#gather_metadata_info_and_write-name">name</a>)
225</pre>
226
227Collects TransitiveMetadataInfo providers and writes JSON representation to a file.
228
229    Usage:
230      bazel build //some:target           --aspects=@rules_license//rules_gathering:gather_metadata.bzl%gather_metadata_info_and_write
231          --output_groups=licenses
232
233
234**ASPECT ATTRIBUTES**
235
236
237| Name | Type |
238| :------------- | :------------- |
239| *| String |
240
241
242**ATTRIBUTES**
243
244
245| Name  | Description | Type | Mandatory | Default |
246| :------------- | :------------- | :------------- | :------------- | :------------- |
247| <a id="gather_metadata_info_and_write-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |   |
248
249
250
251<!-- Generated with Stardoc: http://skydoc.bazel.build -->
252
253Rules and macros for collecting package metdata providers.
254
255<a id="trace"></a>
256
257## trace
258
259<pre>
260trace(<a href="#trace-name">name</a>)
261</pre>
262
263Used to allow the specification of a target to trace while collecting license dependencies.
264
265**ATTRIBUTES**
266
267
268| Name  | Description | Type | Mandatory | Default |
269| :------------- | :------------- | :------------- | :------------- | :------------- |
270| <a id="trace-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |  |
271
272
273
274