sattvik / leinjacker

A library for Leiningen plug-in authors.
42 stars 11 forks source link

Support Leiningen 2.7 managed dependencies #13

Closed MatthewDarling closed 7 years ago

MatthewDarling commented 7 years ago

What's changed?

As of version 2.7.0, Leiningen supports Maven's managed dependencies. When managed dependencies are used, version numbers in the :dependencies vector can now be nil or left off entirely.

I've rewritten dep-spec? to support the new syntax, with matching tests.

Testing

lein test leinjacker.deps-test passes for me.

I need some help with running the other tests, however. Currently lein test crashes for me with this message:

clojure.lang.Compiler$CompilerException:
  java.lang.IllegalStateException: Unable to find Leiningen 1 in the
    path as lein or lein 1. Please make sure it is installed and in your
    path under one of those names, or set LEIN1_CMD.,
  compiling:(leinjacker/test_multiple_lein_versions.clj:22:1)

I did try lein upgrade 1.7.1 to install Leiningen v1, but that fails because the installer hardcoded the old repository URL for Clojure. So, if anybody else happens to have it installed, help with testing would be great :)

Future compatibility

Leiningen 2.8 will support dependency names as strings. I can add support for that now too, get ahead of that issue.

Version-specific behaviour?

While I've changed dep-spec? so it will always accept managed dependencies, they aren't actually allowed before Lein 2.7. And string dep names are only for Lein 2.8+. Should the behaviour of dep-spec? depend on the version of Leiningen you're running?

sattvik commented 7 years ago

Thanks for an excellent PR!

MatthewDarling commented 7 years ago

Thanks for the merge :) Is it possible to release an updated version sometime soon? Happy to help if there are things that need doing to prepare for that.