Chris Frantz | 831c08b | 2022-05-11 15:43:41 -0700 | [diff] [blame] | 1 | # Copyright lowRISC contributors. |
2 | # Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||||
3 | # SPDX-License-Identifier: Apache-2.0 | ||||
4 | |||||
5 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||||
6 | |||||
7 | def http_archive_or_local(**kwargs): | ||||
8 | local = kwargs.pop("local", None) | ||||
9 | if local: | ||||
10 | native.local_repository( | ||||
11 | name = kwargs.get("name"), | ||||
12 | path = local, | ||||
13 | ) | ||||
14 | else: | ||||
15 | http_archive(**kwargs) |