ocaml-obuild / obuild

simple package build system for ocaml
BSD 2-Clause "Simplified" License
55 stars 20 forks source link

Plugin system #26

Closed rgrinberg closed 10 years ago

rgrinberg commented 11 years ago

For example my fork of obuild contains some code to automatically generate .merlin file after obuild build (https://github.com/def-lkb/merlin) to give my project convenient auto completion. I'm planning on having this work with otags as well. This doesn't really belong in the main branch or to be on by default. So there's nowhere clean to put this as of now.

Would be sweet if there was some sort of a plugin system available. Oasis does this AFAIK but I could never figure out the code to implement my own stuff (this is a compliment to your clean code Vincent!). Anyway I'm just starting this ticket to brainstorm how the plugin system could look like.

vincenthz commented 11 years ago

I'm not a big fan of plugin system, while i think sometimes they are useful, the amount of generic code and complexity to handle them is sometimes not worth it. This also complicate things for the user, as they need to look for arbitrary plugins to do what they want.

I'm not sure why merlin/otags support shouldn't be in the main branch of build, where it can be turn off/on with your obuild configuration file on a global basis (just like annot should too), and with command line flags for specific build (says for automatic building), is there any reason not to do that ? I think it would benefits everyone in general to just have to set a flag to true in a friendly config file instead of gathering plugins, to have the nice IDE stuff generated too.

danmey commented 11 years ago

If you consider plugins, then I'd advise loading them as ocamlfind package.

jeromemaloberti commented 10 years ago

I don't see the benefit of having a plugin architecture in obuild. It makes sense for oasis since it is a front-end for other tools, however, obuild doesn't have such dependencies. I can see (and it is actually my goal) the benefit of having a library version of obuild, where it is possible to write a program that read a .obuild and extract the relevant information for merlin or other. There is also a (pre-)plan to introduce pre-build steps allowing generators such as menhir or atdgen.