-
Notifications
You must be signed in to change notification settings - Fork 14
/
deps.bzl
35 lines (27 loc) · 1.35 KB
/
deps.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Copyright Jay Conrod. All rights reserved.
# This file is part of rules_go_simple. Use of this source code is governed by
# the 3-clause BSD license that can be found in the LICENSE.txt file.
"""Macro for declaring repository dependencies."""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("//internal:repo.bzl", _go_download = "go_download")
go_download = _go_download
def go_rules_dependencies():
"""Declares external repositories that rules_go_simple depends on.
This function should be loaded and called from WORKSPACE of any project
that uses rules_go_simple.
"""
# bazel_skylib is a set of libraries that are useful for writing
# Bazel rules. We use it to handle quoting arguments in shell commands.
_maybe(
http_archive,
name = "bazel_skylib",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
],
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
)
def _maybe(rule, name, **kwargs):
"""Declares an external repository if it hasn't been declared already."""
if name not in native.existing_rules():
rule(name = name, **kwargs)