How best to structure and build Clojure apps with plugins

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

http://docs.codehaus.org/display/MAVENUSER/Multi-modules+projects http://docs.codehaus.org/display/MAVENUSER/Multi-modules+projects

https://github.com/technomancy/leiningen https://github.com/technomancy/leiningen

Will lein do this? Should I be using Gradle instead? Or is this kind of thing not needed?

http://stackoverflow.com/questions/1810231/defining-a-spi-in-clojure http://stackoverflow.com/questions/1810231/defining-a-spi-in-clojure

  Update   

https://github.com/talios/clojure-maven-plugin https://github.com/talios/clojure-maven-plugin

Answers

First, it does not seem like Leiningen supports a module hierarchy like Maven does. The checkouts are the next closest thing it has. It should be sufficient though to develop a modular application in Clojure though.

For the project structure, I would have an API project, a "core" project, the plugins themselves, and a separate packaging project. The core and the plugins should only depend on the API. Which build tool you use to create the packaging project is up to you. Gradle would probably be more effective at handling the packaging, however having the "checkout" functionality Leiningen offers could make development of the system as a whole easier.

I would take a look at the code for Leiningen and Noir to figure out how to effectively handle this.

For dynamically loading the plugins, I would start with looking how Noir handles it in two of their files:

https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/classpath.clj https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/classpath.clj

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/10272559/how-best-to-structure-and-build-clojure-apps-with-plugins

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils