Skip to content

Commit

Permalink
bazel: Fix formatting with buildifier
Browse files Browse the repository at this point in the history
Keys and dependencies are sorted.
  • Loading branch information
ejona86 committed Apr 4, 2024
1 parent d1890c0 commit 32d48ae
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 18 deletions.
39 changes: 34 additions & 5 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
module(
name = "grpc-java",
version = "0",
compatibility_level = 0,
repo_name = "io_grpc_grpc_java",
version = "0",
)

bazel_dep(name = "googleapis", version = "0.0.0-20240326-1c8d509c5", repo_name = "com_google_googleapis")
bazel_dep(name = "grpc", version = "1.56.3.bcr.1", repo_name = "com_github_grpc_grpc")
bazel_dep(name = "protobuf", version = "23.1", repo_name = "com_google_protobuf")
bazel_dep(name = "googleapis", repo_name = "com_google_googleapis", version = "0.0.0-20240326-1c8d509c5")
bazel_dep(name = "grpc", repo_name = "com_github_grpc_grpc", version = "1.56.3.bcr.1")
bazel_dep(name = "protobuf", repo_name = "com_google_protobuf", version = "23.1")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_go", version = "0.46.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_go", repo_name = "io_bazel_rules_go", version = "0.46.0")
bazel_dep(name = "rules_jvm_external", version = "6.0")
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")

non_module_deps = use_extension("//:repositories.bzl", "grpc_java_repositories_extension")

use_repo(
non_module_deps,
"com_github_cncf_xds",
Expand All @@ -22,6 +23,7 @@ use_repo(
)

grpc_repo_deps_ext = use_extension("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_repo_deps_ext")

use_repo(
grpc_repo_deps_ext,
"com_envoyproxy_protoc_gen_validate",
Expand All @@ -30,6 +32,7 @@ use_repo(
)

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")

maven.install(
artifacts = [
"com.google.android:annotations:4.1.1.4",
Expand Down Expand Up @@ -73,100 +76,126 @@ maven.install(
],
strict_visibility = True,
)

use_repo(maven, "maven")

maven.override(
coordinates = "com.google.protobuf:protobuf-java",
target = "@com_google_protobuf//:protobuf_java",
)

maven.override(
coordinates = "com.google.protobuf:protobuf-java-util",
target = "@com_google_protobuf//:protobuf_java_util",
)

maven.override(
coordinates = "com.google.protobuf:protobuf-javalite",
target = "@com_google_protobuf//:protobuf_javalite",
)

maven.override(
coordinates = "io.grpc:grpc-alts",
target = "@io_grpc_grpc_java//alts",
)

maven.override(
coordinates = "io.grpc:grpc-api",
target = "@io_grpc_grpc_java//api",
)

maven.override(
coordinates = "io.grpc:grpc-auth",
target = "@io_grpc_grpc_java//auth",
)

maven.override(
coordinates = "io.grpc:grpc-census",
target = "@io_grpc_grpc_java//census",
)

maven.override(
coordinates = "io.grpc:grpc-context",
target = "@io_grpc_grpc_java//context",
)

maven.override(
coordinates = "io.grpc:grpc-core",
target = "@io_grpc_grpc_java//core:core_maven",
)

maven.override(
coordinates = "io.grpc:grpc-googleapis",
target = "@io_grpc_grpc_java//googleapis",
)

maven.override(
coordinates = "io.grpc:grpc-grpclb",
target = "@io_grpc_grpc_java//grpclb",
)

maven.override(
coordinates = "io.grpc:grpc-inprocess",
target = "@io_grpc_grpc_java//inprocess",
)

maven.override(
coordinates = "io.grpc:grpc-netty",
target = "@io_grpc_grpc_java//netty",
)

maven.override(
coordinates = "io.grpc:grpc-netty-shaded",
target = "@io_grpc_grpc_java//netty:shaded_maven",
)

maven.override(
coordinates = "io.grpc:grpc-okhttp",
target = "@io_grpc_grpc_java//okhttp",
)

maven.override(
coordinates = "io.grpc:grpc-protobuf",
target = "@io_grpc_grpc_java//protobuf",
)

maven.override(
coordinates = "io.grpc:grpc-protobuf-lite",
target = "@io_grpc_grpc_java//protobuf-lite",
)

maven.override(
coordinates = "io.grpc:grpc-rls",
target = "@io_grpc_grpc_java//rls",
)

maven.override(
coordinates = "io.grpc:grpc-services",
target = "@io_grpc_grpc_java//services:services_maven",
)

maven.override(
coordinates = "io.grpc:grpc-stub",
target = "@io_grpc_grpc_java//stub",
)

maven.override(
coordinates = "io.grpc:grpc-testing",
target = "@io_grpc_grpc_java//testing",
)

maven.override(
coordinates = "io.grpc:grpc-xds",
target = "@io_grpc_grpc_java//xds:xds_maven",
)

maven.override(
coordinates = "io.grpc:grpc-util",
target = "@io_grpc_grpc_java//util",
)

switched_rules = use_extension("@com_google_googleapis//:extensions.bzl", "switched_rules")

switched_rules.use_languages(java = True)

use_repo(switched_rules, "com_google_googleapis_imports")
2 changes: 1 addition & 1 deletion alts/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ java_library(
visibility = ["//visibility:public"],
deps = [
":alts_internal",
":handshaker_java_proto",
":handshaker_java_grpc",
":handshaker_java_proto",
"//api",
"//auth",
"//core:internal",
Expand Down
12 changes: 6 additions & 6 deletions census/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ java_library(
]),
visibility = ["//visibility:public"],
deps = [
"//api",
"//context",
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
artifact("io.opencensus:opencensus-api"),
artifact("io.opencensus:opencensus-contrib-grpc-metrics"),
"//api",
"//context",
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
artifact("io.opencensus:opencensus-api"),
artifact("io.opencensus:opencensus-contrib-grpc-metrics"),
],
)
2 changes: 1 addition & 1 deletion examples/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ java_library(
"@io_grpc_grpc_java//services:health",
"@io_grpc_grpc_java//services:healthlb",
"@io_grpc_grpc_java//stub",
"@io_grpc_grpc_proto//:health_proto",
"@io_grpc_grpc_proto//:health_java_proto",
"@io_grpc_grpc_proto//:health_proto",
"@maven//:com_google_api_grpc_proto_google_common_protos",
"@maven//:com_google_code_findbugs_jsr305",
"@maven//:com_google_code_gson_gson",
Expand Down
2 changes: 1 addition & 1 deletion grpclb/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ java_library(
"//api",
"//context",
"//core:internal",
"//util",
"//stub",
"//util",
"@com_google_protobuf//:protobuf_java_util",
"@io_grpc_grpc_proto//:grpclb_load_balancer_java_proto",
artifact("com.google.code.findbugs:jsr305"),
Expand Down
8 changes: 4 additions & 4 deletions xds/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ java_library(
":envoy_service_load_stats_v2_java_grpc",
":envoy_service_load_stats_v3_java_grpc",
":envoy_service_status_v3_java_grpc",
":xds_protos_java",
":orca",
":xds_protos_java",
"//:auto_value_annotations",
"//alts",
"//api",
"//context",
"//core:internal",
"//util",
"//netty",
"//stub",
"//services:metrics",
"//services:metrics_internal",
"//stub",
"//util",
"@com_google_googleapis//google/rpc:rpc_java_proto",
"@com_google_protobuf//:protobuf_java",
"@com_google_protobuf//:protobuf_java_util",
Expand Down Expand Up @@ -146,11 +146,11 @@ java_library(
"//api",
"//context",
"//core:internal",
"//util",
"//protobuf",
"//services:metrics",
"//services:metrics_internal",
"//stub",
"//util",
"@com_google_protobuf//:protobuf_java_util",
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
Expand Down

0 comments on commit 32d48ae

Please sign in to comment.