Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions build_rules/github.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def github_new_http_archive(name, package, build_file = None, build_file_content
build_file_content = build_file_content,
)

def github_go_repository(name, package, importpath = "", commit = None, tag = None, sha256 = ""):
def github_go_repository(name, package, commit = None , tag = None, importpath = "", sha256 = "", mirror_urls = [], **kwargs):
"""Adding go repository from github and convert it to bazel repository.

Note that for now the dependencies will not be pulled in automatically. You
Expand All @@ -87,18 +87,16 @@ def github_go_repository(name, package, importpath = "", commit = None, tag = No
github.com/Shopify/sarama.
commit: (string) Commit number.
tag: (string) Commit tag. Exactly one of commit or tag is required.
importpath: (string) Optionally override the import path.
sha256: (string) Optional checksum.
mirror_urls: (list of string) Optional list of mirror URLs. This does not
have to include the github URL.
"""
remote = "https://github.com/" + package
if importpath == "":
importpath = "github.com/" + package
return go_repository(
name = name,
importpath = importpath,
remote = remote,
vcs = "git",
commit = commit,
tag = tag,
urls = [_github_tar_gz_url(package, commit, tag)] + mirror_urls,
strip_prefix = _tar_gz_prefix(package, commit, tag),
sha256 = sha256,
**kwargs
)
6 changes: 3 additions & 3 deletions build_rules/init_go.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def init_go():
# go_prefix, which requires us to rework ALL the repositories.
http_archive(
name = "io_bazel_rules_go",
url = "https://github.com/lingochamp/rules_go/archive/d8f26fc6e707e951e9069790fc2098420fc9b82d.tar.gz",
sha256 = "b7d50d95a9252c69f850af79caf4adc84a654a8a8e24c281cd8fd61e49fa67dc",
strip_prefix = "rules_go-d8f26fc6e707e951e9069790fc2098420fc9b82d",
url = "https://github.com/lingochamp/rules_go/archive/3b8b931a870ed93477e92e089e358c48deaa3836.tar.gz",
#sha256 = "b7d50d95a9252c69f850af79caf4adc84a654a8a8e24c281cd8fd61e49fa67dc",
#strip_prefix = "rules_go-3b8b931a870ed93477e92e089e358c48deaa3836",
)