Skip to content

Commit

Permalink
Swift: moved install to a separate package
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
redsun82 committed Apr 12, 2022
1 parent 95dbf2d commit 664d5ba
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 27 deletions.
13 changes: 0 additions & 13 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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")

ql_utils(name = "utils")
12 changes: 0 additions & 12 deletions swift/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
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("@bazel_skylib//rules:native_binary.bzl", "native_binary")
load("@utils//:paths.bzl", "source_dir")

pkg_files(
name = "dbscheme",
Expand Down Expand Up @@ -55,12 +52,3 @@ pkg_filegroup(
],
visibility = ["//visibility:public"],
)

pkg_install(
name = "install",
srcs = [":extractor-pack"],
args = [
"--destdir",
source_dir() + "/extractor_pack",
],
)
4 changes: 2 additions & 2 deletions swift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ The Swift codeql package is an experimental and unsupported work in progress.

## Usage

Run `bazel run //swift:install-extractor`, which will install `swift/extractor_pack`. Using `--search-path=swift` will
then pick up the Swift extractor.
Run `bazel run //swift/install`, which will install `swift/extractor_pack`. Using `--search-path=swift` will then pick
up the Swift extractor.
11 changes: 11 additions & 0 deletions swift/install/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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",
],
)

0 comments on commit 664d5ba

Please sign in to comment.