* [Caml-list] thrift and ocamlbuild
@ 2011-03-21 19:48 Joel Reymont
0 siblings, 0 replies; only message in thread
From: Joel Reymont @ 2011-03-21 19:48 UTC (permalink / raw)
To: caml-list
I'm trying to use Apache Thrift with ocamlbuild (oasis actually).
From a single Foo.thrift, Thrift generates Foo_consts.ml, Foo_types.mli and Foo_types.ml.
How do I add a rule for this to ocamlbuild? I tried the following but it doesn't work since ~prod wants a string.
Thanks, Joel
---
open Ocamlbuild_plugin;;
open Command;;
let thrift = A"thrift";;
rule "thrift: %.thrift -> %_types.ml"
~prod:["%.ml";"%_consts.ml";"%_types.ml";"%_types.mli"]
~deps:["%.thrift"]
begin
fun env build ->
Cmd(S[thrift; A"-gen ocaml"; P(env "%.thrift")])
end
;;
--------------------------------------------------------------------------
- for hire: mac osx device driver ninja, kernel extensions and usb drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-03-21 19:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-21 19:48 [Caml-list] thrift and ocamlbuild Joel Reymont
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox