make self repository name parametric

In a workspace macro we must use the exact repository name, and this
can be different when importing the workspace (it is different in
semmle-code).
This commit is contained in:
Paolo Tranquilli
2022-04-13 15:26:50 +02:00
parent 73d5691d91
commit 9e3401ce59

View File

@@ -12,7 +12,7 @@ _swift_arch_map = {
"macos-x86_64": "darwin_x86_64",
}
def codeql_workspace():
def codeql_workspace(repository_name = "codeql"):
for repo_arch, arch in _swift_arch_map.items():
sha256 = _swift_sha_map[repo_arch]
@@ -22,7 +22,7 @@ def codeql_workspace():
_swift_prebuilt_version,
repo_arch,
),
build_file = "@codeql//swift/extractor:BUILD.swift-prebuilt.bazel",
build_file = "@%s//swift/extractor:BUILD.swift-prebuilt.bazel" % repository_name,
sha256 = sha256,
)