Question

I got a thrift file which contains tens of structs' definition, and I'm trying to split it to multiple smaller thrift files, so I have a main thrift file which includes other thrift files but only the main file would be compiled, nor the included files, with no error.

My first guess was that's because of no reference from main file to included file since my structs are quite separated. My objective is to compile all the files. So what's the proper way to split a big thrift file like this? (Maybe I was doing something wrong?)

Was it helpful?

Solution

Use the -r switch ("recurse") when launching the Thrift compiler. This will compile all included files too.

Or enter thrift --help to view all the options.

Alternatively, you could iterate through all *.thrift files via loop (depends on your OS). This would also do what you want to achieve but may be more cumbersome.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top