Rob Mohr | be98ead | 2019-11-14 07:16:40 -0800 | [diff] [blame] | 1 | # Copyright 2019 The Pigweed Authors |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 | # use this file except in compliance with the License. You may obtain a copy of |
| 5 | # the License at |
| 6 | # |
| 7 | # https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations under |
| 13 | # the License. |
Matthew Soulanille | 376d797 | 2020-06-01 15:50:07 -0700 | [diff] [blame] | 14 | |
| 15 | workspace( |
| 16 | name = "pigweed", |
| 17 | managed_directories = {"@npm": ["node_modules"]}, |
| 18 | ) |
| 19 | |
| 20 | # Set up build_bazel_rules_nodejs |
| 21 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 22 | http_archive( |
| 23 | name = "build_bazel_rules_nodejs", |
Matthew Soulanille | 83c8282 | 2020-09-10 10:59:50 -0700 | [diff] [blame] | 24 | sha256 = "4952ef879704ab4ad6729a29007e7094aef213ea79e9f2e94cbe1c9a753e63ef", |
| 25 | urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/2.2.0/rules_nodejs-2.2.0.tar.gz"], |
Matthew Soulanille | 376d797 | 2020-06-01 15:50:07 -0700 | [diff] [blame] | 26 | ) |
Matthew Soulanille | 5e78acf | 2020-06-08 10:58:29 -0700 | [diff] [blame] | 27 | # Get the latest LTS version of Node |
Matthew Soulanille | 376d797 | 2020-06-01 15:50:07 -0700 | [diff] [blame] | 28 | load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories") |
Matthew Soulanille | 376d797 | 2020-06-01 15:50:07 -0700 | [diff] [blame] | 29 | node_repositories(package_json = ["//:package.json"]) |
| 30 | |
| 31 | # Install packages with yarn |
| 32 | load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") |
| 33 | yarn_install( |
| 34 | name = "npm", |
| 35 | package_json = "//:package.json", |
| 36 | yarn_lock = "//:yarn.lock", |
| 37 | ) |
| 38 | |
Matthew Soulanille | 5e78acf | 2020-06-08 10:58:29 -0700 | [diff] [blame] | 39 | # Set up Karma |
Matthew Soulanille | 83c8282 | 2020-09-10 10:59:50 -0700 | [diff] [blame] | 40 | load("@npm//@bazel/karma:package.bzl", "npm_bazel_karma_dependencies") |
Matthew Soulanille | 5e78acf | 2020-06-08 10:58:29 -0700 | [diff] [blame] | 41 | npm_bazel_karma_dependencies() |
| 42 | |
| 43 | load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") |
| 44 | web_test_repositories() |
| 45 | |
| 46 | load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories") |
| 47 | |
| 48 | browser_repositories( |
| 49 | chromium = True, |
| 50 | firefox = True, |
| 51 | ) |
| 52 | |