diff --git a/bazel/buildifier_prebuilt/BUILD.bazel b/bazel/buildifier_prebuilt/BUILD.bazel new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bazel/buildifier_prebuilt/repositories.bzl b/bazel/buildifier_prebuilt/repositories.bzl new file mode 100644 index 0000000000..abc4ca86ca --- /dev/null +++ b/bazel/buildifier_prebuilt/repositories.bzl @@ -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), + ], + ) \ No newline at end of file diff --git a/bazel/buildifier_prebuilt/setup.bzl b/bazel/buildifier_prebuilt/setup.bzl new file mode 100644 index 0000000000..042bee44b9 --- /dev/null +++ b/bazel/buildifier_prebuilt/setup.bzl @@ -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() \ No newline at end of file diff --git a/bazel/load_repositories.bzl b/bazel/load_repositories.bzl index b258c85353..2520e4e3ca 100644 --- a/bazel/load_repositories.bzl +++ b/bazel/load_repositories.bzl @@ -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") @@ -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() diff --git a/bazel/setup_repositories.bzl b/bazel/setup_repositories.bzl index 7dc1e3cab6..e85213cc83 100644 --- a/bazel/setup_repositories.bzl +++ b/bazel/setup_repositories.bzl @@ -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()