-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWORKSPACE.bazel
More file actions
136 lines (99 loc) · 4.09 KB
/
WORKSPACE.bazel
File metadata and controls
136 lines (99 loc) · 4.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
workspace(name = "multi_language")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Protocol buffers compiler (for GRPC)
http_archive(
name = "rules_proto",
sha256 = "66bfdf8782796239d3875d37e7de19b1d94301e8972b3cbd2446b332429b4df1",
strip_prefix = "rules_proto-4.0.0",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0.tar.gz",
],
)
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
rules_proto_dependencies()
rules_proto_toolchains()
# GRPC and protocol buffers for Java
http_archive(
name = "io_grpc_grpc_java",
sha256 = "e3781bcab2a410a7cd138f13b2e6a643e111575f6811b154c570f4d020e87507",
strip_prefix = "grpc-java-1.44.0",
urls = [
"https://github.com/grpc/grpc-java/archive/refs/tags/v1.44.0.tar.gz",
],
)
load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_ARTIFACTS", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS", "grpc_java_repositories")
# Official Bazel tools to get Maven repo dependencies; there are other
# unofficial tools also.
RULES_JVM_EXTERNAL_TAG = "4.2"
RULES_JVM_EXTERNAL_SHA = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca"
http_archive(
name = "rules_jvm_external",
sha256 = RULES_JVM_EXTERNAL_SHA,
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)
load("@rules_jvm_external//:defs.bzl", "maven_install")
# List of 32 dependencies for GRPC support:
# print(IO_GRPC_GRPC_JAVA_ARTIFACTS)
# ["com.google.api.grpc:proto-google-common-protos:2.0.1",
# "com.google.auth:google-auth-library-credentials:0.22.0",
# "com.google.auth:google-auth-library-oauth2-http:0.22.0",
# ...
# ]
maven_install(
artifacts = [
"junit:junit:4.12",
] + IO_GRPC_GRPC_JAVA_ARTIFACTS,
generate_compat_repositories = True,
maven_install_json = "//:maven_install.json",
override_targets = IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS,
repositories = [
"https://jcenter.bintray.com/",
"https://repo1.maven.org/maven2",
],
)
# Generate repositories with older naming, compatible with (needed
# for) the GRPC support
load("@maven//:compat.bzl", "compat_repositories")
compat_repositories()
# Pinning is both safer (like an NPM package-lock) and avoids
# the spurious use of an OS-installed JVM.
load("@maven//:defs.bzl", "pinned_maven_install")
pinned_maven_install()
# bazel run @maven//:pin
# bazel run @unpinned_maven//:pin
# GRPC for Java - continued
# Having used Maven to fetch its dependencies, we can now finish with GRPC for Java.
grpc_java_repositories()
# Go rules
http_archive(
name = "io_bazel_rules_go",
sha256 = "d6b2513456fe2229811da7eb67a444be7785f5323c6708b38d851d2b51e54d83",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.30.0/rules_go-v0.30.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.30.0/rules_go-v0.30.0.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.17.6")
http_archive(
name = "bazel_gazelle",
sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
],
)
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
gazelle_dependencies(go_repository_default_config = "@//:WORKSPACE.bazel")
# Other Go Dependencies
# tip:
# bazel run //:gazelle -- update-repos github.com/mattn/go-slim
go_repository(
name = "com_github_mattn_go_slim",
importpath = "github.com/mattn/go-slim",
sum = "h1:FZ/1leXcHnDpGdy7Iu8pdna+hsR75TYHaL1slgVGZDE=",
version = "v0.0.3",
)