|
1 | 1 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
| 2 | +load("//common/private:dmg_archive.bzl", "dmg_archive") |
2 | 3 | load("//common/private:drivers.bzl", "local_drivers")
|
| 4 | +load("//common/private:pkg_archive.bzl", "pkg_archive") |
| 5 | + |
| 6 | +_edge_version = "89.0.713.0" |
| 7 | + |
| 8 | +_versions = { |
| 9 | + # The chrome version number is found by visiting http://omahaproxy.appspot.com, |
| 10 | + # looking for the current stable version for any platform, and using the "lookup" |
| 11 | + # feature to find out "Version information". The "Branch Base Position" gives you |
| 12 | + # the version. |
| 13 | + # 800218 = 86.0.4240.198 |
| 14 | + "chrome": { |
| 15 | + "linux": { |
| 16 | + "url": "https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/800218/chrome-linux.zip", |
| 17 | + "sha256": "01140ec2c7f397023541f65ecd26cf8c5b9a59af90c887dbf7c3ee0344870077", |
| 18 | + }, |
| 19 | + "mac": { |
| 20 | + "url": "https://storage.googleapis.com/chromium-browser-snapshots/Mac/800218/chrome-mac.zip", |
| 21 | + "sha256": "2e0a534510dba96a4e52effb31bede2cababc9328e624c8c538867f8e71b6292", |
| 22 | + }, |
| 23 | + "windows": { |
| 24 | + "url": "https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/800218/chrome-win.zip", |
| 25 | + "sha256": None, |
| 26 | + }, |
| 27 | + }, |
| 28 | + # Versions found by visiting https://chromedriver.chromium.org/downloads |
| 29 | + "chromedriver": { |
| 30 | + "linux": { |
| 31 | + "url": "https://chromedriver.storage.googleapis.com/86.0.4240.22/chromedriver_linux64.zip", |
| 32 | + "sha256": "d498eaacc414adbaf638333b59390cdfea5d780f941f57f41fd90280df78b159", |
| 33 | + }, |
| 34 | + "mac": { |
| 35 | + "url": "https://chromedriver.storage.googleapis.com/86.0.4240.22/chromedriver_mac64.zip", |
| 36 | + "sha256": "351ae30e9feab7ca6ccb94a549afcd62d6355561b78b8386cd4271d480a2fdc6", |
| 37 | + }, |
| 38 | + "windows": { |
| 39 | + "url": "https://chromedriver.storage.googleapis.com/86.0.4240.22/chromedriver_win32.zip", |
| 40 | + "sha256": None, |
| 41 | + }, |
| 42 | + }, |
| 43 | + # Ultimately, this will is determined by visiting https://www.microsoft.com/en-us/edge |
| 44 | + "edge": { |
| 45 | + "linux": { |
| 46 | + "url": None, |
| 47 | + "sha256": None, |
| 48 | + }, |
| 49 | + "mac": { |
| 50 | + "url": "https://officecdn-microsoft-com.akamaized.net/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/MicrosoftEdgeCanary-89.0.713.0.pkg?platform=Mac&Consent=0&channel=Canary", |
| 51 | + "sha256": "25dfe56b00d5f0af1f9d7ed3d84442fd9d783aa2abe1be93c9ea8e7088f5e5c6", |
| 52 | + }, |
| 53 | + "windows": { |
| 54 | + "url": None, |
| 55 | + "sha256": None, |
| 56 | + }, |
| 57 | + }, |
| 58 | + # Versions found by visiting https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ |
| 59 | + "edgedriver": { |
| 60 | + "linux": { |
| 61 | + "url": None, |
| 62 | + "sha256": "d498eaacc414adbaf638333b59390cdfea5d780f941f57f41fd90280df78b159", |
| 63 | + }, |
| 64 | + "mac": { |
| 65 | + "url": "https://msedgedriver.azureedge.net/%s/edgedriver_mac64.zip" % _edge_version, |
| 66 | + "sha256": "0282fa65d7f303f59fc4f8001b3d1ce25a44b0394a449f18291f68b6d0f9e691", |
| 67 | + }, |
| 68 | + "windows": { |
| 69 | + "url": "https://msedgedriver.azureedge.net/87.0.669.0/edgedriver_win64.zip", |
| 70 | + "sha256": None, |
| 71 | + }, |
| 72 | + }, |
| 73 | + # Versions found by visiting https://ftp.mozilla.org/pub/firefox/releases/ |
| 74 | + "firefox": { |
| 75 | + "linux": { |
| 76 | + "url": "https://ftp.mozilla.org/pub/firefox/releases/83.0/linux-x86_64/en-US/firefox-83.0.tar.bz2", |
| 77 | + "sha256": "93ff827fdcba92ddb71851c46ac8192a727ed61402e896c6262943e382f92412", |
| 78 | + }, |
| 79 | + "mac": { |
| 80 | + "url": "https://ftp.mozilla.org/pub/firefox/releases/83.0/mac/en-US/Firefox%2083.0.dmg", |
| 81 | + "sha256": "7e527884e40039c6c97929591754b92394aa965fd61d42158fea5df075636ec6", |
| 82 | + }, |
| 83 | + "windows": { |
| 84 | + "url": None, |
| 85 | + "sha256": None, |
| 86 | + }, |
| 87 | + }, |
| 88 | + # Versions found by visiting https://github.com/mozilla/geckodriver/releases |
| 89 | + "geckodriver": { |
| 90 | + "linux": { |
| 91 | + "url": "https://github.com/mozilla/geckodriver/releases/download/v0.28.0/geckodriver-v0.28.0-linux64.tar.gz", |
| 92 | + "sha256": "61bfc547a623d7305256611a81ecd24e6bf9dac555529ed6baeafcf8160900da", |
| 93 | + }, |
| 94 | + "mac": { |
| 95 | + "url": "https://github.com/mozilla/geckodriver/releases/download/v0.28.0/geckodriver-v0.28.0-macos.tar.gz", |
| 96 | + "sha256": "c288ff6db39adfd5eea0e25b4c3e71bfd9fb383eccf521cdd65f67ea78eb1761", |
| 97 | + }, |
| 98 | + "windows": { |
| 99 | + "url": None, |
| 100 | + "sha256": None, |
| 101 | + }, |
| 102 | + }, |
| 103 | +} |
| 104 | + |
| 105 | +def _chrome(): |
| 106 | + http_archive( |
| 107 | + name = "linux_chromedriver", |
| 108 | + url = _versions["chromedriver"]["linux"]["url"], |
| 109 | + sha256 = _versions["chromedriver"]["linux"]["sha256"], |
| 110 | + build_file_content = "exports_files([\"chromedriver\"])", |
| 111 | + ) |
| 112 | + |
| 113 | + http_archive( |
| 114 | + name = "linux_chrome", |
| 115 | + url = _versions["chrome"]["linux"]["url"], |
| 116 | + sha256 = _versions["chrome"]["linux"]["sha256"], |
| 117 | + build_file_content = "exports_files([\"chrome\"])", |
| 118 | + ) |
| 119 | + |
| 120 | + http_archive( |
| 121 | + name = "mac_chromedriver", |
| 122 | + url = _versions["chromedriver"]["mac"]["url"], |
| 123 | + sha256 = _versions["chromedriver"]["mac"]["sha256"], |
| 124 | + build_file_content = "exports_files([\"chromedriver\"])", |
| 125 | + ) |
| 126 | + |
| 127 | + http_archive( |
| 128 | + name = "mac_chrome", |
| 129 | + url = _versions["chrome"]["mac"]["url"], |
| 130 | + sha256 = _versions["chrome"]["mac"]["sha256"], |
| 131 | + strip_prefix = "chrome-mac", |
| 132 | + build_file_content = "exports_files([\"Chromium.app\"])", |
| 133 | + ) |
| 134 | + |
| 135 | +def _edge(): |
| 136 | + http_archive( |
| 137 | + name = "mac_edgedriver", |
| 138 | + url = _versions["edgedriver"]["mac"]["url"], |
| 139 | + sha256 = _versions["edgedriver"]["mac"]["sha256"], |
| 140 | + build_file_content = "exports_files([\"msedgedriver\"])", |
| 141 | + ) |
| 142 | + |
| 143 | + pkg_archive( |
| 144 | + name = "mac_edge", |
| 145 | + url = _versions["edge"]["mac"]["url"], |
| 146 | + sha256 = _versions["edge"]["mac"]["sha256"], |
| 147 | + move = { |
| 148 | + "MicrosoftEdgeCanary-%s.pkg/Payload/Microsoft Edge Canary.app" % _edge_version: "Edge.app", |
| 149 | + }, |
| 150 | + build_file_content = "exports_files([\"Edge.app\"])", |
| 151 | + ) |
| 152 | + |
| 153 | +def _firefox(): |
| 154 | + http_archive( |
| 155 | + name = "linux_geckodriver", |
| 156 | + url = _versions["geckodriver"]["linux"]["url"], |
| 157 | + sha256 = _versions["geckodriver"]["linux"]["sha256"], |
| 158 | + build_file_content = "exports_files([\"geckodriver\"])", |
| 159 | + ) |
| 160 | + |
| 161 | + http_archive( |
| 162 | + name = "linux_firefox", |
| 163 | + url = _versions["firefox"]["linux"]["url"], |
| 164 | + sha256 = _versions["firefox"]["linux"]["sha256"], |
| 165 | + build_file_content = "exports_files([\"firefox\"])", |
| 166 | + ) |
| 167 | + |
| 168 | + http_archive( |
| 169 | + name = "mac_geckodriver", |
| 170 | + url = _versions["geckodriver"]["mac"]["url"], |
| 171 | + sha256 = _versions["geckodriver"]["mac"]["sha256"], |
| 172 | + build_file_content = "exports_files([\"geckodriver\"])", |
| 173 | + ) |
| 174 | + |
| 175 | + dmg_archive( |
| 176 | + name = "mac_firefox", |
| 177 | + url = _versions["firefox"]["mac"]["url"], |
| 178 | + sha256 = _versions["firefox"]["mac"]["sha256"], |
| 179 | + build_file_content = "exports_files([\"Firefox.app\"])", |
| 180 | + ) |
| 181 | + |
| 182 | + # TODO: figure out how to unpack the firefox exe on Windows |
| 183 | +# http_archive( |
| 184 | +# name = "windows_geckodriver", |
| 185 | +# url = "https://github.com/mozilla/geckodriver/releases/download/v0.28.0/geckodriver-v0.28.0-win64.zip", |
| 186 | +# sha256 = "49f991b4f25565a5b7008936698f189debc755e6023789adba0c7440b6c960ac", |
| 187 | +# build_file_content = "alias(name = \"geckodriver\", actual = \"geckodriver.exe\", visibility = [\"//visibility:public\"])", |
| 188 | +# ) |
| 189 | +# |
| 190 | +# |
| 191 | +# http_archive( |
| 192 | +# name = "windows_firefox", |
| 193 | +# url = "https://ftp.mozilla.org/pub/firefox/releases/83.0/win64/en-US/Firefox%20Setup%2083.0.exe", |
| 194 | +# |
| 195 | +# ) |
3 | 196 |
|
4 | 197 | def pin_browsers():
|
5 | 198 | local_drivers()
|
6 |
| - |
| 199 | + _chrome() |
| 200 | + _edge() |
| 201 | + _firefox() |
0 commit comments