unplugged-system/external/bazelbuild-rules_license/docs/latest.md

8.7 KiB
Executable File

Rules for declaring the compliance licenses used by a package.

license

license(name, copyright_notice, license_kinds, license_text, namespace, package_name, package_url,
         package_version)

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
copyright_notice Copyright notice. String optional ""
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. List of labels optional []
license_text The license file. Label optional LICENSE
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 ""
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 ""
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 ""
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 ""

Proof of concept. License restriction.

license_kind

license_kind(name, canonical_text, conditions, long_name, url)

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
canonical_text File containing the canonical text for this license. Must be UTF-8 encoded. Label optional None
conditions Conditions to be met when using software under this license. Conditions are defined by the organization using this license. List of strings required
long_name Human readable long name of license. String optional ""
url URL pointing to canonical license definition String optional ""

Rules for declaring metadata about a package.

package_info

package_info(name, package_name, package_url, package_version)

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
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 ""
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 ""
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 ""

Providers for license rules.

LicenseInfo

LicenseInfo(copyright_notice, label, license_kinds, license_text, namespace, package_name,
            package_url, package_version)

Provides information about a license instance.

FIELDS

Name Description
copyright_notice string: Human readable short copyright notice
label Label: label of the license rule
license_kinds list(LicenseKindInfo): License kinds
license_text string: The license file path
namespace string: namespace of the license rule
package_name string: Human readable package name
package_url URL from which this package was downloaded.
package_version Human readable version string

Providers for license rules.

LicenseKindInfo

LicenseKindInfo(conditions, label, long_name, name)

Provides information about a license_kind instance.

FIELDS

Name Description
conditions list(string): List of conditions to be met when using this packages under this license.
label Label: The full path to the license kind definition.
long_name string: Human readable license name
name string: Canonical license name

Providers for license rules.

PackageInfo

PackageInfo(type, label, package_name, package_url, package_version)

Provides information about a package.

FIELDS

Name Description
type string: How to interpret data
label Label: label of the package_info rule
package_name string: Human readable package name
package_url string: URL from which this package was downloaded.
package_version string: Human readable version string