2022-04-20 13:35:19 +03:00
|
|
|
load("@rules_pkg//:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files", "strip_prefix")
|
2022-04-11 15:29:38 +03:00
|
|
|
load("@rules_pkg//:install.bzl", "pkg_install")
|
2022-04-12 17:03:20 +03:00
|
|
|
load("//:defs.bzl", "codeql_platform")
|
2022-04-08 11:06:51 +03:00
|
|
|
|
|
|
|
pkg_files(
|
|
|
|
name = "dbscheme",
|
|
|
|
srcs = [
|
|
|
|
"ql/lib/swift.dbscheme",
|
|
|
|
"ql/lib/swift.dbscheme.stats",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
pkg_files(
|
|
|
|
name = "qltest",
|
|
|
|
srcs = ["tools/qltest.sh"],
|
|
|
|
attributes = pkg_attributes(mode = "0755"),
|
|
|
|
prefix = "tools",
|
|
|
|
)
|
|
|
|
|
|
|
|
pkg_files(
|
|
|
|
name = "manifest",
|
|
|
|
srcs = ["codeql-extractor.yml"],
|
|
|
|
)
|
|
|
|
|
|
|
|
pkg_filegroup(
|
|
|
|
name = "extractor-pack-generic",
|
|
|
|
srcs = [
|
|
|
|
":dbscheme",
|
|
|
|
":manifest",
|
|
|
|
":qltest",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
pkg_files(
|
|
|
|
name = "extractor",
|
|
|
|
srcs = ["//swift/extractor"],
|
|
|
|
attributes = pkg_attributes(mode = "0755"),
|
|
|
|
prefix = "tools/" + codeql_platform,
|
|
|
|
)
|
|
|
|
|
2022-04-20 13:35:19 +03:00
|
|
|
alias(
|
|
|
|
name = "swift-test-sdk",
|
|
|
|
actual = select({
|
|
|
|
"@bazel_tools//src/conditions:%s" % arch: "@swift_prebuilt_%s//:swift-test-sdk" % arch
|
|
|
|
for arch in ("linux", "darwin_x86_64", "darwin_arm64")
|
|
|
|
}),
|
|
|
|
)
|
|
|
|
|
|
|
|
pkg_files(
|
|
|
|
name = "swift-test-sdk-arch",
|
|
|
|
srcs = [":swift-test-sdk"],
|
|
|
|
prefix = "qltest/" + codeql_platform,
|
|
|
|
strip_prefix = strip_prefix.from_pkg(),
|
|
|
|
)
|
|
|
|
|
2022-04-08 11:06:51 +03:00
|
|
|
pkg_filegroup(
|
|
|
|
name = "extractor-pack-arch",
|
2022-04-20 13:35:19 +03:00
|
|
|
srcs = [
|
|
|
|
":extractor",
|
|
|
|
":swift-test-sdk-arch"
|
|
|
|
],
|
2022-04-08 11:06:51 +03:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
pkg_filegroup(
|
|
|
|
name = "extractor-pack",
|
|
|
|
srcs = [
|
|
|
|
":extractor-pack-arch",
|
|
|
|
":extractor-pack-generic",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
2022-04-11 15:29:38 +03:00
|
|
|
|
|
|
|
pkg_install(
|
2022-04-12 17:03:20 +03:00
|
|
|
name = "_create_extractor_pack",
|
2022-04-11 15:29:38 +03:00
|
|
|
srcs = ["//swift:extractor-pack"],
|
2022-04-12 17:03:20 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
py_binary(
|
|
|
|
name = "create-extractor-pack",
|
|
|
|
srcs = ["tools/create_extractor_pack.py"],
|
|
|
|
main = "tools/create_extractor_pack.py",
|
|
|
|
deps = [":_create_extractor_pack"],
|
2022-04-11 15:29:38 +03:00
|
|
|
)
|