Leiningen2 + lein-midje + lazytest question

120 views
Skip to first unread message

Cédric Pineau

unread,
Jun 11, 2012, 3:52:32 PM6/11/12
to clo...@googlegroups.com

 I just manage to get the lazytest facility of lein-midje I used with lein1 back with lein2 :

(defproject hands-on "0.1.0-SNAPSHOT"
  :repositories {"stuart" "http://stuartsierra.com/maven2"}
  
  :dependencies [[org.clojure/clojure "1.4.0"]
                 [midje "1.4.0"]
                 [com.stuartsierra/lazytest "1.2.3"]]
  :plugins [[lein-midje "2.0.0-SNAPSHOT"]])


My question is with the lazy-test dependency. Do I really have to put it as a project dependency ?
It doesn't seem to be on the lein-midje path when puting it in the dev-dependencies..

Also, can someone point me to a ~/lein/profiles.clj sample or a complete lein2 documentation ?

Thank you !

--
Cédric

Phil Hagelberg

unread,
Jun 11, 2012, 4:46:33 PM6/11/12
to clo...@googlegroups.com
On Mon, Jun 11, 2012 at 12:52 PM, Cédric Pineau <cedric...@gmail.com> wrote:
> My question is with the lazy-test dependency. Do I really have to put it as
> a project dependency ?
> It doesn't seem to be on the lein-midje path when puting it in the
> dev-dependencies..

If it's required for lein-midje then lein-midje should add it to your
dependencies without you needing to do anything.

> Also, can someone point me to a ~/lein/profiles.clj sample or a complete
> lein2 documentation ?

You should be able to run `lein help profiles` if you have the latest preview.

-Phil

Jacek Laskowski

unread,
Jun 12, 2012, 8:15:38 AM6/12/12
to clo...@googlegroups.com
On Mon, Jun 11, 2012 at 9:52 PM, Cédric Pineau <cedric...@gmail.com> wrote:

> Also, can someone point me to a ~/lein/profiles.clj sample or a complete
> lein2 documentation ?

Just to add to Phil's answer:

The profiles in lein2 are just a map (obviously, isn't it?) where the
key is the name of the profile and the value another map with the
project's key-values as if you were to include in defproject. Unless
I'm mistaken, user, dev and...doh, forgot the one...are automatically
included while executing any lein commands. As you might've guessed,
the key-value pairs of a profile override the project's settings.

Jacek

--
Jacek Laskowski
Functional languages (Clojure), Java EE, and IBM WebSphere -
http://blog.japila.pl
"Never discourage anyone who continually makes progress, no matter how
slow." Plato

Phil Hagelberg

unread,
Jun 12, 2012, 12:05:54 PM6/12/12
to clo...@googlegroups.com
On Mon, Jun 11, 2012 at 1:46 PM, Phil Hagelberg <ph...@hagelb.org> wrote:
> On Mon, Jun 11, 2012 at 12:52 PM, Cédric Pineau <cedric...@gmail.com> wrote:
>> My question is with the lazy-test dependency. Do I really have to put it as
>> a project dependency ?
>> It doesn't seem to be on the lein-midje path when puting it in the
>> dev-dependencies..
>
> If it's required for lein-midje then lein-midje should add it to your
> dependencies without you needing to do anything.

I should clarify that I know nothing about lein-midje in particular;
I'm just commenting on what the proper behaviour of plugins should be.

-Phil

Daniel E. Renfer

unread,
Jun 12, 2012, 12:11:01 PM6/12/12
to clo...@googlegroups.com
On 06/12/2012 12:05 PM, Phil Hagelberg wrote:
> On Mon, Jun 11, 2012 at 1:46 PM, Phil Hagelberg<ph...@hagelb.org> wrote:
>> On Mon, Jun 11, 2012 at 12:52 PM, C�dric Pineau<cedric...@gmail.com> wrote:
>>> My question is with the lazy-test dependency. Do I really have to put it as
>>> a project dependency ?
>>> It doesn't seem to be on the lein-midje path when puting it in the
>>> dev-dependencies..
>> If it's required for lein-midje then lein-midje should add it to your
>> dependencies without you needing to do anything.
> I should clarify that I know nothing about lein-midje in particular;
> I'm just commenting on what the proper behaviour of plugins should be.
>
> -Phil

The issue here is that Midje and lein-midje don't need Lazytest for
normal operation, only for the --lazytest support. What would be the
proper way to specify that dependency without requiring that everyone
that uses Midje also carry around Lazytest?

I know the answer would probably be needing a lein-midje-lazytest
artifact that adds that support, but that seems overkill.

Phil Hagelberg

unread,
Jun 12, 2012, 12:21:51 PM6/12/12
to clo...@googlegroups.com
On Tue, Jun 12, 2012 at 9:11 AM, Daniel E. Renfer <duck1...@gmail.com> wrote:
> The issue here is that Midje and lein-midje don't need Lazytest for normal
> operation, only for the --lazytest support. What would be the proper way to
> specify that dependency without requiring that everyone that uses Midje also
> carry around Lazytest?

If you can determine whether you need it at launch time, you can just
conj another entry onto :dependencies when calling eval-in-project. If
it's unknown until runtime then that's another story.

-Phil
Reply all
Reply to author
Forward
0 new messages