thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthieu Imbert <>
Subject typical thrift project layout
Date Thu, 06 Aug 2009 12:57:18 GMT
Do some of you have some experiences and/or advices about the kind of
layout and build procedure to choose for a project using thrift and
involving multiple languages (at least 2).

I currently work on a project written primarily in python (the server is
in python), which is growing in size, and to which i am adding some
example client codes in python and in other languages, currently only
perl, but i expect to add client examples in java and c++ pretty soon.

So until now, nearly every python or perl files where mixed in the root
folder of the project and there was no real build or install scripts,
only a shell script to regenerate the thrift stubs in various languages
from my thrift service IDL. These language specific thrift stubs went in
the usual directories gen-py, gen-perl, gen-java and so on, and any code
relying on these stubs needs to manually import the modules (or whatever
you call them in other languages than python) with code like (in python):

import sys
import [...]

of course this works only if the source code is located exactly in the
root directory of the project.

But now, i would like to:

- have a cleaner project directory layout

- have a build system that ideally would be able to generate thrift
stubs from the IDL, compile any code that needs compiling (eg. java or
c++ clients), and package everything in a clean tar.gz

- have a clean installation procedure, in order to be able to distribute
the package to client with clear instructions on how to write client
code, how to import/include thrift files in their code, how and where to
install the generated stubs.

i guess some of you already have some experiences with that, so what
kind of layout do you choose, for the project and for the project files


Matthieu Imbert

View raw message