зеркало из https://github.com/github/codeql.git
Make CodeQLPackInfo provider public.
This commit is contained in:
Родитель
02100e58d9
Коммит
58f69c9385
|
@ -72,7 +72,7 @@ def codeql_pkg_files(
|
|||
|
||||
_ZipInfo = provider(fields = {"zips_to_prefixes": "mapping of zip files to prefixes"})
|
||||
|
||||
_CodeQLPackInfo = provider(
|
||||
CodeQLPackInfo = provider(
|
||||
"A provider that encapsulates all the information needed to build a codeql pack.",
|
||||
fields = {
|
||||
"pack_prefix": "A prefix to add to all paths, IF the user requests so. We omit it for local installation targets of single packs (but not pack groups)",
|
||||
|
@ -175,7 +175,7 @@ def _codeql_pack_info_impl(ctx):
|
|||
zips_to_prefixes.keys(),
|
||||
transitive = [ctx.attr.src[DefaultInfo].files],
|
||||
)),
|
||||
_CodeQLPackInfo(
|
||||
CodeQLPackInfo(
|
||||
arch_overrides = ctx.attr.arch_overrides,
|
||||
files = ctx.attr.src[PackageFilegroupInfo],
|
||||
zips = _ZipInfo(zips_to_prefixes = zips_to_prefixes),
|
||||
|
@ -206,11 +206,11 @@ _codeql_pack_info = rule(
|
|||
"prefix": attr.string(doc = "Prefix to add to all files."),
|
||||
"arch_overrides": attr.string_list(doc = "A list of files that should be included in the arch package regardless of the path, specify the path _without_ `prefix`."),
|
||||
},
|
||||
provides = [_CodeQLPackInfo],
|
||||
provides = [CodeQLPackInfo],
|
||||
)
|
||||
|
||||
_CODEQL_PACK_GROUP_EXTRACT_ATTRS = {
|
||||
"srcs": attr.label_list(providers = [_CodeQLPackInfo], mandatory = True, doc = "List of `_codeql_pack_info` rules (generated by `codeql_pack`)."),
|
||||
"srcs": attr.label_list(providers = [CodeQLPackInfo], mandatory = True, doc = "List of `_codeql_pack_info` rules (generated by `codeql_pack`)."),
|
||||
"apply_pack_prefix": attr.bool(doc = "Set to `False` to skip adding the per-pack prefix to all file paths.", default = True),
|
||||
"kind": attr.string(doc = "Extract only the commmon, arch-specific, or all files from the pack group.", values = ["common", "arch", "all"]),
|
||||
"prefix": attr.string(doc = "Prefix to add to all files, is prefixed after the per-pack prefix has been applied.", default = ""),
|
||||
|
@ -228,7 +228,7 @@ def _codeql_pack_group_extract_files_impl(ctx):
|
|||
|
||||
platform, apply_pack_prefix, include_all_files = _codeql_pack_group_extract_options(ctx)
|
||||
for src in ctx.attr.srcs:
|
||||
src = src[_CodeQLPackInfo]
|
||||
src = src[CodeQLPackInfo]
|
||||
if src.files.pkg_dirs or src.files.pkg_symlinks:
|
||||
fail("`pkg_dirs` and `pkg_symlinks` are not supported for codeql packaging rules")
|
||||
prefix = paths.join(ctx.attr.prefix, src.pack_prefix) if apply_pack_prefix else ctx.attr.prefix
|
||||
|
@ -271,7 +271,7 @@ def _codeql_pack_group_extract_zips_impl(ctx):
|
|||
|
||||
platform, apply_pack_prefix, include_all_files = _codeql_pack_group_extract_options(ctx)
|
||||
for src in ctx.attr.srcs:
|
||||
src = src[_CodeQLPackInfo]
|
||||
src = src[CodeQLPackInfo]
|
||||
prefix = paths.join(ctx.attr.prefix, src.pack_prefix) if apply_pack_prefix else ctx.attr.prefix
|
||||
|
||||
# for each zip file, resolve whether it's filtered out or not by the current kind, and add the pack prefix
|
||||
|
|
Загрузка…
Ссылка в новой задаче