Fork me on GitHub
#leiningen
<
2023-02-02
>
Jeongsoo Lee04:02:23

I am trying to write a lein plugin, and for testing this I made a mock target project. However, rather than going through a conventional write-compile-test cycle I would like to develop it on the REPL, just I would develop a regular Clojure application. How can I achieve this?

vemv07:02:59

You could try adding leiningen-core as a vanilla dependency Although I think it will be hard to reproduce all the things Lein does for you e.g. evaluate projects, merge aliases, etc I had a good experience simply separating the plugin from the 'core', and developing that core in a vanilla fashion

👀 2
👍 2
Rupert (All Street)08:02:15

Another option is adding nrepl as a dependency - then manually starting from inside your plugin code.

Jeongsoo Lee17:02:10

After some days of contemplation, I decided to develop the core logic independently (on the REPL), and then slap that into leiningen.core/eval-in-project. :thinking_face:

eskos11:02:00

I’ve also done the separated core approach and it works quite well for me; https://github.com/esuomi/git-revisions-lein/blob/master/src/lein_git_revisions/plugin.clj for my https://github.com/esuomi/git-revisions and as you can see, it doesn’t need much to work. I am aware I use the deprecated plugin registration method, PRs welcome 😉

👀 2
👍 2