|
| 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 | + |
| 4 | +def _include_if_not_defined(repo_rule, name, **kwargs): |
| 5 | + if name not in native.existing_rules(): |
| 6 | + repo_rule(name = name, **kwargs) |
| 7 | + |
| 8 | +JINJA2_BUILD_FILE = """ |
| 9 | +py_library( |
| 10 | + name = "jinja2", |
| 11 | + srcs = glob(["jinja2/*.py"]), |
| 12 | + srcs_version = "PY2AND3", |
| 13 | + deps = [ |
| 14 | + "@markupsafe_archive//:markupsafe", |
| 15 | + ], |
| 16 | + visibility = ["//visibility:public"], |
| 17 | +) |
| 18 | +""" |
| 19 | + |
| 20 | +MARKUPSAFE_BUILD_FILE = """ |
| 21 | +py_library( |
| 22 | + name = "markupsafe", |
| 23 | + srcs = glob(["markupsafe/*.py"]), |
| 24 | + srcs_version = "PY2AND3", |
| 25 | + visibility = ["//visibility:public"], |
| 26 | +) |
| 27 | +""" |
| 28 | + |
| 29 | +MISTUNE_BUILD_FILE = """ |
| 30 | +py_library( |
| 31 | + name = "mistune", |
| 32 | + srcs = ["mistune.py"], |
| 33 | + srcs_version = "PY2AND3", |
| 34 | + visibility = ["//visibility:public"], |
| 35 | +) |
| 36 | +""" |
| 37 | + |
| 38 | +SIX_BUILD_FILE = """ |
| 39 | +py_library( |
| 40 | + name = "six", |
| 41 | + srcs = ["six.py"], |
| 42 | + srcs_version = "PY2AND3", |
| 43 | + visibility = ["//visibility:public"], |
| 44 | +) |
| 45 | +""" |
| 46 | + |
| 47 | +def skydoc_repositories(): |
| 48 | + """Adds the external repositories used by the skylark rules.""" |
| 49 | + _include_if_not_defined( |
| 50 | + git_repository, |
| 51 | + name = "bazel_skylib", |
| 52 | + remote = "https://github.com/bazelbuild/bazel-skylib.git", |
| 53 | + tag = "0.6.0", |
| 54 | + ) |
| 55 | + _include_if_not_defined( |
| 56 | + git_repository, |
| 57 | + name = "io_bazel_rules_sass", |
| 58 | + remote = "https://github.com/bazelbuild/rules_sass.git", |
| 59 | + tag = "1.15.1", |
| 60 | + ) |
| 61 | + _include_if_not_defined( |
| 62 | + git_repository, |
| 63 | + name = "io_bazel_rules_sass", |
| 64 | + remote = "https://github.com/bazelbuild/rules_sass.git", |
| 65 | + tag = "1.15.1", |
| 66 | + ) |
| 67 | + _include_if_not_defined( |
| 68 | + git_repository, |
| 69 | + name = "io_bazel", |
| 70 | + remote = "https://github.com/bazelbuild/bazel.git", |
| 71 | + # TODO: Update to a newer tagged version when available. |
| 72 | + commit = "e7ebb7e68d35ae090d91fe6b4c92c1c831421faa", # 2018-11-26 |
| 73 | + ) |
| 74 | + _include_if_not_defined( |
| 75 | + git_repository, |
| 76 | + name = "com_google_protobuf", |
| 77 | + remote = "https://github.com/protocolbuffers/protobuf.git", |
| 78 | + # Latest tagged version at time of writing is v3.6.1, which doesn't |
| 79 | + # include fixes for --incompatible_package_name_is_a_function, |
| 80 | + # --incompatible_new_actions_api, and possibly others. |
| 81 | + # TODO: Update to a newer tagged version when available. |
| 82 | + commit = "7b28271a61a3da0a37f6fda399b0c4c86464e5b3", # 2018-11-16 |
| 83 | + ) |
| 84 | + _include_if_not_defined( |
| 85 | + git_repository, |
| 86 | + name = "io_bazel_rules_sass", |
| 87 | + remote = "https://github.com/bazelbuild/rules_sass.git", |
| 88 | + tag = "1.15.1", |
| 89 | + ) |
| 90 | + |
| 91 | + _include_if_not_defined( |
| 92 | + http_archive, |
| 93 | + name = "markupsafe_archive", |
| 94 | + urls = ["https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.23.tar.gz#md5=f5ab3deee4c37cd6a922fb81e730da6e"], |
| 95 | + sha256 = "a4ec1aff59b95a14b45eb2e23761a0179e98319da5a7eb76b56ea8cdc7b871c3", |
| 96 | + build_file_content = MARKUPSAFE_BUILD_FILE, |
| 97 | + strip_prefix = "MarkupSafe-0.23", |
| 98 | + ) |
| 99 | + native.bind( |
| 100 | + name = "markupsafe", |
| 101 | + actual = "@markupsafe_archive//:markupsafe", |
| 102 | + ) |
| 103 | + |
| 104 | + _include_if_not_defined( |
| 105 | + http_archive, |
| 106 | + name = "jinja2_archive", |
| 107 | + urls = ["https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.8.tar.gz#md5=edb51693fe22c53cee5403775c71a99e"], |
| 108 | + sha256 = "bc1ff2ff88dbfacefde4ddde471d1417d3b304e8df103a7a9437d47269201bf4", |
| 109 | + build_file_content = JINJA2_BUILD_FILE, |
| 110 | + strip_prefix = "Jinja2-2.8", |
| 111 | + ) |
| 112 | + native.bind( |
| 113 | + name = "jinja2", |
| 114 | + actual = "@jinja2_archive//:jinja2", |
| 115 | + ) |
| 116 | + |
| 117 | + _include_if_not_defined( |
| 118 | + http_archive, |
| 119 | + name = "mistune_archive", |
| 120 | + urls = ["https://pypi.python.org/packages/source/m/mistune/mistune-0.7.1.tar.gz#md5=057bc28bf629d6a1283d680a34ed9d0f"], |
| 121 | + sha256 = "6076dedf768348927d991f4371e5a799c6a0158b16091df08ee85ee231d929a7", |
| 122 | + build_file_content = MISTUNE_BUILD_FILE, |
| 123 | + strip_prefix = "mistune-0.7.1", |
| 124 | + ) |
| 125 | + native.bind( |
| 126 | + name = "mistune", |
| 127 | + actual = "@mistune_archive//:mistune", |
| 128 | + ) |
| 129 | + |
| 130 | + _include_if_not_defined( |
| 131 | + http_archive, |
| 132 | + name = "six_archive", |
| 133 | + urls = ["https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz#md5=34eed507548117b2ab523ab14b2f8b55"], |
| 134 | + sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a", |
| 135 | + build_file_content = SIX_BUILD_FILE, |
| 136 | + strip_prefix = "six-1.10.0", |
| 137 | + ) |
| 138 | + native.bind( |
| 139 | + name = "six", |
| 140 | + actual = "@six_archive//:six", |
| 141 | + ) |
0 commit comments