blob: 9f53c87741ca47bf28704c3ab9a940cd01e50417 [file] [log] [blame]
Rob Mohrbe98ead2019-11-14 07:16:40 -08001# 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 Soulanille376d7972020-06-01 15:50:07 -070014
15workspace(
16 name = "pigweed",
17 managed_directories = {"@npm": ["node_modules"]},
18)
19
20# Set up build_bazel_rules_nodejs
21load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
22http_archive(
23 name = "build_bazel_rules_nodejs",
Matthew Soulanille83c82822020-09-10 10:59:50 -070024 sha256 = "4952ef879704ab4ad6729a29007e7094aef213ea79e9f2e94cbe1c9a753e63ef",
25 urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/2.2.0/rules_nodejs-2.2.0.tar.gz"],
Matthew Soulanille376d7972020-06-01 15:50:07 -070026)
Matthew Soulanille5e78acf2020-06-08 10:58:29 -070027# Get the latest LTS version of Node
Matthew Soulanille376d7972020-06-01 15:50:07 -070028load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories")
Matthew Soulanille376d7972020-06-01 15:50:07 -070029node_repositories(package_json = ["//:package.json"])
30
31# Install packages with yarn
32load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
33yarn_install(
34 name = "npm",
35 package_json = "//:package.json",
36 yarn_lock = "//:yarn.lock",
37)
38
Matthew Soulanille5e78acf2020-06-08 10:58:29 -070039# Set up Karma
Matthew Soulanille83c82822020-09-10 10:59:50 -070040load("@npm//@bazel/karma:package.bzl", "npm_bazel_karma_dependencies")
Matthew Soulanille5e78acf2020-06-08 10:58:29 -070041npm_bazel_karma_dependencies()
42
43load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")
44web_test_repositories()
45
46load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")
47
48browser_repositories(
49 chromium = True,
50 firefox = True,
51)
52