Skip to content

Commit

Permalink
iox-#2325 add bazel script for buildifier prebuilt
Browse files Browse the repository at this point in the history
Signed-off-by: wep21 <[email protected]>
  • Loading branch information
wep21 committed Aug 28, 2024
1 parent 2616c1a commit 69cb498
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 6 deletions.
Empty file.
28 changes: 28 additions & 0 deletions bazel/buildifier_prebuilt/repositories.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

BAZEL_SKYLIB_VERSION = "1.7.1"

def load_bazel_skylib_repositories():
maybe(
name = "bazel_skylib",
repo_rule = http_archive,
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = BAZEL_SKYLIB_VERSION),
"https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = BAZEL_SKYLIB_VERSION),
],
)

BUILDIFIER_PREBUILT_VERSION = "7.3.1"

def load_buildifier_prebuilt_repositories():
maybe(
name = "buildifier_prebuilt",
repo_rule = http_archive,
sha256 = "7f85b688a4b558e2d9099340cfb510ba7179f829454fba842370bccffb67d6cc",
strip_prefix = "buildifier-prebuilt-{version}".format(version = BUILDIFIER_PREBUILT_VERSION),
urls = [
"http://github.com/keith/buildifier-prebuilt/archive/{version}.tar.gz".format(version = BUILDIFIER_PREBUILT_VERSION),
],
)
10 changes: 10 additions & 0 deletions bazel/buildifier_prebuilt/setup.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@buildifier_prebuilt//:deps.bzl", "buildifier_prebuilt_deps")
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
load("@buildifier_prebuilt//:defs.bzl", "buildifier_prebuilt_register_toolchains")

def setup_buildifier_prebuilt():
buildifier_prebuilt_deps()

bazel_skylib_workspace()

buildifier_prebuilt_register_toolchains()
8 changes: 4 additions & 4 deletions bazel/load_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ limitations under the License.
SPDX-License-Identifier: Apache-2.0
"""

load("//bazel/bazelbuild:repositories.bzl", "load_com_github_bazelbuild_buildtools_repositories", "load_com_github_bazelbuild_rules_cc_repositories", "load_com_google_protobuf_repositories", "load_io_bazel_rules_go_repositories")
load("//bazel/bazelbuild:repositories.bzl", "load_com_github_bazelbuild_rules_cc_repositories")
load("//bazel/buildifier_prebuilt:repositories.bzl", "load_buildifier_prebuilt_repositories", "load_bazel_skylib_repositories")
load("//bazel/cpptoml:repositories.bzl", "load_cpptoml_repositories")
load("//bazel/googletest:repositories.bzl", "load_googletest_repositories")

Expand All @@ -25,8 +26,7 @@ def load_repositories():
Loads repositories for iceoryx dependencies
"""
load_com_github_bazelbuild_rules_cc_repositories()
load_io_bazel_rules_go_repositories()
load_com_google_protobuf_repositories()
load_com_github_bazelbuild_buildtools_repositories()
load_bazel_skylib_repositories()
load_buildifier_prebuilt_repositories()
load_googletest_repositories()
load_cpptoml_repositories()
4 changes: 2 additions & 2 deletions bazel/setup_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ limitations under the License.
SPDX-License-Identifier: Apache-2.0
"""

load("//bazel/bazelbuild:setup.bzl", "setup_go_protobuf_for_bazelbuild")
load("//bazel/buildifier_prebuilt:setup.bzl", "setup_buildifier_prebuilt")

def setup_repositories():
"""
Loads repositories for iceoryx dependencies
"""
setup_go_protobuf_for_bazelbuild()
setup_buildifier_prebuilt()

0 comments on commit 69cb498

Please sign in to comment.