thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Greene <>
Subject Re: typical thrift project layout
Date Thu, 06 Aug 2009 14:27:49 GMT
I throw everything in an /interface directory under the top-level, and
then use the mechanisms for each language to pick up these relative
paths.  When distributed to other external groups, these are bundled
in using whatever installation process is typical for the environment
(i.e. setuptools on for Python eggs, msbuild on .csproj for
.NET DLLs, ant on build.xml for Java JARs) and then distribute each
language bundle independently.

However, I have the luxury of working with a specific set of
languages.  I'm not aware of a good solution for distributing X
generated sources for languages with which you might not be familiar.


On Thu, Aug 6, 2009 at 7:57 AM, Matthieu
Imbert<> wrote:
> 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
> sys.path.append('gen-py')
> 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
> installation?
> regards,
> --
> Matthieu Imbert

View raw message