Swift: moved install to a separate package

When importing the workspace from semmle-code, we do not need nor want
to instantiate `@util`, so that must be in a separate bazel package.
This commit is contained in:
Paolo Tranquilli
2022-04-08 15:07:47 +02:00
parent 95dbf2d666
commit 664d5ba0a9
4 changed files with 13 additions and 27 deletions

View File

@@ -27,19 +27,6 @@ http_archive(
], ],
) )
http_archive(
name = "bazel_skylib",
sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d",
urls = [
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz",
],
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
load("@ql//:defs.bzl", "ql_utils") load("@ql//:defs.bzl", "ql_utils")
ql_utils(name = "utils") ql_utils(name = "utils")

View File

@@ -1,8 +1,5 @@
load("@rules_pkg//:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files") 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//:defs.bzl", "codeql_platform")
load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
load("@utils//:paths.bzl", "source_dir")
pkg_files( pkg_files(
name = "dbscheme", name = "dbscheme",
@@ -55,12 +52,3 @@ pkg_filegroup(
], ],
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )
pkg_install(
name = "install",
srcs = [":extractor-pack"],
args = [
"--destdir",
source_dir() + "/extractor_pack",
],
)

View File

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

11
swift/install/BUILD.bazel Normal file
View File

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