Skip to content

Commit

Permalink
move bats_core BUILD to a file
Browse files Browse the repository at this point in the history
  • Loading branch information
jmelahman authored and filmil committed Nov 24, 2021
1 parent 084e785 commit 335fd7b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
16 changes: 1 addition & 15 deletions deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,13 @@
# https://stackoverflow.com/questions/47192668/idiomatic-retrieval-of-the-bazel-execution-path#
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

BATS_CORE_BUILD="""
sh_library(
name = "bats_lib",
srcs = glob(["libexec/**"]),
)
sh_binary(
name = "bats",
srcs = ["bin/bats"],
deps = [":bats_lib"],
visibility = ["//visibility:public"],
)
"""

def bazel_bats_dependencies(
version="1.5.0",
sha256="36a3fd4413899c0763158ae194329af8f48bb1ff0d1338090b80b3416d5793af",
):
http_archive(
name = "bats_core",
build_file_content = BATS_CORE_BUILD,
build_file = "@//:third_party/BUILD.bats_core",
urls = [
"https://github.com/bats-core/bats-core/archive/refs/tags/v%s.tar.gz" % version,
],
Expand Down
11 changes: 11 additions & 0 deletions third_party/BUILD.bats_core
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sh_library(
name = "bats_lib",
srcs = glob(["libexec/**"]),
)

sh_binary(
name = "bats",
srcs = ["bin/bats"],
deps = [":bats_lib"],
visibility = ["//visibility:public"],
)

0 comments on commit 335fd7b

Please sign in to comment.