Bazel: reorganization

* fixed 5.0.0 as bazel version
* made dependencies better loadable
* moved `//swift/install` to `//swift:create-extractor-pack` (following
  the clearer ruby naming)
* renamed `extractor_pack` to `extractor-pack` for consistency with Ruby
This commit is contained in:
Paolo Tranquilli
2022-04-11 14:29:38 +02:00
parent 13b2442fed
commit a205b465ba
12 changed files with 102 additions and 40 deletions

View File

@@ -2,6 +2,6 @@
"provide": [
"ql/lib/qlpack.yml",
"ql/test/qlpack.yml",
"extractor_pack/codeql-extractor.yml"
"extractor-pack/codeql-extractor.yml"
]
}

2
swift/.gitignore vendored
View File

@@ -1 +1 @@
extractor_pack
extractor-pack

View File

@@ -1,5 +1,7 @@
load("@rules_pkg//:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files")
load("@rules_pkg//:install.bzl", "pkg_install")
load("@ql//:defs.bzl", "codeql_platform")
load("@ql_utils//:source_dir.bzl", "current_source_dir")
pkg_files(
name = "dbscheme",
@@ -52,3 +54,12 @@ pkg_filegroup(
],
visibility = ["//visibility:public"],
)
pkg_install(
name = "create-extractor-pack",
srcs = ["//swift:extractor-pack"],
args = [
"--destdir",
current_source_dir() + "/extractor-pack",
],
)

View File

@@ -4,5 +4,6 @@ The Swift codeql package is an experimental and unsupported work in progress.
## Usage
Run `bazel run //swift/install`, which will install `swift/extractor_pack`. Using `--search-path=swift` will then pick
up the Swift extractor.
Run `bazel run //swift:create-extractor-pack`, which will install `swift/extractor-pack`.
Using `--search-path=swift/extractor-pack` will then pick up the Swift extractor. You can also use
`--search-path=swift`, as the extractor pack is mentioned in `swift/.codeqlmanifest`.

View File

@@ -1,11 +0,0 @@
load("@utils//:source_dir.bzl", "current_source_dir")
load("@rules_pkg//:install.bzl", "pkg_install")
pkg_install(
name = "install",
srcs = ["//swift:extractor-pack"],
args = [
"--destdir",
current_source_dir() + "/../extractor_pack",
],
)