Ray Milkey | 472d839 | 2018-05-23 17:06:51 -0700 | [diff] [blame] | 1 | GITHUB_BASE_URL = "https://github.com" |
| 2 | |
Ray Milkey | 1bbe461 | 2018-06-15 14:14:39 -0700 | [diff] [blame] | 3 | PI_COMMIT_SHORT = "59c9409" |
| 4 | PI_COMMIT = "59c940916b4f5b182f33b4788d8c410972eaecce" |
Ray Milkey | 472d839 | 2018-05-23 17:06:51 -0700 | [diff] [blame] | 5 | PI_REPO = "p4lang/PI" |
| 6 | |
Ray Milkey | 816db10 | 2018-05-30 14:16:37 -0700 | [diff] [blame] | 7 | GOOGLE_RPC_COMMIT_SHORT = "916e66d" |
| 8 | GOOGLE_RPC_COMMIT = "916e66d03a4f4716937b3bfa6539b9de8a598b7c" |
Ray Milkey | 472d839 | 2018-05-23 17:06:51 -0700 | [diff] [blame] | 9 | GOOGLE_RPC_REPO = "googleapis/googleapis" |
| 10 | |
| 11 | def _format_github_url(repo, commit): |
| 12 | return GITHUB_BASE_URL + "/{0}/tarball/{1}".format(repo, commit) |
| 13 | |
| 14 | def generate_p4lang(): |
| 15 | native.http_archive( |
| 16 | name = "com_google_protobuf", |
| 17 | sha256 = "cef7f1b5a7c5fba672bec2a319246e8feba471f04dcebfe362d55930ee7c1c30", |
| 18 | strip_prefix = "protobuf-3.5.0", |
| 19 | urls = ["https://github.com/google/protobuf/archive/v3.5.0.zip"], |
| 20 | ) |
| 21 | |
| 22 | native.new_http_archive( |
| 23 | name = "p4lang_pi", |
| 24 | urls = [_format_github_url(PI_REPO, PI_COMMIT)], |
| 25 | build_file = "//tools/build/bazel:p4lang_BUILD", |
| 26 | strip_prefix = "p4lang-PI-" + PI_COMMIT_SHORT + "/proto", |
| 27 | type = "tar.gz", |
| 28 | ) |
| 29 | |
| 30 | native.new_http_archive( |
| 31 | name = "google_rpc", |
| 32 | urls = [_format_github_url(GOOGLE_RPC_REPO, GOOGLE_RPC_COMMIT)], |
| 33 | build_file = "//tools/build/bazel:google_RPC_BUILD", |
| 34 | strip_prefix = "googleapis-googleapis-" + GOOGLE_RPC_COMMIT_SHORT, |
| 35 | type = "tar.gz", |
| 36 | ) |