java - Thrift compiler - generate different languages to different output paths -
thrift compiler allows specifying output directory generated files.
i writing java client , c# server, , have generated files -gen java
, -gen csharp
located in different directories of project.
is possible?
1. default
... files generated 1 folder per language, following pattern gen-<lang>
.
thrift -gen java -gen csharp myfile.thrift
in case gen-csharp
, gen-java
. if not meet requirements, try
2. explicit out-path
by means of -out
parameter can tell thrift generate code in folder want. caveat these target folders must created beforehand. other default folders these not created automatically.
mkdir my/cool/javadir mkdir my/cool/csdir thrift -gen java -out my/cool/javadir myfile.thrift thrift -gen csharp -out my/cool/csdir myfile.thrift
more info
enter thrift -help
see options:
$ thrift -help usage: thrift [options] file options: -version print compiler version -o dir set output directory gen-* packages (default: current directory) -out dir set ouput location generated files. (no gen-* folder created) -i dir add directory list of directories searched include directives -nowarn suppress compiler warnings (bad!) -strict strict compiler warnings on -v[erbose] verbose mode -r[ecurse] generate included files -debug parse debug trace stdout --allow-neg-keys allow negative field keys (used preserve protocol compatibility older .thrift files) --allow-64bit-consts not print warnings using 64-bit constants --gen str generate code dynamically-registered generator. str has form language[:key1=val1[,key2[,key3=val3]]]. keys , values options passed generator. many options not require values. available generators (and options): (... more options ...)
tl;dr
is possible?
yes, is.
Comments
Post a Comment