Closed reiddraper closed 12 years ago
wrong repo, apologies.
@Raynes, why can't lein make sure compile is always run before test?
On Feb 21, 2012, at 7:32 PM, Reid Draperreply@reply.github.com wrote:
I think it's something along the lines of:
lein protobuf compile lein test
Reply to this email directly or view it on GitHub: https://github.com/flatland/clojure-protobuf/issues/20
@ninjudd The best I can do is provide a hook around test that runs compile
. I think @technomancy talked to you about some global 'always run this' list that it might be possible to add tasks to? If so, we might be able to do that.
The problem with hooks is that the user has to specify them in his project.clj in order for them to work in his project.
https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/eval.clj#L58
This should be easier in Leiningen 2 with prep-tasks.
However, you'll still have to supply a hook to populate the prep-tasks atom. I'm still thinking through a way to allow auto-discover hooks from plugins; would be happy to have some discussion on how that would work.
I think project middleware would be a good solution to this.
On Feb 22, 2012, at 9:52 AM, Phil Hagelbergreply@reply.github.com wrote:
https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/eval.clj#L58
This should be easier in Leiningen 2 with prep-tasks.
However, you'll still have to supply a hook to populate the prep-tasks atom. I'm still thinking through a way to allow auto-discover hooks from plugins; would be happy to have some discussion on how that would work.
Reply to this email directly or view it on GitHub: https://github.com/flatland/clojure-protobuf/issues/20#issuecomment-4111082
I've just pushed out an implementation of project middleware as well as moving prep-tasks into the project map. So now users can add :prep-tasks ["protobuf"] to project.clj and have it run before every eval-in-project. In the future, autodetected middlewares could remove the need for any changes to project.clj.
I think it's something along the lines of: