From 10b8d3a9becc241389c80643400794d1ca8132cb Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 22 Apr 2024 09:27:42 -0700 Subject: [PATCH] Create ADD_PKG_MGR.md Needs some discussion with @mzeren-vmw about whether this is the shape we want to commit to, vs. having a `package_info` rule as well. --- docs/ADD_PKG_MGR.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 docs/ADD_PKG_MGR.md diff --git a/docs/ADD_PKG_MGR.md b/docs/ADD_PKG_MGR.md new file mode 100644 index 0000000..83083ff --- /dev/null +++ b/docs/ADD_PKG_MGR.md @@ -0,0 +1,22 @@ +# Adding support for a new package manager + +Bazel largely relies on existing package managers for each language ecosystem to fetch dependencies. +Thus the knowledge of provenance and package metadata needs to be plumbed through these tools. + +## + +In BUILD targets generated for third-party packages, implementations must create one of the following: + +```starlark +load("@rules_license//rules:license.bzl", "license") + +package( + default_package_metadata = [":license"], +) + +license( + name = "license", + src = ":LICENSE.txt", + license_kind = ["@rules_license//licenses/spdx:Apache-2.0"], +) +```