Go: add vendor update to //go:gen

This commit is contained in:
Paolo Tranquilli
2024-04-26 16:31:04 +02:00
parent d98ccdfa06
commit 0f387eeac2
3 changed files with 12 additions and 5 deletions

View File

@@ -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"):