| def internal_ruby_extension( |
| """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". |
| 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. |
| "//third_party/utf8_range:all_files", |
| cmd = "pushd `dirname $(location Rakefile)`\n" + |
| "cp `dirname $(location Rakefile)`/%s $(OUTS)\n" % extension, |