mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Python code was simplified, and now a `--generate` option can be used to drive what can be generated. The extractor pack creation now will use an internally generated dbscheme. This should be the same as the checked in one, but doing so allows `bazel run create-extractor-pack` and `bazel run codegen` to be run independently from one another, while previously the former had to follow the latter in case of a schema change. This is the change that triggered the above simplification, as in order for the two dbscheme files to be identical, the first `// generated` line had to state the same generator script.
85 lines
1.8 KiB
Python
85 lines
1.8 KiB
Python
load("@rules_pkg//:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files", "strip_prefix")
|
|
load("@rules_pkg//:install.bzl", "pkg_install")
|
|
load("//:defs.bzl", "codeql_platform")
|
|
load("//misc/bazel:pkg_runfiles.bzl", "pkg_runfiles")
|
|
|
|
pkg_files(
|
|
name = "dbscheme_files",
|
|
srcs = [
|
|
"ql/lib/swift.dbscheme.stats",
|
|
"//swift/extractor/trap:generated_dbscheme",
|
|
],
|
|
)
|
|
|
|
pkg_files(
|
|
name = "qltest",
|
|
srcs = ["tools/qltest.sh"],
|
|
attributes = pkg_attributes(mode = "0755"),
|
|
prefix = "tools",
|
|
)
|
|
|
|
pkg_files(
|
|
name = "tracing-config",
|
|
srcs = ["tools/tracing-config.lua"],
|
|
prefix = "tools",
|
|
)
|
|
|
|
pkg_files(
|
|
name = "manifest",
|
|
srcs = ["codeql-extractor.yml"],
|
|
)
|
|
|
|
pkg_filegroup(
|
|
name = "extractor-pack-generic",
|
|
srcs = [
|
|
":dbscheme_files",
|
|
":manifest",
|
|
":qltest",
|
|
":tracing-config",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
pkg_runfiles(
|
|
name = "extractor",
|
|
srcs = ["//swift/extractor"],
|
|
prefix = "tools/" + codeql_platform,
|
|
)
|
|
|
|
pkg_files(
|
|
name = "swift-test-sdk-arch",
|
|
srcs = ["//swift/tools/prebuilt:swift-test-sdk"],
|
|
prefix = "qltest/" + codeql_platform,
|
|
strip_prefix = strip_prefix.from_pkg(),
|
|
)
|
|
|
|
pkg_filegroup(
|
|
name = "extractor-pack-arch",
|
|
srcs = [
|
|
":extractor",
|
|
":swift-test-sdk-arch",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
pkg_filegroup(
|
|
name = "extractor-pack",
|
|
srcs = [
|
|
":extractor-pack-arch",
|
|
":extractor-pack-generic",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
pkg_install(
|
|
name = "_create_extractor_pack",
|
|
srcs = ["//swift:extractor-pack"],
|
|
)
|
|
|
|
py_binary(
|
|
name = "create-extractor-pack",
|
|
srcs = ["tools/create_extractor_pack.py"],
|
|
main = "tools/create_extractor_pack.py",
|
|
deps = [":_create_extractor_pack"],
|
|
)
|