bazel: Use jarjar to avoid xds deps (#12243) · grpc/grpc-java@8f09b96

@@ -87,38 +87,11 @@ IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS = {

8787

"io.grpc:grpc-util": "@io_grpc_grpc_java//util",

8888

}

898990-

def grpc_java_repositories(bzlmod = False):

90+

def grpc_java_repositories():

9191

"""Imports dependencies for grpc-java."""

92-

if not bzlmod and not native.existing_rule("dev_cel"):

93-

http_archive(

94-

name = "dev_cel",

95-

strip_prefix = "cel-spec-0.15.0",

96-

sha256 = "3ee09eb69dbe77722e9dee23dc48dc2cd9f765869fcf5ffb1226587c81791a0b",

97-

urls = [

98-

"https://github.com/google/cel-spec/archive/refs/tags/v0.15.0.tar.gz",

99-

],

100-

)

101-

if not native.existing_rule("com_github_cncf_xds"):

102-

http_archive(

103-

name = "com_github_cncf_xds",

104-

strip_prefix = "xds-2ac532fd44436293585084f8d94c6bdb17835af0",

105-

sha256 = "790c4c83b6950bb602fec221f6a529d9f368cdc8852aae7d2592d0d04b015f37",

106-

urls = [

107-

"https://github.com/cncf/xds/archive/2ac532fd44436293585084f8d94c6bdb17835af0.tar.gz",

108-

],

109-

)

110-

if not bzlmod and not native.existing_rule("com_github_grpc_grpc"):

111-

http_archive(

112-

name = "com_github_grpc_grpc",

113-

strip_prefix = "grpc-1.46.0",

114-

sha256 = "67423a4cd706ce16a88d1549297023f0f9f0d695a96dd684adc21e67b021f9bc",

115-

urls = [

116-

"https://github.com/grpc/grpc/archive/v1.46.0.tar.gz",

117-

],

118-

)

119-

if not bzlmod and not native.existing_rule("com_google_protobuf"):

92+

if not native.existing_rule("com_google_protobuf"):

12093

com_google_protobuf()

121-

if not bzlmod and not native.existing_rule("com_google_googleapis"):

94+

if not native.existing_rule("com_google_googleapis"):

12295

http_archive(

12396

name = "com_google_googleapis",

12497

sha256 = "49930468563dd48283e8301e8d4e71436bf6d27ac27c235224cc1a098710835d",

@@ -127,25 +100,14 @@ def grpc_java_repositories(bzlmod = False):

127100

"https://github.com/googleapis/googleapis/archive/ca1372c6d7bcb199638ebfdb40d2b2660bab7b88.tar.gz",

128101

],

129102

)

130-

if not bzlmod and not native.existing_rule("io_bazel_rules_go"):

131-

http_archive(

132-

name = "io_bazel_rules_go",

133-

sha256 = "ab21448cef298740765f33a7f5acee0607203e4ea321219f2a4c85a6e0fb0a27",

134-

urls = [

135-

"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.32.0/rules_go-v0.32.0.zip",

136-

"https://github.com/bazelbuild/rules_go/releases/download/v0.32.0/rules_go-v0.32.0.zip",

137-

],

138-

)

139103

if not native.existing_rule("io_grpc_grpc_proto"):

140104

io_grpc_grpc_proto()

141-

if not native.existing_rule("envoy_api"):

105+

if not native.existing_rule("bazel_jar_jar"):

142106

http_archive(

143-

name = "envoy_api",

144-

sha256 = "ecf71817233eba19cc8b4ee14e126ffd5838065d5b5a92b2506258a42ac55199",

145-

strip_prefix = "data-plane-api-0bc95493c5e88b7b07e62758d23b39341813a827",

146-

urls = [

147-

"https://github.com/envoyproxy/data-plane-api/archive/0bc95493c5e88b7b07e62758d23b39341813a827.tar.gz",

148-

],

107+

name = "bazel_jar_jar",

108+

sha256 = "3117f913c732142a795551f530d02c9157b9ea895e6b2de0fbb5af54f03040a5",

109+

strip_prefix = "bazel_jar_jar-0.1.6",

110+

url = "https://github.com/bazeltools/bazel_jar_jar/releases/download/v0.1.6/bazel_jar_jar-v0.1.6.tar.gz",

149111

)

150112151113

def com_google_protobuf():

@@ -166,8 +128,3 @@ def io_grpc_grpc_proto():

166128

strip_prefix = "grpc-proto-4f245d272a28a680606c0739753506880cf33b5f",

167129

urls = ["https://github.com/grpc/grpc-proto/archive/4f245d272a28a680606c0739753506880cf33b5f.zip"],

168130

)

169-170-

def _grpc_java_repositories_extension(_):

171-

grpc_java_repositories(bzlmod = True)

172-173-

grpc_java_repositories_extension = module_extension(implementation = _grpc_java_repositories_extension)