More fixes for google3 import.

pull/13171/head
Josh Haberman 6 years ago
parent 9bc7973e38
commit ca5f951137
  1. 17
      BUILD
  2. 19
      build_defs.bzl
  3. 7
      tools/make_cmakelists.py

17
BUILD

@ -7,6 +7,7 @@ load(
"lua_library",
"lua_test",
"make_shell_script",
"map_dep",
"upb_amalgamation",
"upb_proto_library",
"upb_proto_reflection_library",
@ -122,9 +123,9 @@ cc_library(
],
hdrs = ["upbc/generator.h"],
deps = [
"@absl//absl/strings",
"@com_google_protobuf//:protobuf",
"@com_google_protobuf//:protoc_lib",
map_dep("@absl//absl/strings"),
map_dep("@com_google_protobuf//:protobuf"),
map_dep("@com_google_protobuf//:protoc_lib"),
],
)
@ -133,10 +134,16 @@ cc_binary(
srcs = ["upbc/main.cc"],
deps = [
":upbc_generator",
"@com_google_protobuf//:protoc_lib",
map_dep("@com_google_protobuf//:protoc_lib"),
],
)
# We strip the tests and remaining rules from google3 until the upb_proto_library()
# and upb_proto_reflection_library() rules are fixed.
# copybara:strip_for_google3_begin
# C/C++ tests ##################################################################
cc_library(
@ -487,3 +494,5 @@ generated_file_staleness_test(
],
generated_pattern = "generated/%s",
)
# copybara:strip_end

@ -207,6 +207,21 @@ upb_amalgamation = rule(
},
)
is_bazel = not hasattr(native, "genmpm")
google3_dep_map = {
"@absl//absl/strings": "//third_party/absl/strings",
"@com_google_protobuf//:protoc": "//third_party/protobuf:protoc",
"@com_google_protobuf//:protobuf": "//third_party/protobuf:protobuf",
"@com_google_protobuf//:protoc_lib": "//third_party/protobuf:libprotoc",
}
def map_dep(dep):
if is_bazel:
return dep
else:
return google3_dep_map[dep]
# upb_proto_library() rule
def _remove_up(string):
@ -261,7 +276,7 @@ _upb_proto_library_srcs = rule(
"protoc": attr.label(
executable = True,
cfg = "host",
default = "@com_google_protobuf//:protoc",
default = map_dep("@com_google_protobuf//:protoc"),
),
"deps": attr.label_list(),
},
@ -291,7 +306,7 @@ _upb_proto_reflection_library_srcs = rule(
"protoc": attr.label(
executable = True,
cfg = "host",
default = "@com_google_protobuf//:protoc",
default = map_dep("@com_google_protobuf//:protoc"),
),
"deps": attr.label_list(),
},

@ -134,12 +134,15 @@ class BuildFileFunctions(object):
def select(self, arg_dict):
return []
def glob(*args):
def glob(self, *args):
return []
def licenses(*args):
def licenses(self, *args):
pass
def map_dep(self, arg):
return arg
class WorkspaceFileFunctions(object):
def __init__(self, converter):

Loading…
Cancel
Save