mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
[C++, C#, Java] Separated C# and Java generators into their own classes (#5618)
* Cloned idl_gen_general.cpp to idl_gen_csharp.cpp and removed java references * Java generator changes
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
cbbd6aca04
commit
adbcbba5d1
2
BUILD
2
BUILD
@@ -86,10 +86,12 @@ cc_binary(
|
||||
"grpc/src/compiler/schema_interface.h",
|
||||
"src/flatc_main.cpp",
|
||||
"src/idl_gen_cpp.cpp",
|
||||
"src/idl_gen_csharp.cpp",
|
||||
"src/idl_gen_dart.cpp",
|
||||
"src/idl_gen_general.cpp",
|
||||
"src/idl_gen_go.cpp",
|
||||
"src/idl_gen_grpc.cpp",
|
||||
"src/idl_gen_java.cpp",
|
||||
"src/idl_gen_js_ts.cpp",
|
||||
"src/idl_gen_json_schema.cpp",
|
||||
"src/idl_gen_kotlin.cpp",
|
||||
|
||||
@@ -81,10 +81,12 @@ set(FlatBuffers_Library_SRCS
|
||||
set(FlatBuffers_Compiler_SRCS
|
||||
${FlatBuffers_Library_SRCS}
|
||||
src/idl_gen_cpp.cpp
|
||||
src/idl_gen_csharp.cpp
|
||||
src/idl_gen_dart.cpp
|
||||
src/idl_gen_general.cpp
|
||||
src/idl_gen_kotlin.cpp
|
||||
src/idl_gen_go.cpp
|
||||
src/idl_gen_java.cpp
|
||||
src/idl_gen_js_ts.cpp
|
||||
src/idl_gen_php.cpp
|
||||
src/idl_gen_python.cpp
|
||||
|
||||
@@ -976,9 +976,19 @@ extern bool GenerateBinary(const Parser &parser, const std::string &path,
|
||||
extern bool GenerateCPP(const Parser &parser, const std::string &path,
|
||||
const std::string &file_name);
|
||||
|
||||
// Generate C# files from the definitions in the Parser object.
|
||||
// See idl_gen_csharp.cpp.
|
||||
extern bool GenerateCSharp(const Parser &parser, const std::string &path,
|
||||
const std::string &file_name);
|
||||
|
||||
extern bool GenerateDart(const Parser &parser, const std::string &path,
|
||||
const std::string &file_name);
|
||||
|
||||
// Generate Java files from the definitions in the Parser object.
|
||||
// See idl_gen_java.cpp.
|
||||
extern bool GenerateJava(const Parser &parser, const std::string &path,
|
||||
const std::string &file_name);
|
||||
|
||||
// Generate JavaScript or TypeScript code from the definitions in the Parser
|
||||
// object. See idl_gen_js.
|
||||
extern bool GenerateJSTS(const Parser &parser, const std::string &path,
|
||||
|
||||
@@ -55,7 +55,7 @@ int main(int argc, const char *argv[]) {
|
||||
{ flatbuffers::GenerateGo, "-g", "--go", "Go", true,
|
||||
flatbuffers::GenerateGoGRPC, flatbuffers::IDLOptions::kGo,
|
||||
"Generate Go files for tables/structs", flatbuffers::GeneralMakeRule },
|
||||
{ flatbuffers::GenerateGeneral, "-j", "--java", "Java", true,
|
||||
{ flatbuffers::GenerateJava, "-j", "--java", "Java", true,
|
||||
flatbuffers::GenerateJavaGRPC, flatbuffers::IDLOptions::kJava,
|
||||
"Generate Java classes for tables/structs",
|
||||
flatbuffers::GeneralMakeRule },
|
||||
@@ -70,7 +70,7 @@ int main(int argc, const char *argv[]) {
|
||||
flatbuffers::IDLOptions::kTs,
|
||||
"Generate TypeScript code for tables/structs",
|
||||
flatbuffers::JSTSMakeRule },
|
||||
{ flatbuffers::GenerateGeneral, "-n", "--csharp", "C#", true, nullptr,
|
||||
{ flatbuffers::GenerateCSharp, "-n", "--csharp", "C#", true, nullptr,
|
||||
flatbuffers::IDLOptions::kCSharp,
|
||||
"Generate C# classes for tables/structs", flatbuffers::GeneralMakeRule },
|
||||
{ flatbuffers::GeneratePython, "-p", "--python", "Python", true, nullptr,
|
||||
|
||||
1182
src/idl_gen_csharp.cpp
Normal file
1182
src/idl_gen_csharp.cpp
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1242
src/idl_gen_java.cpp
Normal file
1242
src/idl_gen_java.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user