Protocol Buffers - Google's data interchange format (grpc依赖) https://developers.google.com/protocol-buffers/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

112 lines
2.5 KiB

# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
load(
"//bazel:build_defs.bzl",
"UPB_DEFAULT_COPTS",
"UPB_DEFAULT_CPPOPTS",
)
load(
"//lua:lua_proto_library.bzl",
"lua_proto_library",
)
licenses(["notice"])
cc_library(
name = "lupb",
srcs = [
"def.c",
"msg.c",
"upb.c",
],
hdrs = [
"upb.h",
],
copts = UPB_DEFAULT_COPTS,
visibility = ["//visibility:public"],
deps = [
"//:json",
"//:message",
"//:reflection",
"//:text",
"@lua//:liblua",
],
)
cc_binary(
name = "protoc-gen-lua",
srcs = ["upbc.cc"],
copts = UPB_DEFAULT_CPPOPTS,
visibility = ["//visibility:public"],
deps = [
"@com_google_absl//absl/strings",
"@com_google_protobuf//src/google/protobuf/compiler:code_generator",
],
)
exports_files(["upb.lua"])
cc_test(
name = "test_lua",
srcs = ["main.c"],
args = ["$(location :test_upb.lua)"],
copts = UPB_DEFAULT_COPTS,
data = [
"test_upb.lua",
":descriptor_proto_lua",
":empty_proto_lua",
":test_messages_proto2_proto_lua",
":test_messages_proto3_proto_lua",
":test_proto_lua",
"//:third_party/lunit/console.lua",
"//:third_party/lunit/lunit.lua",
"//lua:upb.lua",
"@com_google_protobuf//:descriptor_proto",
"@com_google_protobuf//conformance:conformance_proto",
],
linkstatic = 1,
deps = [
"//lua:lupb",
"@lua//:liblua",
],
)
proto_library(
name = "test_proto",
testonly = 1,
srcs = ["test.proto"],
deps = ["@com_google_protobuf//:timestamp_proto"],
)
lua_proto_library(
name = "test_proto_lua",
testonly = 1,
deps = [":test_proto"],
)
lua_proto_library(
name = "descriptor_proto_lua",
deps = ["@com_google_protobuf//:descriptor_proto"],
)
lua_proto_library(
name = "empty_proto_lua",
deps = ["@com_google_protobuf//:empty_proto"],
)
lua_proto_library(
name = "test_messages_proto3_proto_lua",
testonly = 1,
deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto3_proto"],
)
lua_proto_library(
name = "test_messages_proto2_proto_lua",
testonly = 1,
deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto2_proto"],
)