Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide rules_license metadata in crate BUILD files #2475

Open
nickcollier opened this issue Feb 12, 2024 · 1 comment
Open

Provide rules_license metadata in crate BUILD files #2475

nickcollier opened this issue Feb 12, 2024 · 1 comment

Comments

@nickcollier
Copy link
Contributor

Please provide an option to include rules_license metadata when rendering crate BUILD files.

For example the BUILD file for the rand crate would include

...

load("@rules_license//rules:package_info.bzl", "package_info")

load("@rules_license//rules:license.bzl", "license")

package(
    default_package_metadata = [
        ":license",
        ":package_info",
    ],
    default_visibility = ["//visibility:public"],
)

package_info(
    name = "package_info",
    package_name = "rand",
    package_version = "0.8.5",
    package_url = "https://github.com/rust-random/rand",
)

license(
    name = "license",
    license_kinds = [
        "@rules_license//licenses/spdx:Apache-2.0",
        "@rules_license//licenses/spdx:MIT",
    ],
)

...
@nickcollier nickcollier changed the title Provide rules_license metadata for crate packages Provide rules_license metadata for crate BUILD files Feb 12, 2024
@nickcollier nickcollier changed the title Provide rules_license metadata for crate BUILD files Provide rules_license metadata in crate BUILD files Feb 12, 2024
@fhilgers
Copy link

fhilgers commented Jun 4, 2024

rules_license also gives the option to set copyright_notice and license_text. Should there be an option to try and get this automatically as well? Or is this too complicated and should be done if needed via the package_url field by users?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants