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-05-03 10:54:15 +03:00
|
|
|
load("//misc/bazel:pkg_runfiles.bzl", "pkg_runfiles")
|
2022-04-08 11:06:51 +03:00
|
|
|
|
2022-09-02 15:06:04 +03:00
|
|
|
filegroup(
|
|
|
|
name = "schema",
|
|
|
|
srcs = ["schema.py"],
|
|
|
|
visibility = ["//swift:__subpackages__"],
|
|
|
|
)
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "schema_includes",
|
|
|
|
srcs = glob(["*.dbscheme"]),
|
|
|
|
visibility = ["//swift:__subpackages__"],
|
|
|
|
)
|
|
|
|
|
2022-04-28 11:47:48 +03:00
|
|
|
pkg_files(
|
|
|
|
name = "dbscheme_files",
|
2022-04-08 11:06:51 +03:00
|
|
|
srcs = [
|
|
|
|
"ql/lib/swift.dbscheme.stats",
|
2022-06-01 10:47:45 +03:00
|
|
|
"//swift/extractor/trap:generated_dbscheme",
|
2022-04-08 11:06:51 +03:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
pkg_files(
|
2022-10-18 11:04:50 +03:00
|
|
|
name = "scripts",
|
|
|
|
srcs = ["tools/qltest.sh", "tools/autobuild.sh"],
|
2022-10-12 09:55:00 +03:00
|
|
|
attributes = pkg_attributes(mode = "0755"),
|
|
|
|
prefix = "tools",
|
|
|
|
)
|
|
|
|
|
2022-04-28 14:17:35 +03:00
|
|
|
pkg_files(
|
|
|
|
name = "tracing-config",
|
|
|
|
srcs = ["tools/tracing-config.lua"],
|
|
|
|
prefix = "tools",
|
|
|
|
)
|
|
|
|
|
2022-04-08 11:06:51 +03:00
|
|
|
pkg_files(
|
|
|
|
name = "manifest",
|
|
|
|
srcs = ["codeql-extractor.yml"],
|
|
|
|
)
|
|
|
|
|
|
|
|
pkg_filegroup(
|
|
|
|
name = "extractor-pack-generic",
|
|
|
|
srcs = [
|
2022-04-28 11:47:48 +03:00
|
|
|
":dbscheme_files",
|
2022-04-08 11:06:51 +03:00
|
|
|
":manifest",
|
2022-04-28 14:17:35 +03:00
|
|
|
":tracing-config",
|
2022-10-18 11:04:50 +03:00
|
|
|
":scripts",
|
2022-04-08 11:06:51 +03:00
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
2022-05-03 10:54:15 +03:00
|
|
|
pkg_runfiles(
|
2022-04-08 11:06:51 +03:00
|
|
|
name = "extractor",
|
|
|
|
srcs = ["//swift/extractor"],
|
|
|
|
prefix = "tools/" + codeql_platform,
|
|
|
|
)
|
|
|
|
|
2022-10-12 09:55:00 +03:00
|
|
|
pkg_runfiles(
|
|
|
|
name = "xcode-autobuilder",
|
|
|
|
srcs = ["//swift/xcode-autobuilder"],
|
|
|
|
prefix = "tools/" + codeql_platform,
|
|
|
|
)
|
|
|
|
|
2022-04-20 13:35:19 +03:00
|
|
|
pkg_files(
|
|
|
|
name = "swift-test-sdk-arch",
|
2022-05-03 10:54:15 +03:00
|
|
|
srcs = ["//swift/tools/prebuilt:swift-test-sdk"],
|
2022-04-20 13:35:19 +03:00
|
|
|
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",
|
2022-04-28 11:47:48 +03:00
|
|
|
":swift-test-sdk-arch",
|
2022-10-17 11:14:06 +03:00
|
|
|
] + select({
|
|
|
|
"@platforms//os:linux": [],
|
|
|
|
"@platforms//os:macos": [
|
|
|
|
":xcode-autobuilder"
|
|
|
|
],
|
|
|
|
}),
|
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
|
|
|
)
|