blob: 6dbc2590c8237780d7f9395bdf4f560a98af3c59 [file] [log] [blame]
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
def github_archive(name, repo_name, commit, kind = "zip", **kwargs):
"""Defines a GitHub commit-based repository rule."""
project = repo_name[repo_name.index("/"):]
http_archive(
name = name,
strip_prefix = "{project}-{commit}".format(project = project, commit = commit),
urls = [u.format(commit = commit, repo_name = repo_name, kind = kind) for u in [
"https://mirror.bazel.build/github.com/{repo_name}/archive/{commit}.{kind}",
"https://github.com/{repo_name}/archive/{commit}.{kind}",
]],
**kwargs
)
def kythe_rule_repositories():
"""Defines external repositories for Kythe Bazel rules.
These repositories must be loaded before calling external.bzl%kythe_dependencies.
"""
maybe(
http_archive,
name = "bazel_skylib",
urls = [
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
],
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
)
maybe(
http_archive,
name = "io_bazel_rules_go",
sha256 = "6f111c57fd50baf5b8ee9d63024874dd2a014b069426156c55adbf6d3d22cb7b",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.25.0/rules_go-v0.25.0.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.25.0/rules_go-v0.25.0.tar.gz",
],
)
maybe(
http_archive,
name = "rules_cc",
sha256 = "29daf0159f0cf552fcff60b49d8bcd4f08f08506d2da6e41b07058ec50cfeaec",
strip_prefix = "rules_cc-b7fe9697c0c76ab2fd431a891dbb9a6a32ed7c3e",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/b7fe9697c0c76ab2fd431a891dbb9a6a32ed7c3e.tar.gz",
"https://github.com/bazelbuild/rules_cc/archive/b7fe9697c0c76ab2fd431a891dbb9a6a32ed7c3e.tar.gz",
],
)
maybe(
http_archive,
name = "rules_java",
url = "https://github.com/bazelbuild/rules_java/archive/973a93dd2d698929264d1028836f6b9cc60ff817.zip",
sha256 = "a6cb0dbe343b67c7d4f3f11a68e327acdfc71fee1e17affa4e605129fc56bb15",
strip_prefix = "rules_java-973a93dd2d698929264d1028836f6b9cc60ff817",
)
maybe(
http_archive,
name = "rules_proto",
sha256 = "e4fe70af52135d2ee592a07f916e6e1fc7c94cf8786c15e8c0d0f08b1fe5ea16",
strip_prefix = "rules_proto-97d8af4dc474595af3900dd85cb3a29ad28cc313",
url = "https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.zip",
)
maybe(
http_archive,
name = "bazel_gazelle",
sha256 = "b85f48fa105c4403326e9525ad2b2cc437babaa6e15a3fc0b1dbab0ab064bc7c",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
],
)
maybe(
http_archive,
name = "build_bazel_rules_nodejs",
sha256 = "dd7ea7efda7655c218ca707f55c3e1b9c68055a70c31a98f264b3445bc8f4cb1",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.2.3/rules_nodejs-3.2.3.tar.gz"],
)
maybe(
http_archive,
name = "rules_jvm_external",
sha256 = "31701ad93dbfe544d597dbe62c9a1fdd76d81d8a9150c2bf1ecf928ecdf97169",
strip_prefix = "rules_jvm_external-4.0",
urls = ["https://github.com/bazelbuild/rules_jvm_external/archive/4.0.zip"],
)
maybe(
http_archive,
name = "rules_python",
sha256 = "e5470e92a18aa51830db99a4d9c492cc613761d5bdb7131c04bd92b9834380f6",
strip_prefix = "rules_python-4b84ad270387a7c439ebdccfd530e2339601ef27",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_python/archive/4b84ad270387a7c439ebdccfd530e2339601ef27.tar.gz",
"https://github.com/bazelbuild/rules_python/archive/4b84ad270387a7c439ebdccfd530e2339601ef27.tar.gz",
],
)
maybe(
http_archive,
name = "rules_rust",
sha256 = "f8c0132ea3855781d41ac574df0ca44959f17694d368c03c7cbaa5f29ef42d8b",
strip_prefix = "rules_rust-5bb12cc451317581452b5441692d57eb4310b839",
urls = [
"https://github.com/bazelbuild/rules_rust/archive/5bb12cc451317581452b5441692d57eb4310b839.tar.gz",
],
)
maybe(
http_archive,
name = "bazelruby_rules_ruby",
strip_prefix = "rules_ruby-0.4.1",
sha256 = "abfc2758cc379e0ff0eb9824e3b507c1633d4c8f99f24735aef63c7180be50f0",
urls = [
"https://github.com/bazelruby/rules_ruby/archive/v0.4.1.zip",
],
patches = [
"@io_kythe//third_party:rules_ruby_allow_empty.patch",
],
patch_args = ["-p1"],
)
maybe(
http_archive,
name = "rules_foreign_cc",
sha256 = "e60cfd0a8426fa4f5fd2156e768493ca62b87d125cb35e94c44e79a3f0d8635f",
strip_prefix = "rules_foreign_cc-0.2.0",
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.2.0.zip",
)
maybe(
http_archive,
name = "llvm-bazel",
patch_args = ["-p2"],
patches = ["@io_kythe//third_party:llvm-bazel-glob.patch"],
sha256 = "1c54ed1c322cb96a64daab8d2d99e0178de17812e2992bf07f53756b13805822",
strip_prefix = "llvm-bazel-e3593b2e6eeb96e3972278073bc35ac8f4ea8f4b/llvm-bazel",
urls = [
"https://github.com/google/llvm-bazel/archive/e3593b2e6eeb96e3972278073bc35ac8f4ea8f4b.zip",
],
)