diff --git a/BUILD b/BUILD index 65eb95a814..96d7b7d97a 100644 --- a/BUILD +++ b/BUILD @@ -282,25 +282,6 @@ cc_test( ], ) -upb_proto_reflection_library( - name = "descriptor_upbreflection", - deps = ["@com_google_protobuf//:descriptor_proto"], -) - -cc_test( - name = "test_encoder", - srcs = ["tests/pb/test_encoder.cc"], - copts = CPPOPTS, - deps = [ - ":descriptor_upbproto", - ":descriptor_upbreflection", - ":upb", - ":upb_cc_bindings", - ":upb_pb", - ":upb_test", - ], -) - proto_library( name = "test_cpp_proto", srcs = [ @@ -339,6 +320,25 @@ cc_test( ) # copybara:strip_for_google3_begin +upb_proto_reflection_library( + name = "descriptor_upbreflection", + deps = ["@com_google_protobuf//:descriptor_proto"], +) + +cc_test( + name = "test_encoder", + srcs = ["tests/pb/test_encoder.cc"], + copts = CPPOPTS, + deps = [ + ":descriptor_upbproto", + ":descriptor_upbreflection", + ":upb", + ":upb_cc_bindings", + ":upb_pb", + ":upb_test", + ], +) + proto_library( name = "test_json_enum_from_separate", srcs = ["tests/json/enum_from_separate_file.proto"], diff --git a/WORKSPACE b/WORKSPACE index 8a4ef8ec3c..a847b5153c 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,4 +1,3 @@ - workspace(name = "upb") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") @@ -6,7 +5,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") load(":repository_defs.bzl", "bazel_version_repository") bazel_version_repository( - name = "bazel_version" + name = "bazel_version", ) http_archive( @@ -22,10 +21,10 @@ http_archive( git_repository( name = "com_google_protobuf", + commit = "c659a4a4db2e27463e51c732df25730973956be2", #remote = "https://github.com/protocolbuffers/protobuf.git", #commit = "78ca77ac8799f67fda7b9a01cc691cd9fe526f25", remote = "https://github.com/haberman/protobuf.git", - commit = "c659a4a4db2e27463e51c732df25730973956be2", ) http_archive( @@ -40,19 +39,19 @@ git_repository( name = "absl", commit = "070f6e47b33a2909d039e620c873204f78809492", remote = "https://github.com/abseil/abseil-cpp.git", - shallow_since = "1541627663 -0500" + shallow_since = "1541627663 -0500", ) http_archive( name = "ragel", - sha256 = "5f156edb65d20b856d638dd9ee2dfb43285914d9aa2b6ec779dac0270cd56c3f", build_file = "//:ragel.BUILD", + sha256 = "5f156edb65d20b856d638dd9ee2dfb43285914d9aa2b6ec779dac0270cd56c3f", strip_prefix = "ragel-6.10", urls = ["http://www.colm.net/files/ragel/ragel-6.10.tar.gz"], ) http_archive( - name = "bazel_skylib", - strip_prefix = "bazel-skylib-master", - urls = ["https://github.com/bazelbuild/bazel-skylib/archive/master.tar.gz"], + name = "bazel_skylib", + strip_prefix = "bazel-skylib-master", + urls = ["https://github.com/bazelbuild/bazel-skylib/archive/master.tar.gz"], ) diff --git a/build_defs.bzl b/build_defs.bzl index fc2c0a4c10..f62f42f2dc 100644 --- a/build_defs.bzl +++ b/build_defs.bzl @@ -1,4 +1,3 @@ - load("@bazel_skylib//lib:paths.bzl", "paths") load("@bazel_skylib//lib:versions.bzl", "versions") load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") @@ -278,6 +277,7 @@ def cc_library_func(ctx, name, hdrs, srcs, dep_ccinfos): if not versions.is_at_least("0.25.2", bazel_version): fail("upb requires Bazel >=0.25.2 or 0.24.1") + # copybara:strip_end blaze_only_args = {} @@ -327,7 +327,7 @@ def _compile_upb_protos(ctx, proto_info, proto_sources, ext): "--descriptor_set_in=" + ":".join([f.path for f in transitive_sets]), ] + [_get_real_short_path(file) for file in proto_sources], - progress_message = "Generating upb protos for :" + ctx.label.name, + progress_message = "Generating upb protos for :" + ctx.label.name, ) return SrcList(srcs = srcs, hdrs = hdrs) @@ -485,7 +485,7 @@ upb_proto_srcs = rule( default = "@com_google_protobuf//:protoc", ), "deps": attr.label_list(), - "ext": attr.string(default = ".upb") + "ext": attr.string(default = ".upb"), }, implementation = _upb_proto_srcs_impl, ) diff --git a/repository_defs.bzl b/repository_defs.bzl index 5bbc9cb4a7..7b6e78e8b8 100644 --- a/repository_defs.bzl +++ b/repository_defs.bzl @@ -1,4 +1,3 @@ - # A hacky way to work around the fact that native.bazel_version is only # available from WORKSPACE macros, not BUILD macros or rules. # @@ -11,6 +10,6 @@ def _impl(repository_ctx): repository_ctx.file("BUILD", "") bazel_version_repository = repository_rule( - implementation=_impl, - local=True, + implementation = _impl, + local = True, )