codeql/swift/BUILD.bazel

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

137 строки
3.2 KiB
Python
Исходник Обычный вид История

2023-08-31 09:12:52 +03:00
load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix")
load("@rules_pkg//:install.bzl", "pkg_install")
2022-04-12 17:03:20 +03:00
load("//:defs.bzl", "codeql_platform")
load("//misc/bazel:pkg_runfiles.bzl", "pkg_runfiles")
load("//misc/bazel/cmake:cmake.bzl", "generate_cmake")
filegroup(
name = "schema",
srcs = ["schema.py"],
visibility = ["//swift:__subpackages__"],
)
filegroup(
name = "schema_includes",
srcs = glob(["*.dbscheme"]),
visibility = ["//swift:__subpackages__"],
)
filegroup(
2023-02-23 11:26:23 +03:00
name = "codegen_conf",
srcs = ["codegen.conf"],
visibility = ["//swift:__subpackages__"],
)
pkg_files(
name = "dbscheme_files",
srcs = [
"ql/lib/swift.dbscheme.stats",
"//swift/extractor/trap:generated_dbscheme",
],
)
pkg_files(
name = "manifest",
srcs = ["codeql-extractor.yml"],
)
pkg_filegroup(
name = "extractor-pack-generic",
srcs = [
":manifest",
2022-10-21 14:42:24 +03:00
"//swift/tools",
] + select({
"@platforms//os:windows": [],
"//conditions:default": [
":dbscheme_files",
"//swift/downgrades",
],
}),
visibility = ["//visibility:public"],
)
pkg_filegroup(
name = "extractor",
srcs = ["//swift/extractor:pkg"],
prefix = "tools/" + codeql_platform,
)
2022-10-12 09:55:00 +03:00
pkg_runfiles(
2023-08-31 09:12:52 +03:00
name = "swift-autobuilder",
srcs = ["//swift/swift-autobuilder"],
2022-10-12 09:55:00 +03:00
prefix = "tools/" + codeql_platform,
)
pkg_runfiles(
name = "diagnostics",
srcs = ["//swift/tools/diagnostics:autobuilder-incompatible-os"],
prefix = "tools/" + codeql_platform,
)
pkg_filegroup(
name = "resource-dir-arch",
srcs = ["//swift/third_party/swift-llvm-support:swift-resource-dir"],
prefix = "resource-dir/" + codeql_platform,
visibility = ["//visibility:public"],
)
2022-04-20 13:35:19 +03:00
pkg_files(
name = "swift-test-sdk-arch",
srcs = ["//swift/third_party/swift-llvm-support:swift-test-sdk"],
2022-04-20 13:35:19 +03:00
prefix = "qltest/" + codeql_platform,
strip_prefix = strip_prefix.from_pkg(),
)
pkg_filegroup(
name = "extractor-pack-arch",
srcs = select({
"@platforms//os:windows": [],
"//conditions:default": [
":extractor",
":resource-dir-arch",
":swift-test-sdk-arch",
],
}) + select({
"@platforms//os:macos": [
2023-08-31 09:12:52 +03:00
":swift-autobuilder",
],
"//conditions:default": [
":diagnostics",
],
}),
visibility = ["//visibility:public"],
)
pkg_filegroup(
name = "extractor-pack",
srcs = [
":extractor-pack-arch",
":extractor-pack-generic",
],
visibility = ["//visibility:public"],
)
pkg_install(
2022-04-12 17:03:20 +03:00
name = "_create_extractor_pack",
srcs = ["//swift:extractor-pack"],
2022-04-12 17:03:20 +03:00
)
py_binary(
name = "create-extractor-pack",
2022-10-21 14:42:24 +03:00
srcs = ["create_extractor_pack.py"],
main = "create_extractor_pack.py",
2022-04-12 17:03:20 +03:00
deps = [":_create_extractor_pack"],
)
generate_cmake(
name = "cmake",
targets = [
"//swift/extractor:extractor.real",
"//swift/logging/tests/assertion-diagnostics:assert-false",
] + select({
"@platforms//os:linux": ["//swift/tools/diagnostics:autobuilder-incompatible-os"],
2023-08-31 09:12:52 +03:00
"@platforms//os:macos": ["//swift/swift-autobuilder"],
}),
visibility = ["//visibility:public"],
)