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")
|
2023-06-05 12:12:11 +03:00
|
|
|
load("//misc/bazel/cmake:cmake.bzl", "generate_cmake")
|
2022-04-08 11:06:51 +03:00
|
|
|
|
2022-09-02 15:06:04 +03:00
|
|
|
filegroup(
|
|
|
|
name = "schema",
|
2023-02-23 14:25:16 +03:00
|
|
|
srcs = ["schema.py"],
|
|
|
|
visibility = ["//swift:__subpackages__"],
|
|
|
|
)
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "schema_includes",
|
|
|
|
srcs = glob(["*.dbscheme"]),
|
2022-09-02 15:06:04 +03:00
|
|
|
visibility = ["//swift:__subpackages__"],
|
|
|
|
)
|
|
|
|
|
|
|
|
filegroup(
|
2023-02-23 11:26:23 +03:00
|
|
|
name = "codegen_conf",
|
|
|
|
srcs = ["codegen.conf"],
|
2022-09-02 15:06:04 +03:00
|
|
|
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(
|
|
|
|
name = "manifest",
|
|
|
|
srcs = ["codeql-extractor.yml"],
|
|
|
|
)
|
|
|
|
|
|
|
|
pkg_filegroup(
|
|
|
|
name = "extractor-pack-generic",
|
|
|
|
srcs = [
|
|
|
|
":manifest",
|
2022-10-21 14:42:24 +03:00
|
|
|
"//swift/tools",
|
2023-06-16 19:23:50 +03:00
|
|
|
] + select({
|
|
|
|
"@platforms//os:windows": [],
|
|
|
|
"//conditions:default": [
|
|
|
|
":dbscheme_files",
|
|
|
|
"//swift/downgrades",
|
|
|
|
],
|
|
|
|
}),
|
2022-04-08 11:06:51 +03:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
2022-12-13 11:07:37 +03:00
|
|
|
pkg_filegroup(
|
2022-04-08 11:06:51 +03:00
|
|
|
name = "extractor",
|
2022-12-13 11:07:37 +03:00
|
|
|
srcs = ["//swift/extractor:pkg"],
|
2022-04-08 11:06:51 +03:00
|
|
|
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,
|
|
|
|
)
|
|
|
|
|
2023-05-11 16:43:13 +03:00
|
|
|
pkg_runfiles(
|
2023-06-16 19:22:43 +03:00
|
|
|
name = "diagnostics",
|
|
|
|
srcs = ["//swift/tools/diagnostics:autobuilder-incompatible-os"],
|
2023-05-11 16:43:13 +03:00
|
|
|
prefix = "tools/" + codeql_platform,
|
|
|
|
)
|
|
|
|
|
2023-06-01 13:23:01 +03:00
|
|
|
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",
|
2022-10-26 06:57:08 +03:00
|
|
|
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(),
|
|
|
|
)
|
|
|
|
|
2022-04-08 11:06:51 +03:00
|
|
|
pkg_filegroup(
|
|
|
|
name = "extractor-pack-arch",
|
2023-06-16 19:23:50 +03:00
|
|
|
srcs = select({
|
|
|
|
"@platforms//os:windows": [],
|
|
|
|
"//conditions:default": [
|
|
|
|
":extractor",
|
|
|
|
":resource-dir-arch",
|
|
|
|
":swift-test-sdk-arch",
|
|
|
|
],
|
|
|
|
}) + select({
|
2022-10-17 11:14:06 +03:00
|
|
|
"@platforms//os:macos": [
|
2022-10-21 14:42:24 +03:00
|
|
|
":xcode-autobuilder",
|
2022-10-17 11:14:06 +03:00
|
|
|
],
|
2023-06-16 19:22:43 +03:00
|
|
|
"//conditions:default": [
|
2023-06-16 19:22:43 +03:00
|
|
|
":diagnostics",
|
2023-06-16 19:22:43 +03:00
|
|
|
],
|
2022-10-17 11:14:06 +03:00
|
|
|
}),
|
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",
|
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"],
|
2022-04-11 15:29:38 +03:00
|
|
|
)
|
2023-06-05 12:12:11 +03:00
|
|
|
|
|
|
|
generate_cmake(
|
|
|
|
name = "cmake",
|
|
|
|
targets = [
|
|
|
|
"//swift/extractor:extractor.real",
|
|
|
|
"//swift/logging/tests/assertion-diagnostics:assert-false",
|
|
|
|
] + select({
|
2023-06-16 19:22:43 +03:00
|
|
|
"@platforms//os:linux": ["//swift/tools/diagnostics:autobuilder-incompatible-os"],
|
2023-06-05 12:12:11 +03:00
|
|
|
"@platforms//os:macos": ["//swift/xcode-autobuilder"],
|
|
|
|
}),
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|