diff options
Diffstat (limited to 'BUILD')
-rw-r--r-- | BUILD | 85 |
1 files changed, 73 insertions, 12 deletions
@@ -54,9 +54,9 @@ cc_library( "src/google/protobuf/stubs/time.cc", "src/google/protobuf/wire_format_lite.cc", ], + hdrs = glob(["src/google/protobuf/**/*.h"]), copts = COPTS, includes = ["src/"], - hdrs = glob(["src/google/protobuf/**/*.h"]), linkopts = LINK_OPTS, visibility = ["//visibility:public"], ) @@ -106,6 +106,7 @@ cc_library( "src/google/protobuf/util/internal/json_objectwriter.cc", "src/google/protobuf/util/internal/json_stream_parser.cc", "src/google/protobuf/util/internal/object_writer.cc", + "src/google/protobuf/util/internal/proto_writer.cc", "src/google/protobuf/util/internal/protostream_objectsource.cc", "src/google/protobuf/util/internal/protostream_objectwriter.cc", "src/google/protobuf/util/internal/type_info.cc", @@ -156,9 +157,9 @@ cc_proto_library( name = "cc_wkt_protos", srcs = WELL_KNOWN_PROTOS, include = "src", + default_runtime = ":protobuf", internal_bootstrap_hack = 1, protoc = ":protoc", - default_runtime = ":protobuf", visibility = ["//visibility:public"], ) @@ -241,6 +242,7 @@ cc_library( "src/google/protobuf/compiler/javanano/javanano_message.cc", "src/google/protobuf/compiler/javanano/javanano_message_field.cc", "src/google/protobuf/compiler/javanano/javanano_primitive_field.cc", + "src/google/protobuf/compiler/js/js_generator.cc", "src/google/protobuf/compiler/objectivec/objectivec_enum.cc", "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", "src/google/protobuf/compiler/objectivec/objectivec_extension.cc", @@ -328,6 +330,7 @@ RELATIVE_TEST_PROTOS = [ "google/protobuf/util/internal/testdata/struct.proto", "google/protobuf/util/internal/testdata/timestamp_duration.proto", "google/protobuf/util/json_format_proto3.proto", + "google/protobuf/util/message_differencer_unittest.proto", ] TEST_PROTOS = ["src/" + s for s in RELATIVE_TEST_PROTOS] @@ -336,8 +339,8 @@ cc_proto_library( name = "cc_test_protos", srcs = LITE_TEST_PROTOS + TEST_PROTOS, include = "src", - protoc = ":protoc", default_runtime = ":protobuf", + protoc = ":protoc", deps = [":cc_wkt_protos"], ) @@ -428,6 +431,7 @@ cc_test( "src/google/protobuf/util/internal/protostream_objectwriter_test.cc", "src/google/protobuf/util/internal/type_info_test_helper.cc", "src/google/protobuf/util/json_util_test.cc", + "src/google/protobuf/util/message_differencer_unittest.cc", "src/google/protobuf/util/time_util_test.cc", "src/google/protobuf/util/type_resolver_util_test.cc", "src/google/protobuf/well_known_types_unittest.cc", @@ -455,19 +459,23 @@ cc_test( # Java support ################################################################################ genrule( - name = "generate_java_descriptor_proto", - srcs = ["src/google/protobuf/descriptor.proto"], - outs = ["com/google/protobuf/DescriptorProtos.java"], - cmd = "$(location :protoc) --java_out=$(@D)/../../.. $<", + name = "gen_well_known_protos_java", + srcs = WELL_KNOWN_PROTOS, + outs = [ + "wellknown.srcjar" + ], + cmd = "$(location :protoc) --java_out=$(@D)/wellknown.jar" + + " -Isrc $(SRCS) " + + " && mv $(@D)/wellknown.jar $(@D)/wellknown.srcjar", tools = [":protoc"], ) java_library( name = "protobuf_java", srcs = glob([ - "java/src/main/java/com/google/protobuf/*.java", + "java/core/src/main/java/com/google/protobuf/*.java", ]) + [ - ":generate_java_descriptor_proto", + ":gen_well_known_protos_java", ], visibility = ["//visibility:public"], ) @@ -509,14 +517,66 @@ internal_copied_filegroup( include = "python", ) +cc_binary( + name = "internal/_api_implementation.so", + srcs = ["python/google/protobuf/internal/api_implementation.cc"], + copts = COPTS + [ + "-DPYTHON_PROTO2_CPP_IMPL_V2", + ], + linkshared = 1, + linkstatic = 1, + deps = select({ + "//conditions:default": [], + ":use_fast_cpp_protos": ["//util/python:python_headers"], + }), +) + +cc_binary( + name = "pyext/_message.so", + srcs = glob([ + "python/google/protobuf/pyext/*.cc", + "python/google/protobuf/pyext/*.h", + ]), + copts = COPTS + [ + "-DGOOGLE_PROTOBUF_HAS_ONEOF=1", + ], + includes = [ + "python/", + "src/", + ], + linkshared = 1, + linkstatic = 1, + deps = [ + ":protobuf", + ] + select({ + "//conditions:default": [], + ":use_fast_cpp_protos": ["//util/python:python_headers"], + }), +) + +config_setting( + name = "use_fast_cpp_protos", + values = { + "define": "use_fast_cpp_protos=true", + }, +) + py_proto_library( name = "protobuf_python", srcs = WELL_KNOWN_PROTOS, include = "src", + data = select({ + "//conditions:default": [], + ":use_fast_cpp_protos": [ + ":internal/_api_implementation.so", + ":pyext/_message.so", + ], + }), + default_runtime = "", protoc = ":protoc", py_extra_srcs = [":python_srcs"], py_libs = ["//external:six"], - default_runtime = "", + srcs_version = "PY2AND3", visibility = ["//visibility:public"], ) @@ -535,9 +595,9 @@ py_proto_library( name = "python_common_test_protos", srcs = LITE_TEST_PROTOS + TEST_PROTOS, include = "src", + default_runtime = "", protoc = ":protoc", deps = [":protobuf_python"], - default_runtime = "", ) py_proto_library( @@ -547,14 +607,15 @@ py_proto_library( "python/google/protobuf/internal/import_test_package/*.proto", ]), include = "python", + default_runtime = ":protobuf_python", protoc = ":protoc", deps = [":python_common_test_protos"], - default_runtime = ":protobuf_python", ) py_library( name = "python_tests", srcs = [":python_test_srcs"], + srcs_version = "PY2AND3", deps = [ ":protobuf_python", ":python_common_test_protos", |