repositories.bzl 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
  2. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
  3. load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
  4. MAVEN_SERVER_URLS = ["https://repo.maven.apache.org/maven2"]
  5. def pgv_dependencies():
  6. if not native.existing_rule("io_bazel_rules_go"):
  7. http_archive(
  8. name = "io_bazel_rules_go",
  9. sha256 = "6f111c57fd50baf5b8ee9d63024874dd2a014b069426156c55adbf6d3d22cb7b",
  10. urls = [
  11. "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.25.0/rules_go-v0.25.0.tar.gz",
  12. "https://github.com/bazelbuild/rules_go/releases/download/v0.25.0/rules_go-v0.25.0.tar.gz",
  13. ],
  14. )
  15. if not native.existing_rule("bazel_gazelle"):
  16. http_archive(
  17. name = "bazel_gazelle",
  18. sha256 = "b85f48fa105c4403326e9525ad2b2cc437babaa6e15a3fc0b1dbab0ab064bc7c",
  19. urls = [
  20. "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
  21. "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
  22. ],
  23. )
  24. if not native.existing_rule("com_google_protobuf"):
  25. http_archive(
  26. name = "com_google_protobuf",
  27. url = "https://github.com/protocolbuffers/protobuf/archive/v3.14.0.tar.gz",
  28. sha256 = "d0f5f605d0d656007ce6c8b5a82df3037e1d8fe8b121ed42e536f569dec16113",
  29. strip_prefix = "protobuf-3.14.0",
  30. )
  31. # TODO(akonradi): This shouldn't be necesary since the same http_archive block is imported by
  32. # protobuf_deps from @com_google_protobuf. Investigate why.
  33. if not native.existing_rule("zlib"):
  34. http_archive(
  35. name = "zlib",
  36. build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
  37. sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
  38. strip_prefix = "zlib-1.2.11",
  39. urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
  40. )
  41. if not native.existing_rule("bazel_skylib"):
  42. http_archive(
  43. name = "bazel_skylib",
  44. sha256 = "e5d90f0ec952883d56747b7604e2a15ee36e288bb556c3d0ed33e818a4d971f2",
  45. strip_prefix = "bazel-skylib-1.0.2",
  46. urls = ["https://github.com/bazelbuild/bazel-skylib/archive/1.0.2.tar.gz"],
  47. )
  48. if not native.existing_rule("six"):
  49. http_archive(
  50. name = "six",
  51. build_file = "@com_google_protobuf//:third_party/six.BUILD",
  52. sha256 = "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73",
  53. urls = ["https://pypi.python.org/packages/source/s/six/six-1.12.0.tar.gz"],
  54. )
  55. if not native.existing_rule("com_google_re2j"):
  56. jvm_maven_import_external(
  57. name = "com_google_re2j",
  58. artifact = "com.google.re2j:re2j:1.2",
  59. artifact_sha256 = "e9dc705fd4c570344b54a7146b2e3a819cdc271a29793f4acc1a93b56a388e59",
  60. server_urls = MAVEN_SERVER_URLS,
  61. )
  62. if not native.existing_rule("com_googlesource_code_re2"):
  63. http_archive(
  64. name = "com_googlesource_code_re2",
  65. sha256 = "2e9489a31ae007c81e90e8ec8a15d62d58a9c18d4fd1603f6441ef248556b41f",
  66. strip_prefix = "re2-2020-07-06",
  67. urls = ["https://github.com/google/re2/archive/2020-07-06.tar.gz"],
  68. )
  69. if not native.existing_rule("com_google_guava"):
  70. jvm_maven_import_external(
  71. name = "com_google_guava",
  72. artifact = "com.google.guava:guava:27.0-jre",
  73. artifact_sha256 = "63b09db6861011e7fb2481be7790c7fd4b03f0bb884b3de2ecba8823ad19bf3f",
  74. server_urls = MAVEN_SERVER_URLS,
  75. )
  76. if not native.existing_rule("guava"):
  77. native.bind(
  78. name = "guava",
  79. actual = "@com_google_guava//jar",
  80. )
  81. if not native.existing_rule("com_google_gson"):
  82. jvm_maven_import_external(
  83. name = "com_google_gson",
  84. artifact = "com.google.code.gson:gson:2.8.5",
  85. artifact_sha256 = "233a0149fc365c9f6edbd683cfe266b19bdc773be98eabdaf6b3c924b48e7d81",
  86. server_urls = MAVEN_SERVER_URLS,
  87. )
  88. if not native.existing_rule("gson"):
  89. native.bind(
  90. name = "gson",
  91. actual = "@com_google_gson//jar",
  92. )
  93. if not native.existing_rule("error_prone_annotations_maven"):
  94. jvm_maven_import_external(
  95. name = "error_prone_annotations_maven",
  96. artifact = "com.google.errorprone:error_prone_annotations:2.3.2",
  97. artifact_sha256 = "357cd6cfb067c969226c442451502aee13800a24e950fdfde77bcdb4565a668d",
  98. server_urls = MAVEN_SERVER_URLS,
  99. )
  100. if not native.existing_rule("error_prone_annotations"):
  101. native.bind(
  102. name = "error_prone_annotations",
  103. actual = "@error_prone_annotations_maven//jar",
  104. )
  105. if not native.existing_rule("org_apache_commons_validator"):
  106. jvm_maven_import_external(
  107. name = "org_apache_commons_validator",
  108. artifact = "commons-validator:commons-validator:1.6",
  109. artifact_sha256 = "bd62795d7068a69cbea333f6dbf9c9c1a6ad7521443fb57202a44874f240ba25",
  110. server_urls = MAVEN_SERVER_URLS,
  111. )
  112. if not native.existing_rule("rules_python"):
  113. http_archive(
  114. name = "rules_python",
  115. url = "https://github.com/bazelbuild/rules_python/releases/download/0.1.0/rules_python-0.1.0.tar.gz",
  116. sha256 = "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0",
  117. )
  118. if not native.existing_rule("rules_proto"):
  119. http_archive(
  120. name = "rules_proto",
  121. sha256 = "2490dca4f249b8a9a3ab07bd1ba6eca085aaf8e45a734af92aad0c42d9dc7aaf",
  122. strip_prefix = "rules_proto-218ffa7dfa5408492dc86c01ee637614f8695c45",
  123. urls = ["https://github.com/bazelbuild/rules_proto/archive/218ffa7dfa5408492dc86c01ee637614f8695c45.tar.gz"],
  124. )