|
| 1 | +diff --git a/BUILD.bazel b/BUILD.bazel |
| 2 | +index 23efee4a3..1c7ff6ee7 100644 |
| 3 | +--- a/BUILD.bazel |
| 4 | ++++ b/BUILD.bazel |
| 5 | +@@ -5,7 +5,7 @@ load("@rules_java//java:defs.bzl", "java_lite_proto_library", "java_proto_librar |
| 6 | + load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") |
| 7 | + load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library") |
| 8 | + load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS") |
| 9 | +-load(":protobuf.bzl", "internal_objc_proto_library", "internal_php_proto_library", "internal_py_proto_library", "internal_ruby_proto_library") |
| 10 | ++load(":protobuf.bzl", "internal_objc_proto_library", "internal_php_proto_library", "internal_py_proto_library") |
| 11 | + |
| 12 | + licenses(["notice"]) |
| 13 | + |
| 14 | +@@ -150,17 +150,6 @@ filegroup( |
| 15 | + visibility = ["//visibility:public"], |
| 16 | + ) |
| 17 | + |
| 18 | +-internal_ruby_proto_library( |
| 19 | +- name = "well_known_ruby_protos", |
| 20 | +- srcs = [":well_known_protos"], |
| 21 | +- default_runtime = "", |
| 22 | +- includes = ["src"], |
| 23 | +- visibility = [ |
| 24 | +- "//conformance:__pkg__", |
| 25 | +- "//ruby:__subpackages__", |
| 26 | +- ], |
| 27 | +-) |
| 28 | +- |
| 29 | + ################################################################################ |
| 30 | + # Protocol Buffers Compiler |
| 31 | + ################################################################################ |
| 32 | +@@ -525,33 +514,6 @@ internal_php_proto_library( |
| 33 | + ], |
| 34 | + ) |
| 35 | + |
| 36 | +-internal_ruby_proto_library( |
| 37 | +- name = "test_messages_proto2_ruby_proto", |
| 38 | +- testonly = 1, |
| 39 | +- srcs = ["//src/google/protobuf:test_messages_proto2.proto"], |
| 40 | +- includes = ["src/google/protobuf"], |
| 41 | +- visibility = [ |
| 42 | +- "//conformance:__pkg__", |
| 43 | +- "//ruby:__subpackages__", |
| 44 | +- ], |
| 45 | +-) |
| 46 | +- |
| 47 | +-internal_ruby_proto_library( |
| 48 | +- name = "test_messages_proto3_ruby_proto", |
| 49 | +- testonly = 1, |
| 50 | +- srcs = ["//src/google/protobuf:test_messages_proto3.proto"], |
| 51 | +- includes = [ |
| 52 | +- "src/google/protobuf", |
| 53 | +- # The above must come first. |
| 54 | +- "src", |
| 55 | +- ], |
| 56 | +- visibility = [ |
| 57 | +- "//conformance:__pkg__", |
| 58 | +- "//ruby:__subpackages__", |
| 59 | +- ], |
| 60 | +- deps = [":well_known_ruby_protos"], |
| 61 | +-) |
| 62 | +- |
| 63 | + filegroup( |
| 64 | + name = "bzl_srcs", |
| 65 | + srcs = glob(["**/*.bzl"]), |
| 66 | +diff --git a/conformance/BUILD.bazel b/conformance/BUILD.bazel |
| 67 | +index c4955042c..56a81c5aa 100644 |
| 68 | +--- a/conformance/BUILD.bazel |
| 69 | ++++ b/conformance/BUILD.bazel |
| 70 | +@@ -2,7 +2,7 @@ |
| 71 | + |
| 72 | + load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_proto_library", "objc_library") |
| 73 | + load("@rules_ruby//ruby:defs.bzl", "ruby_binary") |
| 74 | +-load("//:protobuf.bzl", "internal_csharp_proto_library", "internal_objc_proto_library", "internal_php_proto_library", "internal_py_proto_library", "internal_ruby_proto_library") |
| 75 | ++load("//:protobuf.bzl", "internal_csharp_proto_library", "internal_objc_proto_library", "internal_php_proto_library", "internal_py_proto_library") |
| 76 | + load("//build_defs:internal_shell.bzl", "inline_sh_binary") |
| 77 | + load( |
| 78 | + "@rules_pkg//:mappings.bzl", |
| 79 | +diff --git a/protobuf.bzl b/protobuf.bzl |
| 80 | +index cd10f01ec..efc59e8bc 100644 |
| 81 | +--- a/protobuf.bzl |
| 82 | ++++ b/protobuf.bzl |
| 83 | +@@ -2,7 +2,6 @@ load("@bazel_skylib//lib:versions.bzl", "versions") |
| 84 | + load("@rules_cc//cc:defs.bzl", "objc_library") |
| 85 | + load("@rules_proto//proto:defs.bzl", "ProtoInfo") |
| 86 | + load("@rules_python//python:defs.bzl", "py_library") |
| 87 | +-load("@rules_ruby//ruby:defs.bzl", "ruby_library") |
| 88 | + |
| 89 | + def _GetPath(ctx, path): |
| 90 | + if ctx.label.workspace_root: |
| 91 | +@@ -490,6 +489,7 @@ def internal_objc_proto_library( |
| 92 | + |
| 93 | + def internal_ruby_proto_library( |
| 94 | + name, |
| 95 | ++ ruby_library, |
| 96 | + srcs = [], |
| 97 | + deps = [], |
| 98 | + includes = ["."], |
| 99 | +@@ -506,6 +506,7 @@ def internal_ruby_proto_library( |
| 100 | + |
| 101 | + Args: |
| 102 | + name: the name of the ruby_proto_library. |
| 103 | ++ ruby_library: the ruby library rules to use. |
| 104 | + srcs: the .proto files to compile. |
| 105 | + deps: a list of dependency labels; must be a internal_ruby_proto_library. |
| 106 | + includes: a string indicating the include path of the .proto files. |
| 107 | +diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl |
| 108 | +index d055eed8c..c96090989 100644 |
| 109 | +--- a/protobuf_deps.bzl |
| 110 | ++++ b/protobuf_deps.bzl |
| 111 | +@@ -109,14 +109,6 @@ def protobuf_deps(): |
| 112 | + sha256 = "f9e4f6acf82449324d56669bda4bdb28b48688ad2990d8b39fa5b93ed39c9ad1", |
| 113 | + ) |
| 114 | + |
| 115 | +- if not native.existing_rule("rules_ruby"): |
| 116 | +- _github_archive( |
| 117 | +- name = "rules_ruby", |
| 118 | +- repo = "https://github.com/protocolbuffers/rules_ruby", |
| 119 | +- commit = "b7f3e9756f3c45527be27bc38840d5a1ba690436", |
| 120 | +- sha256 = "347927fd8de6132099fcdc58e8f7eab7bde4eb2fd424546b9cd4f1c6f8f8bad8", |
| 121 | +- ) |
| 122 | +- |
| 123 | + if not native.existing_rule("rules_jvm_external"): |
| 124 | + _github_archive( |
| 125 | + name = "rules_jvm_external", |
| 126 | +diff --git a/ruby/BUILD.bazel b/ruby/BUILD.bazel |
| 127 | +index cc4b477ee..847c50fcf 100755 |
| 128 | +--- a/ruby/BUILD.bazel |
| 129 | ++++ b/ruby/BUILD.bazel |
| 130 | +@@ -7,7 +7,7 @@ load("@bazel_skylib//rules:common_settings.bzl", "string_flag") |
| 131 | + load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") |
| 132 | + load("@rules_ruby//ruby:defs.bzl", "ruby_library") |
| 133 | + load("//build_defs:internal_shell.bzl", "inline_sh_binary") |
| 134 | +-load("//:protobuf.bzl", "internal_ruby_proto_library") |
| 135 | ++load("//ruby:defs.bzl", "internal_ruby_proto_library") |
| 136 | + load("//conformance:defs.bzl", "conformance_test") |
| 137 | + load("//:protobuf_version.bzl", "PROTOBUF_RUBY_VERSION") |
| 138 | + |
| 139 | +diff --git a/ruby/compatibility_tests/v3.0.0/tests/BUILD.bazel b/ruby/compatibility_tests/v3.0.0/tests/BUILD.bazel |
| 140 | +index 34a539172..697f87699 100644 |
| 141 | +--- a/ruby/compatibility_tests/v3.0.0/tests/BUILD.bazel |
| 142 | ++++ b/ruby/compatibility_tests/v3.0.0/tests/BUILD.bazel |
| 143 | +@@ -1,6 +1,6 @@ |
| 144 | + load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") |
| 145 | + load("@rules_ruby//ruby:defs.bzl", "ruby_test") |
| 146 | +-load("//:protobuf.bzl", "internal_ruby_proto_library") |
| 147 | ++load("//ruby:defs.bzl", "internal_ruby_proto_library") |
| 148 | + |
| 149 | + internal_ruby_proto_library( |
| 150 | + name = "test_ruby_protos", |
| 151 | +diff --git a/ruby/defs.bzl b/ruby/defs.bzl |
| 152 | +new file mode 100644 |
| 153 | +index 000000000..e7610ad01 |
| 154 | +--- /dev/null |
| 155 | ++++ b/ruby/defs.bzl |
| 156 | +@@ -0,0 +1,24 @@ |
| 157 | ++"""Wrapper around internal_ruby_proto_library to supply our rules_ruby""" |
| 158 | ++ |
| 159 | ++load("@rules_ruby//ruby:defs.bzl", "ruby_library") |
| 160 | ++load("//:protobuf.bzl", _internal_ruby_proto_library = "internal_ruby_proto_library") |
| 161 | ++ |
| 162 | ++def internal_ruby_proto_library( |
| 163 | ++ name, |
| 164 | ++ **kwargs): |
| 165 | ++ """Bazel rule to create a Ruby protobuf library from proto source files |
| 166 | ++ |
| 167 | ++ NOTE: the rule is only an internal workaround to generate protos. The |
| 168 | ++ interface may change and the rule may be removed when bazel has introduced |
| 169 | ++ the native rule. |
| 170 | ++ |
| 171 | ++ Args: |
| 172 | ++ name: the name of the ruby_proto_library. |
| 173 | ++ **kwargs: other keyword arguments that are passed to ruby_library. |
| 174 | ++ |
| 175 | ++ """ |
| 176 | ++ _internal_ruby_proto_library( |
| 177 | ++ name, |
| 178 | ++ ruby_library, |
| 179 | ++ **kwargs |
| 180 | ++ ) |
| 181 | +\ No newline at end of file |
0 commit comments