|
| 1 | +# Copyright 2024 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +workspace(name = "com_github_sonic_net_sonic_mgmt_sdn_tests_pins_ondatra") |
| 16 | + |
| 17 | +# -- Load buildifier ----------------------------------------------------------- |
| 18 | +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 19 | + |
| 20 | +# Bazel toolchain to build go-lang. |
| 21 | +http_archive( |
| 22 | + name = "io_bazel_rules_go", |
| 23 | + sha256 = "91585017debb61982f7054c9688857a2ad1fd823fc3f9cb05048b0025c47d023", |
| 24 | + urls = [ |
| 25 | + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.42.0/rules_go-v0.42.0.zip", |
| 26 | + "https://github.com/bazelbuild/rules_go/releases/download/v0.42.0/rules_go-v0.42.0.zip", |
| 27 | + ], |
| 28 | +) |
| 29 | + |
| 30 | +# Gazelle to auto generate go-lang BUILD rules. |
| 31 | +http_archive( |
| 32 | + name = "bazel_gazelle", |
| 33 | + sha256 = "b7387f72efb59f876e4daae42f1d3912d0d45563eac7cb23d1de0b094ab588cf", |
| 34 | + urls = [ |
| 35 | + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.34.0/bazel-gazelle-v0.34.0.tar.gz", |
| 36 | + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.34.0/bazel-gazelle-v0.34.0.tar.gz", |
| 37 | + ], |
| 38 | +) |
| 39 | + |
| 40 | +load("pins_deps.bzl", "pins_deps") |
| 41 | + |
| 42 | +pins_deps() |
| 43 | + |
| 44 | +# -- Load Rules Foreign CC ----------------------------------------------------- |
| 45 | + |
| 46 | +load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") |
| 47 | + |
| 48 | +rules_foreign_cc_dependencies() |
| 49 | + |
| 50 | +# -- Load GoLang Rules ----------------------------------------------------- |
| 51 | + |
| 52 | +load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") |
| 53 | +load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") |
| 54 | +load("//:infra_deps.bzl", "binding_deps") |
| 55 | + |
| 56 | +binding_deps() |
| 57 | + |
| 58 | +go_rules_dependencies() |
| 59 | + |
| 60 | +go_register_toolchains(version = "1.21.1") |
| 61 | + |
| 62 | +gazelle_dependencies(go_repository_default_config = "@//:WORKSPACE.bazel") |
| 63 | + |
| 64 | +# -- Load GRPC ------------------------------------------------------------- |
| 65 | + |
| 66 | +load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language") |
| 67 | + |
| 68 | +switched_rules_by_language( |
| 69 | + name = "com_google_googleapis_imports", |
| 70 | + cc = True, |
| 71 | + go = True, |
| 72 | + grpc = True, |
| 73 | +) |
| 74 | + |
| 75 | +load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") |
| 76 | + |
| 77 | +grpc_deps() |
| 78 | + |
| 79 | +load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps") |
| 80 | + |
| 81 | +grpc_extra_deps() |
| 82 | + |
| 83 | +# -- Load Protobuf ------------------------------------------------------------- |
| 84 | + |
| 85 | +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") |
| 86 | + |
| 87 | +protobuf_deps() |
| 88 | + |
| 89 | +load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") |
| 90 | + |
| 91 | +rules_proto_dependencies() |
| 92 | + |
| 93 | +rules_proto_toolchains() |
| 94 | + |
| 95 | +### Bazel rules for many languages to compile PROTO into gRPC libraries |
| 96 | +http_archive( |
| 97 | + name = "rules_proto_grpc", |
| 98 | + sha256 = "f87d885ebfd6a1bdf02b4c4ba5bf6fb333f90d54561e4d520a8413c8d1fb7beb", |
| 99 | + strip_prefix = "rules_proto_grpc-4.5.0", |
| 100 | + urls = ["https://github.com/rules-proto-grpc/rules_proto_grpc/archive/4.5.0.tar.gz"], |
| 101 | + patch_args = ["-p1"], |
| 102 | + patches = [ |
| 103 | + "//:bazel/patches/rules_proto_grpc.patch", |
| 104 | + ], |
| 105 | +) |
| 106 | + |
| 107 | +load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_repos", "rules_proto_grpc_toolchains") |
| 108 | + |
| 109 | +rules_proto_grpc_toolchains() |
| 110 | + |
| 111 | +rules_proto_grpc_repos() |
| 112 | + |
| 113 | +# -- Load P4Runtime ------------------------------------------------------------ |
| 114 | + |
| 115 | +load("@com_github_p4lang_p4runtime//:p4runtime_deps.bzl", "p4runtime_deps") |
| 116 | + |
| 117 | +p4runtime_deps() |
| 118 | + |
| 119 | +# -- Load packaging rules ------------------------------------------------------ |
| 120 | + |
| 121 | +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") |
| 122 | + |
| 123 | +rules_pkg_dependencies() |
| 124 | + |
| 125 | +# == Dependencies needed for testing and formatting only ======================= |
| 126 | + |
| 127 | +# -- Load p4c ------------------------------------------------------------------ |
| 128 | + |
| 129 | +load("@com_github_p4lang_p4c//:bazel/p4c_deps.bzl", "p4c_deps") |
| 130 | + |
| 131 | +p4c_deps() |
| 132 | + |
| 133 | +load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps") |
| 134 | + |
| 135 | +boost_deps() |
0 commit comments