mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Go: add vendor update to //go:gen
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
|
||||
load("@gazelle//:def.bzl", "gazelle")
|
||||
load("@rules_pkg//pkg:install.bzl", "pkg_install")
|
||||
load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files")
|
||||
load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files")
|
||||
load("//:defs.bzl", "codeql_platform")
|
||||
|
||||
gazelle(
|
||||
name = "_gazelle",
|
||||
name = "gazelle",
|
||||
extra_args = ["go/extractor"],
|
||||
)
|
||||
|
||||
_gen_binaries = [
|
||||
":_gazelle",
|
||||
"@rules_go//go",
|
||||
":gazelle",
|
||||
"//go/extractor/cli/go-gen-dbscheme",
|
||||
]
|
||||
|
||||
@@ -62,6 +64,7 @@ pkg_files(
|
||||
"//go/extractor/cli/go-gen-dbscheme",
|
||||
"//go/extractor/cli/go-tokenizer",
|
||||
],
|
||||
attributes = pkg_attributes(mode = "0755"),
|
||||
prefix = "tools/" + codeql_platform,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
1
go/extractor/vendor/modules.txt
vendored
1
go/extractor/vendor/modules.txt
vendored
@@ -1,3 +1,4 @@
|
||||
## workspace
|
||||
# golang.org/x/mod v0.15.0
|
||||
## explicit; go 1.18
|
||||
golang.org/x/mod/internal/lazyregexp
|
||||
|
||||
@@ -7,14 +7,17 @@ this = pathlib.Path(__file__).resolve()
|
||||
go_extractor_dir = this.parent / "extractor"
|
||||
go_dbscheme = this.parent / "ql" / "lib" / "go.dbscheme"
|
||||
r = runfiles.Create()
|
||||
gazelle, go_gen_dbscheme = map(r.Rlocation, sys.argv[1:])
|
||||
go, gazelle, go_gen_dbscheme = map(r.Rlocation, sys.argv[1:])
|
||||
|
||||
print("updating vendor")
|
||||
subprocess.check_call([go, "-C", go_extractor_dir, "work", "vendor"])
|
||||
|
||||
print("clearing generated BUILD files")
|
||||
for build_file in go_extractor_dir.glob("*/**/BUILD.bazel"):
|
||||
build_file.unlink()
|
||||
|
||||
print("running gazelle")
|
||||
subprocess.check_call([gazelle, "go/extractor"])
|
||||
subprocess.check_call([gazelle])
|
||||
|
||||
print("adding header to generated BUILD files")
|
||||
for build_file in go_extractor_dir.glob("*/**/BUILD.bazel"):
|
||||
|
||||
Reference in New Issue
Block a user