Skip to content

Commit

Permalink
Factor out deps in prep for bazel modules
Browse files Browse the repository at this point in the history
  • Loading branch information
marcushines committed Feb 14, 2024
1 parent 2d60453 commit 2964275
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 45 deletions.
50 changes: 5 additions & 45 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
workspace(name = "com_github_openconfig_gnsi")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

### Bazel rules for many languages to compile PROTO into gRPC libraries
Expand Down Expand Up @@ -54,53 +56,11 @@ go_register_toolchains(go_version = "1.18")
# gazelle:repo bazel_gazelle
bazel_gazelle()

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")

go_repository(
name = "com_github_openconfig_gnoi",
build_directives = [
"gazelle:proto_import_prefix github.com/openconfig/gnoi",
],
build_file_generation = "on",
importpath = "github.com/openconfig/gnoi",
sum = "h1:koTAGmBf6l9XvBqinTC484NSBuCCUaz01136ofgShgo=",
version = "v0.0.0-20220615151501-18d7d5153945",
)

go_repository(
name = "com_github_openconfig_gnmi",
build_directives = [
"gazelle:proto_import_prefix github.com/openconfig/gnmi",
],
build_file_generation = "on",
importpath = "github.com/openconfig/gnmi",
sum = "h1:tv9HygDMXnoGyWuLmNCodMV2+PK6+uT/ndAxDVzsUUQ=",
version = "v0.0.0-20220617175856-41246b1b3507",
)

go_repository(
name = "com_github_kylelemons_godebug",
importpath = "github.com/kylelemons/godebug",
sum = "h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=",
version = "v1.1.0",
)
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

go_repository(
name = "com_github_openconfig_goyang",
importpath = "github.com/openconfig/goyang",
sum = "h1:Z95LskKYk6nBYOxHtmJCu3YEKlr3pJLWG1tYAaNh3yU=",
version = "v0.2.9",
)
load("//:deps.bzl", "gnsi_deps")

go_repository(
name = "com_github_openconfig_ygot",
build_directives = [
"gazelle:proto_import_prefix github.com/openconfig/ygot",
],
importpath = "github.com/openconfig/ygot",
sum = "h1:EKaeFhx1WwTZGsYeqipyh1mfF8y+z2StaXZtwVnXklk=",
version = "v0.13.1",
)
gnsi_deps()

load("@rules_proto_grpc//go:repositories.bzl", rules_proto_grpc_go_repos = "go_repos")

Expand Down
65 changes: 65 additions & 0 deletions deps.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

#
# Copyright 2024 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
load("@bazel_gazelle//:deps.bzl", "go_repository")

def gnsi_deps():
if not native.existing_rule("com_github_openconfig_gnoi"):
go_repository(
name = "com_github_openconfig_gnoi",
build_directives = [
"gazelle:proto_import_prefix github.com/openconfig/gnoi",
],
build_file_generation = "on",
importpath = "github.com/openconfig/gnoi",
sum = "h1:koTAGmBf6l9XvBqinTC484NSBuCCUaz01136ofgShgo=",
version = "v0.0.0-20220615151501-18d7d5153945",
)
if not native.existing_rule("com_github_openconfig_gnmi"):
go_repository(
name = "com_github_openconfig_gnmi",
build_directives = [
"gazelle:proto_import_prefix github.com/openconfig/gnmi",
],
build_file_generation = "on",
importpath = "github.com/openconfig/gnmi",
sum = "h1:tv9HygDMXnoGyWuLmNCodMV2+PK6+uT/ndAxDVzsUUQ=",
version = "v0.0.0-20220617175856-41246b1b3507",
)
if not native.existing_rule("com_github_kylelemons_godebug"):
go_repository(
name = "com_github_kylelemons_godebug",
importpath = "github.com/kylelemons/godebug",
sum = "h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=",
version = "v1.1.0",
)
if not native.existing_rule("com_github_openconfig_goyang"):
go_repository(
name = "com_github_openconfig_goyang",
importpath = "github.com/openconfig/goyang",
sum = "h1:Z95LskKYk6nBYOxHtmJCu3YEKlr3pJLWG1tYAaNh3yU=",
version = "v0.2.9",
)
if not native.existing_rule("com_github_openconfig_ygot"):
go_repository(
name = "com_github_openconfig_ygot",
build_directives = [
"gazelle:proto_import_prefix github.com/openconfig/ygot",
],
importpath = "github.com/openconfig/ygot",
sum = "h1:EKaeFhx1WwTZGsYeqipyh1mfF8y+z2StaXZtwVnXklk=",
version = "v0.13.1",
)

0 comments on commit 2964275

Please sign in to comment.