Squashed 'libs/protobuf/' content from commit fcd3b9a85
git-subtree-dir: libs/protobuf git-subtree-split: fcd3b9a85ef36e46643dc30176cea1a7ad62e02b
This commit is contained in:
35
ruby/internal.bzl
Normal file
35
ruby/internal.bzl
Normal file
@@ -0,0 +1,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",
|
||||
"@utf8_range//:utf8_range_srcs",
|
||||
],
|
||||
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,
|
||||
)
|
||||
Reference in New Issue
Block a user