Skip to content

Commit

Permalink
prefer http_archive to git_repository or new_git_repository
Browse files Browse the repository at this point in the history
  • Loading branch information
jmelahman authored and filmil committed Nov 24, 2021
1 parent 4e71c90 commit 2be16d8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ workspace(name = "bazel_bats")

load("@bazel_bats//:deps.bzl", "bazel_bats_dependencies")

bazel_bats_dependencies(version="v1.5.0")
bazel_bats_dependencies()
16 changes: 11 additions & 5 deletions deps.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# From:
# https://stackoverflow.com/questions/47192668/idiomatic-retrieval-of-the-bazel-execution-path#
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

BATS_CORE_BUILD="""
sh_library(
Expand All @@ -16,10 +16,16 @@ sh_binary(
)
"""

def bazel_bats_dependencies(version="v1.5.0"):
new_git_repository(
def bazel_bats_dependencies(
version="1.5.0",
sha256="36a3fd4413899c0763158ae194329af8f48bb1ff0d1338090b80b3416d5793af",
):
http_archive(
name = "bats_core",
remote = "https://github.com/bats-core/bats-core",
tag = version,
build_file_content = BATS_CORE_BUILD,
urls = [
"https://github.com/bats-core/bats-core/archive/refs/tags/v%s.tar.gz" % version,
],
strip_prefix = "bats-core-%s" % version,
sha256 = sha256,
)

0 comments on commit 2be16d8

Please sign in to comment.