forked from protocolbuffers/protobuf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
internal.bzl
35 lines (31 loc) · 1011 Bytes
/
internal.bzl
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
def internal_ruby_extension(
name,
extension,
deps = [],
**kwargs):
"""Bazel rule to wrap up a generated ruby extension.
NOTE: the rule is only an internal workaround. The interface may change and
the rule may be removed when everything is properly "Bazelified".
Args:
name: the name of the target.
extension: the path of the extension file.
deps: extra dependencies to add.
**kwargs: extra arguments to forward to the genrule.
"""
native.genrule(
name = name,
srcs = deps + [
"Rakefile",
":srcs",
":test_ruby_protos",
":tests",
"//third_party/utf8_range:all_files",
],
tags = ["manual"],
outs = [extension],
cmd = "pushd `dirname $(location Rakefile)`\n" +
"BAZEL=true rake\n" +
"popd\n" +
"cp `dirname $(location Rakefile)`/%s $(OUTS)\n" % extension,
**kwargs,
)