jcrossley3 / lein-modules

An alternative to Maven multi-module projects in Leiningen
Eclipse Public License 1.0
83 stars 17 forks source link

:sub-project arg for lein modules #30

Open alexdforeman opened 9 years ago

alexdforeman commented 9 years ago

HI Jim, In our project we have approx 10 submodules which are interconnected in many ways. lein modules always runs the selected task against all of them. Whilst this is awesome, for a developer working in the middle of the stack to reduce feedback time from testing we have implemented :sub-module which builds the project they are working on and only the other modules which it depends on instead of the entire stack.

I can see other people finding this option very useful so we are contributing it back to you so others can gain this efficiency as well.

I've updated the README as well as documenting the modules method.

Please let me know if anything is amiss.

I've fully tested it on our stack, but unfortunately I do not have a automated test yet.

I hope this helps :D

P.S please get in touch for any questions either through here or by priv mail. Many thanks

jcrossley3 commented 9 years ago

Hey, this is cool! Thank you! :)

jcrossley3 commented 9 years ago

This is a great new feature, but the current implementation breaks the sometimes-handy ability to see a dump of a project's modules when no task is passed. Also, we don't want to overflow the stack when no modules are present. I just pushed some tests to master that validate those features. You should be able to rebase from master and see where the failures are.

Also, in studying your code, I might recommend altering your approach to take advantage of the interdependencies function, which you can compose with progeny to get a map of each module's dependencies. This basically lets you construct a correct :dirs argument, and another recursive call would get the order correct.

Two minor concerns: I'm not crazy about the -modules helper and I kinda want to rename the :sub_module option to :only. I think. Maybe.

Don't mean to sound unappreciative. I love the idea! :)