Skip to content

Commit

Permalink
feat: add is_bazel_7_or_greater utility (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Jan 8, 2024
1 parent 61f8312 commit bf7131f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
6 changes: 2 additions & 4 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@buildifier_prebuilt//:rules.bzl", "buildifier")
load("//lib:diff_test.bzl", "diff_test")
load("//lib:testing.bzl", "assert_contains")
load("//lib:utils.bzl", "is_bazel_7_or_greater")
load("//lib:write_source_files.bzl", "write_source_files")
load("//lib:yq.bzl", "yq")

# buildifier: disable=bzl-visibility
load("//lib/private:utils.bzl", "utils")

# gazelle:prefix github.com/aspect-build/bazel-lib

gazelle_binary(
Expand Down Expand Up @@ -67,7 +65,7 @@ bzl_library(
deps = [
"@bazel_tools//tools/build_defs/repo:http.bzl",
"@bazel_tools//tools/build_defs/repo:utils.bzl",
] + (["@bazel_tools//tools/build_defs/repo:cache.bzl"] if utils.is_bazel_7_or_greater() else []),
] + (["@bazel_tools//tools/build_defs/repo:cache.bzl"] if is_bazel_7_or_greater() else []),
)

# write_source_files() to a git ignored subdirectory of the root
Expand Down
38 changes: 38 additions & 0 deletions docs/utils.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ default_timeout = utils.default_timeout
file_exists = utils.file_exists
glob_directories = utils.glob_directories
is_bazel_6_or_greater = utils.is_bazel_6_or_greater
is_bazel_7_or_greater = utils.is_bazel_7_or_greater
is_bzlmod_enabled = utils.is_bzlmod_enabled
is_external_label = utils.is_external_label
maybe_http_archive = utils.maybe_http_archive
Expand Down

0 comments on commit bf7131f

Please sign in to comment.