aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/protobuf/json/proto
diff options
context:
space:
mode:
authormalkovskynv <malkovskynv@yandex-team.com>2023-08-03 13:42:05 +0300
committermalkovskynv <malkovskynv@yandex-team.com>2023-08-03 13:42:05 +0300
commit29af40f86c4159175acf78d57de7cd39e44c0dab (patch)
tree016948d29c43f651dd64d5a9f2d9cbdd4a827bfc /library/cpp/protobuf/json/proto
parentfef1ffbaef82af08b6201f41c2ed15723a4fe1cf (diff)
downloadydb-29af40f86c4159175acf78d57de7cd39e44c0dab.tar.gz
MARKETRECOM-8673_json_enum_value
Diffstat (limited to 'library/cpp/protobuf/json/proto')
-rw-r--r--library/cpp/protobuf/json/proto/CMakeLists.darwin-x86_64.txt43
-rw-r--r--library/cpp/protobuf/json/proto/CMakeLists.linux-aarch64.txt44
-rw-r--r--library/cpp/protobuf/json/proto/CMakeLists.linux-x86_64.txt44
-rw-r--r--library/cpp/protobuf/json/proto/CMakeLists.txt17
-rw-r--r--library/cpp/protobuf/json/proto/CMakeLists.windows-x86_64.txt43
-rw-r--r--library/cpp/protobuf/json/proto/enum_options.proto23
-rw-r--r--library/cpp/protobuf/json/proto/ya.make9
7 files changed, 223 insertions, 0 deletions
diff --git a/library/cpp/protobuf/json/proto/CMakeLists.darwin-x86_64.txt b/library/cpp/protobuf/json/proto/CMakeLists.darwin-x86_64.txt
new file mode 100644
index 0000000000..6c6f4228c3
--- /dev/null
+++ b/library/cpp/protobuf/json/proto/CMakeLists.darwin-x86_64.txt
@@ -0,0 +1,43 @@
+
+# This file was generated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+get_built_tool_path(
+ TOOL_protoc_bin
+ TOOL_protoc_dependency
+ contrib/tools/protoc/bin
+ protoc
+)
+get_built_tool_path(
+ TOOL_cpp_styleguide_bin
+ TOOL_cpp_styleguide_dependency
+ contrib/tools/protoc/plugins/cpp_styleguide
+ cpp_styleguide
+)
+
+add_library(protobuf-json-proto)
+target_link_libraries(protobuf-json-proto PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+ contrib-libs-protobuf
+)
+target_proto_messages(protobuf-json-proto PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/protobuf/json/proto/enum_options.proto
+)
+target_proto_addincls(protobuf-json-proto
+ ./
+ ${CMAKE_SOURCE_DIR}/
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src
+)
+target_proto_outs(protobuf-json-proto
+ --cpp_out=${CMAKE_BINARY_DIR}/
+ --cpp_styleguide_out=${CMAKE_BINARY_DIR}/
+)
diff --git a/library/cpp/protobuf/json/proto/CMakeLists.linux-aarch64.txt b/library/cpp/protobuf/json/proto/CMakeLists.linux-aarch64.txt
new file mode 100644
index 0000000000..1840a34ee6
--- /dev/null
+++ b/library/cpp/protobuf/json/proto/CMakeLists.linux-aarch64.txt
@@ -0,0 +1,44 @@
+
+# This file was generated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+get_built_tool_path(
+ TOOL_protoc_bin
+ TOOL_protoc_dependency
+ contrib/tools/protoc/bin
+ protoc
+)
+get_built_tool_path(
+ TOOL_cpp_styleguide_bin
+ TOOL_cpp_styleguide_dependency
+ contrib/tools/protoc/plugins/cpp_styleguide
+ cpp_styleguide
+)
+
+add_library(protobuf-json-proto)
+target_link_libraries(protobuf-json-proto PUBLIC
+ contrib-libs-linux-headers
+ contrib-libs-cxxsupp
+ yutil
+ contrib-libs-protobuf
+)
+target_proto_messages(protobuf-json-proto PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/protobuf/json/proto/enum_options.proto
+)
+target_proto_addincls(protobuf-json-proto
+ ./
+ ${CMAKE_SOURCE_DIR}/
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src
+)
+target_proto_outs(protobuf-json-proto
+ --cpp_out=${CMAKE_BINARY_DIR}/
+ --cpp_styleguide_out=${CMAKE_BINARY_DIR}/
+)
diff --git a/library/cpp/protobuf/json/proto/CMakeLists.linux-x86_64.txt b/library/cpp/protobuf/json/proto/CMakeLists.linux-x86_64.txt
new file mode 100644
index 0000000000..1840a34ee6
--- /dev/null
+++ b/library/cpp/protobuf/json/proto/CMakeLists.linux-x86_64.txt
@@ -0,0 +1,44 @@
+
+# This file was generated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+get_built_tool_path(
+ TOOL_protoc_bin
+ TOOL_protoc_dependency
+ contrib/tools/protoc/bin
+ protoc
+)
+get_built_tool_path(
+ TOOL_cpp_styleguide_bin
+ TOOL_cpp_styleguide_dependency
+ contrib/tools/protoc/plugins/cpp_styleguide
+ cpp_styleguide
+)
+
+add_library(protobuf-json-proto)
+target_link_libraries(protobuf-json-proto PUBLIC
+ contrib-libs-linux-headers
+ contrib-libs-cxxsupp
+ yutil
+ contrib-libs-protobuf
+)
+target_proto_messages(protobuf-json-proto PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/protobuf/json/proto/enum_options.proto
+)
+target_proto_addincls(protobuf-json-proto
+ ./
+ ${CMAKE_SOURCE_DIR}/
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src
+)
+target_proto_outs(protobuf-json-proto
+ --cpp_out=${CMAKE_BINARY_DIR}/
+ --cpp_styleguide_out=${CMAKE_BINARY_DIR}/
+)
diff --git a/library/cpp/protobuf/json/proto/CMakeLists.txt b/library/cpp/protobuf/json/proto/CMakeLists.txt
new file mode 100644
index 0000000000..f8b31df0c1
--- /dev/null
+++ b/library/cpp/protobuf/json/proto/CMakeLists.txt
@@ -0,0 +1,17 @@
+
+# This file was generated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT HAVE_CUDA)
+ include(CMakeLists.linux-aarch64.txt)
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ include(CMakeLists.darwin-x86_64.txt)
+elseif (WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" AND NOT HAVE_CUDA)
+ include(CMakeLists.windows-x86_64.txt)
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT HAVE_CUDA)
+ include(CMakeLists.linux-x86_64.txt)
+endif()
diff --git a/library/cpp/protobuf/json/proto/CMakeLists.windows-x86_64.txt b/library/cpp/protobuf/json/proto/CMakeLists.windows-x86_64.txt
new file mode 100644
index 0000000000..6c6f4228c3
--- /dev/null
+++ b/library/cpp/protobuf/json/proto/CMakeLists.windows-x86_64.txt
@@ -0,0 +1,43 @@
+
+# This file was generated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+get_built_tool_path(
+ TOOL_protoc_bin
+ TOOL_protoc_dependency
+ contrib/tools/protoc/bin
+ protoc
+)
+get_built_tool_path(
+ TOOL_cpp_styleguide_bin
+ TOOL_cpp_styleguide_dependency
+ contrib/tools/protoc/plugins/cpp_styleguide
+ cpp_styleguide
+)
+
+add_library(protobuf-json-proto)
+target_link_libraries(protobuf-json-proto PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+ contrib-libs-protobuf
+)
+target_proto_messages(protobuf-json-proto PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/protobuf/json/proto/enum_options.proto
+)
+target_proto_addincls(protobuf-json-proto
+ ./
+ ${CMAKE_SOURCE_DIR}/
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src
+)
+target_proto_outs(protobuf-json-proto
+ --cpp_out=${CMAKE_BINARY_DIR}/
+ --cpp_styleguide_out=${CMAKE_BINARY_DIR}/
+)
diff --git a/library/cpp/protobuf/json/proto/enum_options.proto b/library/cpp/protobuf/json/proto/enum_options.proto
new file mode 100644
index 0000000000..0349187b36
--- /dev/null
+++ b/library/cpp/protobuf/json/proto/enum_options.proto
@@ -0,0 +1,23 @@
+syntax="proto3";
+
+import "google/protobuf/descriptor.proto";
+
+/**
+Allows custom strings for Enum proto values when converting to/from json
+
+Example:
+
+Enum SomeEnum {
+ DefaultEnumValue = 0 [json_enum_value="custom_name_for_default_value"];
+}
+message TProtoTest {
+ SomeEnum someField = 0 [json_name="some_field"];
+}
+
+will correspond {"some_field": "custom_name_for_default_value"}
+when [Proto2JsonConfig|Json2ProtoConfig].UseJsonEnumValue = True
+
+*/
+extend google.protobuf.EnumValueOptions {
+ string json_enum_value = 4242279;
+}
diff --git a/library/cpp/protobuf/json/proto/ya.make b/library/cpp/protobuf/json/proto/ya.make
new file mode 100644
index 0000000000..072afd2d43
--- /dev/null
+++ b/library/cpp/protobuf/json/proto/ya.make
@@ -0,0 +1,9 @@
+PROTO_LIBRARY()
+
+SRCS(
+ enum_options.proto
+)
+
+EXCLUDE_TAGS(GO_PROTO)
+
+END()