Skip to content

Commit

Permalink
Merge pull request #146 from fmeum/wire-up-purl
Browse files Browse the repository at this point in the history
Add `purl` to `PackageInfo`
  • Loading branch information
aiuto authored Aug 1, 2024
2 parents 696f0ec + 78fca09 commit efd82e3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rules/package_info.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def _package_info_impl(ctx):
package_name = ctx.attr.package_name or ctx.build_file_path.rstrip("/BUILD"),
package_url = ctx.attr.package_url,
package_version = ctx.attr.package_version,
purl = ctx.attr.purl,
)

# Experimental alternate design, using a generic 'data' back to hold things
Expand All @@ -44,6 +45,7 @@ def _package_info_impl(ctx):
"package_name": ctx.attr.package_name or ctx.build_file_path.rstrip("/BUILD"),
"package_url": ctx.attr.package_url,
"package_version": ctx.attr.package_version,
"purl": ctx.attr.purl,
},
)
return [provider, generic_provider]
Expand All @@ -54,22 +56,22 @@ _package_info = rule(
"package_name": attr.string(
doc = "A human readable name identifying this package." +
" This may be used to produce an index of OSS packages used by" +
" an applicatation.",
" an application.",
),
"package_url": attr.string(
doc = "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.",
" an application.",
),
"package_version": attr.string(
doc = "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" +
" by an application. It should be a value that" +
" increases over time, rather than a commit hash.",
),
"purl": attr.string(
doc = "A pURL conforming to the spec outlined in" +
" https://github.com/package-url/purl-spec This may be used when" +
" https://github.com/package-url/purl-spec. This may be used when" +
" generating an SBOM.",
),
},
Expand Down

0 comments on commit efd82e3

Please sign in to comment.