Skip to content

Commit dbe7c30

Browse files
author
Karim Alweheshy
committed
update to split 3rd party libs
1 parent 5a926d5 commit dbe7c30

File tree

6 files changed

+77
-66
lines changed

6 files changed

+77
-66
lines changed

MODULE.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ use_repo(
3333
"com_github_apple_swift_nio_transport_services",
3434
"com_github_apple_swift_protobuf",
3535
"com_github_grpc_grpc_swift",
36+
"com_github_grpc_grpc_swift_protobuf",
37+
"com_github_grpc_grpc_swift_nio_transport",
3638
)
3739

3840
apple_cc_configure = use_extension("@build_bazel_apple_support//crosstool:setup.bzl", "apple_cc_configure_extension")

proto/compilers/swift_proto_compiler_macros.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def make_grpc_swift_proto_compiler(
7777
suffixes = [".grpc.swift"],
7878
deps = [
7979
"@com_github_apple_swift_protobuf//:SwiftProtobuf",
80-
"@com_github_grpc_grpc_swift//:GRPC",
80+
"@com_github_grpc_grpc_swift//:GRPCCodeGen",
8181
],
8282
visibility = ["//visibility:public"],
8383
)

swift/repositories.bzl

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,28 @@ def swift_rules_dependencies(include_bzlmod_ready_dependencies = True):
125125
),
126126
)
127127

128+
_maybe(
129+
http_archive,
130+
name = "com_github_grpc_grpc_swift_nio_transport",
131+
urls = ["https://github.com/grpc/grpc-swift-nio-transport/archive/1.0.0.tar.gz"], # latest at time of writing
132+
sha256 = "e590f7a30961802cbdf4f8cac37ae2dbc9ab2c8f8032c2ef2f66ed2b63623185",
133+
strip_prefix = "grpc-swift-nio-transport-1.0.0/",
134+
build_file = Label(
135+
"//third_party:com_github_grpc_grpc_swift_nio_transport/BUILD.overlay",
136+
),
137+
)
138+
139+
_maybe(
140+
http_archive,
141+
name = "com_github_grpc_grpc_swift_protobuf",
142+
urls = ["https://github.com/grpc/grpc-swift-protobuf/archive/1.0.0.tar.gz"], # latest at time of writing
143+
sha256 = "c31969782aa710e002f9a6214a9eb1e4292800e3606c2a092b034b97fdff52ac",
144+
strip_prefix = "grpc-swift-nio-protobuf-1.0.0/",
145+
build_file = Label(
146+
"//third_party:com_github_grpc_grpc_swift_protobuf/BUILD.overlay",
147+
),
148+
)
149+
128150
_maybe(
129151
http_archive,
130152
name = "com_github_apple_swift_docc_symbolkit",
@@ -139,9 +161,9 @@ def swift_rules_dependencies(include_bzlmod_ready_dependencies = True):
139161
_maybe(
140162
http_archive,
141163
name = "com_github_apple_swift_nio",
142-
urls = ["https://github.com/apple/swift-nio/archive/2.42.0.tar.gz"], # pinned to grpc swift version
143-
sha256 = "e3304bc3fb53aea74a3e54bd005ede11f6dc357117d9b1db642d03aea87194a0",
144-
strip_prefix = "swift-nio-2.42.0/",
164+
urls = ["https://github.com/apple/swift-nio/archive/2.78.0.tar.gz"], # pinned to grpc swift version
165+
sha256 = "7262fe6a134ce83fda666429ca88a511db517f36996955dafeb2068d66b7d260",
166+
strip_prefix = "swift-nio-2.78.0/",
145167
build_file = Label(
146168
"//third_party:com_github_apple_swift_nio/BUILD.overlay",
147169
),
@@ -150,9 +172,9 @@ def swift_rules_dependencies(include_bzlmod_ready_dependencies = True):
150172
_maybe(
151173
http_archive,
152174
name = "com_github_apple_swift_nio_http2",
153-
urls = ["https://github.com/apple/swift-nio-http2/archive/1.26.0.tar.gz"], # pinned to grpc-swift version
154-
sha256 = "f0edfc9d6a7be1d587e5b403f2d04264bdfae59aac1d74f7d974a9022c6d2b25",
155-
strip_prefix = "swift-nio-http2-1.26.0/",
175+
urls = ["https://github.com/apple/swift-nio-http2/archive/1.35.0.tar.gz"], # pinned to grpc-swift version
176+
sha256 = "ffc425d7e2737d17b80a0227f2b2823eb95bd76cb681906494e5b795f64f6f5c",
177+
strip_prefix = "swift-nio-http2-1.35.0/",
156178
build_file = Label(
157179
"//third_party:com_github_apple_swift_nio_http2/BUILD.overlay",
158180
),
@@ -194,9 +216,9 @@ def swift_rules_dependencies(include_bzlmod_ready_dependencies = True):
194216
_maybe(
195217
http_archive,
196218
name = "com_github_apple_swift_nio_ssl",
197-
urls = ["https://github.com/apple/swift-nio-ssl/archive/2.23.0.tar.gz"], # pinned to grpc swift version
198-
sha256 = "4787c63f61dd04d99e498adc3d1a628193387e41efddf8de19b8db04544d016d",
199-
strip_prefix = "swift-nio-ssl-2.23.0/",
219+
urls = ["https://github.com/apple/swift-nio-ssl/archive/2.29.0.tar.gz"], # pinned to grpc swift version
220+
sha256 = "f35a05309d791ec5ff23e1b0cdff2962872e2388fa0e27fced57566bb0383ea4",
221+
strip_prefix = "swift-nio-ssl-2.29.0/",
200222
build_file = Label(
201223
"//third_party:com_github_apple_swift_nio_ssl/BUILD.overlay",
202224
),
@@ -205,9 +227,9 @@ def swift_rules_dependencies(include_bzlmod_ready_dependencies = True):
205227
_maybe(
206228
http_archive,
207229
name = "com_github_apple_swift_collections",
208-
urls = ["https://github.com/apple/swift-collections/archive/1.0.4.tar.gz"], # pinned to swift-nio @ grpc-swift version
209-
sha256 = "d9e4c8a91c60fb9c92a04caccbb10ded42f4cb47b26a212bc6b39cc390a4b096",
210-
strip_prefix = "swift-collections-1.0.4/",
230+
urls = ["https://github.com/apple/swift-collections/archive/1.1.3.tar.gz"], # pinned to swift-nio @ grpc-swift version
231+
sha256 = "7e5e48d0dc2350bed5919be5cf60c485e72a30bd1f2baf718a619317677b91db",
232+
strip_prefix = "swift-collections-1.1.3/",
211233
build_file = Label(
212234
"//third_party:com_github_apple_swift_collections/BUILD.overlay",
213235
),
Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,13 @@
11
load("@build_bazel_rules_swift//swift:swift_binary.bzl", "swift_binary")
2-
load(
3-
"@build_bazel_rules_swift//swift:swift_interop_hint.bzl",
4-
"swift_interop_hint",
5-
)
62
load("@build_bazel_rules_swift//swift:swift_library.bzl", "swift_library")
73

8-
cc_library(
9-
name = "CGRPCZlib",
10-
srcs = glob([
11-
"Sources/CGRPCZlib/**/*.c",
12-
]),
13-
hdrs = glob([
14-
"Sources/CGRPCZlib/**/*.h",
15-
]),
16-
aspect_hints = [":CGRPCZLIB_interop"],
17-
includes = ["Sources/CGRPCZlib/include"],
18-
linkopts = ["-lz"],
19-
)
20-
21-
swift_interop_hint(
22-
name = "CGRPCZLIB_interop",
23-
module_name = "CGRPCZlib",
24-
)
25-
264
swift_library(
27-
name = "GRPC",
5+
name = "GRPCCodeGen",
286
srcs = glob([
29-
"Sources/GRPC/**/*.swift",
7+
"Sources/GRPCCodeGen/**/*.swift",
308
]),
319
defines = ["SWIFT_PACKAGE"], # activates CgRPC imports
32-
module_name = "GRPC",
33-
visibility = ["//visibility:public"],
34-
deps = [
35-
":CGRPCZlib",
36-
"@com_github_apple_swift_log//:Logging",
37-
"@com_github_apple_swift_nio//:NIO",
38-
"@com_github_apple_swift_nio//:NIOCore",
39-
"@com_github_apple_swift_nio//:NIOEmbedded",
40-
"@com_github_apple_swift_nio//:NIOFoundationCompat",
41-
"@com_github_apple_swift_nio//:NIOHTTP1",
42-
"@com_github_apple_swift_nio//:NIOPosix",
43-
"@com_github_apple_swift_nio//:NIOTLS",
44-
"@com_github_apple_swift_nio_extras//:NIOExtras",
45-
"@com_github_apple_swift_nio_http2//:NIOHTTP2",
46-
"@com_github_apple_swift_nio_ssl//:NIOSSL",
47-
"@com_github_apple_swift_nio_transport_services//:NIOTransportServices",
48-
"@com_github_apple_swift_protobuf//:SwiftProtobuf",
49-
],
50-
)
51-
52-
swift_binary(
53-
name = "protoc-gen-grpc-swift",
54-
srcs = glob([
55-
"Sources/protoc-gen-grpc-swift/*.swift",
56-
]),
10+
module_name = "GRPCCodeGen",
5711
visibility = ["//visibility:public"],
58-
deps = [
59-
"@com_github_apple_swift_protobuf//:SwiftProtobuf",
60-
"@com_github_apple_swift_protobuf//:SwiftProtobufPluginLibrary",
61-
],
12+
deps = [],
6213
)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
load(
2+
"@build_bazel_rules_swift//swift:swift_interop_hint.bzl",
3+
"swift_interop_hint",
4+
)
5+
6+
cc_library(
7+
name = "CGRPCZlib",
8+
srcs = glob([
9+
"Sources/CGRPCNIOTransportZlib/**/*.c",
10+
]),
11+
hdrs = glob([
12+
"Sources/CGRPCZlib/**/*.h",
13+
]),
14+
aspect_hints = [":CGRPCZLIB_interop"],
15+
includes = ["Sources/CGRPCNIOTransportZlib/include"],
16+
linkopts = ["-lz"],
17+
)
18+
19+
swift_interop_hint(
20+
name = "CGRPCZLIB_interop",
21+
module_name = "CGRPCZlib",
22+
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
load("@build_bazel_rules_swift//swift:swift_binary.bzl", "swift_binary")
2+
3+
swift_binary(
4+
name = "protoc-gen-grpc-swift",
5+
srcs = glob([
6+
"Sources/protoc-gen-grpc-swift/*.swift",
7+
]),
8+
visibility = ["//visibility:public"],
9+
deps = [
10+
"@com_github_grpc_grpc_swift//:GRPCCodeGen",
11+
"@com_github_apple_swift_protobuf//:SwiftProtobuf",
12+
"@com_github_apple_swift_protobuf//:SwiftProtobufPluginLibrary",
13+
],
14+
)

0 commit comments

Comments
 (0)